Posts: 219
Threads: 11
Joined: Dec 2013
Thanks: 52
Given 8 thank(s) in 4 post(s)
I'm currently working on enchanting for mcserver.
Working:
- opening window
- drop item in the slot 0 when the player close the window
Current Question: How can i send the three enchanting fields to the player?
Posts: 1,162
Threads: 68
Joined: Mar 2013
Thanks: 245
Given 125 thank(s) in 100 post(s)
01-20-2014, 12:07 AM
(This post was last modified: 01-20-2014, 12:09 AM by tonibm19.)
itemtype -1 means there is no item there, it's empty.
Also, you should use E_ITEM_WOODEN_SWORD instead of 268
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1075 thank(s) in 852 post(s)
Instead of checking if m_ItemType is -1, you should use the IsEmpty() function. An empty item may be also one that has a valid m_ItemType, but the m_ItemCount is zero.
Posts: 219
Threads: 11
Joined: Dec 2013
Thanks: 52
Given 8 thank(s) in 4 post(s)
01-20-2014, 02:03 AM
(This post was last modified: 01-20-2014, 02:09 AM by daniel0916.)
Okay, but when i click on the item in the console it comes the message that the item is a wooden sword but when i do the item in the enchant slot it is -1. But when i click on the item then it is a wooden sword. Have someone a idea why?
How can i get the item which is currently in the enchantment table?
Posts: 1,162
Threads: 68
Joined: Mar 2013
Thanks: 245
Given 125 thank(s) in 100 post(s)
There is a GetSlot() function.
Posts: 219
Threads: 11
Joined: Dec 2013
Thanks: 52
Given 8 thank(s) in 4 post(s)
Enchanting Packet is also added to the 1.7 Protocol.
Posts: 1,162
Threads: 68
Joined: Mar 2013
Thanks: 245
Given 125 thank(s) in 100 post(s)
01-20-2014, 06:02 AM
(This post was last modified: 01-20-2014, 06:02 AM by tonibm19.)
try
this->m_ParentWindow.SetProperty(0, nil);
this->m_ParentWindow.SetProperty(1, nil);
this->m_ParentWindow.SetProperty(2, nil);