I am having a problem with items in Forge 9.10.0.804. When I create my new item using two old items, I recieve the new one fine, however as soon as I click it my inventory resets to it's previous state. The video explains it better:
[flash=640,360]https://youtube.googleapis.com/v/NXLulVE8x8k
Here is my code for swapping the items:
public void castSpellBlockFirst(ItemStack stack,EntityPlayer player,World world,int x,int y,int z,int side,float hitX,float hitY,float hitZ) {
if(world.getBlockId(x,y,z)==Items.block_spelltable.blockID&&side==1){
if(player.inventory.getStackInSlot(0)!=null){
if(player.inventory.getStackInSlot(0).itemID!=Items.item_apprenticewand.itemID){
/* Here's the items that can turn into spells */
switch(player.inventory.getStackInSlot(0).itemID){
case 370:
player.inventory.consumeInventoryItem(Items.item_apprenticewand.itemID);
player.inventory.consumeInventoryItem(Item.ghastTear.itemID);
player.inventory.addItemStackToInventory(new ItemStack(Items.item_apprenticewand_soul, 1, 0));
break;
default:
player.addChatMessage("§cNo available items found in first slot");
break;
}
}else{
player.addChatMessage("§cWands cannot be transmuted");
}
}else{
player.addChatMessage("§cNo available items found in first slot");
}
}
}
Any help would be appreciated. If you need any information, just post or PM.