@@ -156,15 +156,22 @@ public class ContainerQuartzKnife extends AEBaseContainer
|
|||||||
|
|
||||||
private void makePlate()
|
private void makePlate()
|
||||||
{
|
{
|
||||||
if( !this.getItemHandler().extractItem( 0, 1, false ).isEmpty() )
|
if( Platform.isServer() )
|
||||||
{
|
{
|
||||||
final ItemStack item = ContainerQuartzKnife.this.toolInv.getItemStack();
|
if( !this.getItemHandler().extractItem( 0, 1, false ).isEmpty() )
|
||||||
item.damageItem( 1, ContainerQuartzKnife.this.getPlayerInv().player );
|
|
||||||
|
|
||||||
if( item.getCount() == 0 )
|
|
||||||
{
|
{
|
||||||
ContainerQuartzKnife.this.getPlayerInv().mainInventory.add( ContainerQuartzKnife.this.getPlayerInv().currentItem, ItemStack.EMPTY );
|
final ItemStack item = ContainerQuartzKnife.this.toolInv.getItemStack();
|
||||||
MinecraftForge.EVENT_BUS.post( new PlayerDestroyItemEvent( ContainerQuartzKnife.this.getPlayerInv().player, item, null ) );
|
final ItemStack before = item.copy();
|
||||||
|
item.damageItem( 1, ContainerQuartzKnife.this.getPlayerInv().player );
|
||||||
|
|
||||||
|
if( item.getCount() == 0 )
|
||||||
|
{
|
||||||
|
ContainerQuartzKnife.this.getPlayerInv()
|
||||||
|
.setInventorySlotContents( ContainerQuartzKnife.this.getPlayerInv().currentItem, ItemStack.EMPTY );
|
||||||
|
MinecraftForge.EVENT_BUS.post( new PlayerDestroyItemEvent( ContainerQuartzKnife.this.getPlayerInv().player, before, null ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
ContainerQuartzKnife.this.detectAndSendChanges();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user