From 0c2b307eab67b7f37d82a7862a6acbcd96b45adb Mon Sep 17 00:00:00 2001 From: daniel0916 Date: Mon, 20 Jan 2014 18:22:08 +0100 Subject: first changes for enchanting (not finished) - added enchanting table block handler and added it to the blockhandler - added enchanting window - drop item in the slot 0 when the player close the window - added enchanting packet (1.7 only) - some more... --- src/UI/Window.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/UI/Window.h') diff --git a/src/UI/Window.h b/src/UI/Window.h index 030182888..cdaec5aaa 100644 --- a/src/UI/Window.h +++ b/src/UI/Window.h @@ -231,6 +231,18 @@ public: +class cEnchantingWindow : + public cWindow +{ + typedef cWindow super; +public: + cEnchantingWindow(int a_BlockX, int a_BlockY, int a_BlockZ); +}; + + + + + class cFurnaceWindow : public cWindow { -- cgit v1.2.3 From e6e702e7fdbc8b7475d3dbecc0f81a08304997ae Mon Sep 17 00:00:00 2001 From: daniel0916 Date: Sat, 12 Apr 2014 14:58:46 +0200 Subject: Added complete Enchanting System http://minecraft.gamepedia.com/Enchantment_mechanics --- src/UI/Window.h | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/UI/Window.h') diff --git a/src/UI/Window.h b/src/UI/Window.h index cdaec5aaa..52ab6c3ae 100644 --- a/src/UI/Window.h +++ b/src/UI/Window.h @@ -136,11 +136,11 @@ public: void SetWindowTitle(const AString & a_WindowTitle ) { m_WindowTitle = a_WindowTitle; } /// Sends the UpdateWindowProperty (0x69) packet to all clients of the window - void SetProperty(int a_Property, int a_Value); + virtual void SetProperty(int a_Property, int a_Value); /// Sends the UpdateWindowPropert(0x69) packet to the specified player - void SetProperty(int a_Property, int a_Value, cPlayer & a_Player); - + virtual void SetProperty(int a_Property, int a_Value, cPlayer & a_Player); + // tolua_end void OwnerDestroyed(void); @@ -165,7 +165,7 @@ public: /// Used by cSlotAreas to send individual slots to clients, a_RelativeSlotNum is the slot number relative to a_SlotArea void SendSlot(cPlayer & a_Player, cSlotArea * a_SlotArea, int a_RelativeSlotNum); - + protected: cSlotAreas m_SlotAreas; @@ -237,6 +237,18 @@ class cEnchantingWindow : typedef cWindow super; public: cEnchantingWindow(int a_BlockX, int a_BlockY, int a_BlockZ); + virtual void SetProperty(int a_Property, int a_Value, cPlayer & a_Player) override; + virtual void SetProperty(int a_Property, int a_Value) override; + + /** Return the Value of a Property */ + int GetPropertyValue(int a_Property); + + /** Set the Position Values to the Position of the Enchantment Table */ + void GetBlockPos(int & a_PosX, int & a_PosY, int & a_PosZ); + +protected: + int m_PropertyValue0, m_PropertyValue1, m_PropertyValue2; + int m_BlockX, m_BlockY, m_BlockZ; }; -- cgit v1.2.3 From fce9ea65c35ab7f94c23bb361386b5ce223279eb Mon Sep 17 00:00:00 2001 From: daniel0916 Date: Sun, 13 Apr 2014 22:15:10 +0200 Subject: Fixed invisibility enchantments --- src/UI/Window.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/UI/Window.h') diff --git a/src/UI/Window.h b/src/UI/Window.h index 52ab6c3ae..5e799248c 100644 --- a/src/UI/Window.h +++ b/src/UI/Window.h @@ -246,6 +246,8 @@ public: /** Set the Position Values to the Position of the Enchantment Table */ void GetBlockPos(int & a_PosX, int & a_PosY, int & a_PosZ); + cSlotArea * m_SlotArea; + protected: int m_PropertyValue0, m_PropertyValue1, m_PropertyValue2; int m_BlockX, m_BlockY, m_BlockZ; -- cgit v1.2.3 From f9343a8490b50cb28a62c7327c0013da48ca2745 Mon Sep 17 00:00:00 2001 From: daniel0916 Date: Thu, 17 Apr 2014 13:15:35 +0200 Subject: Modified many things --- src/UI/Window.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/UI/Window.h') diff --git a/src/UI/Window.h b/src/UI/Window.h index 5e799248c..1ca67bfd8 100644 --- a/src/UI/Window.h +++ b/src/UI/Window.h @@ -249,7 +249,7 @@ public: cSlotArea * m_SlotArea; protected: - int m_PropertyValue0, m_PropertyValue1, m_PropertyValue2; + int m_PropertyValue[3]; int m_BlockX, m_BlockY, m_BlockZ; }; -- cgit v1.2.3