Fixed Pattern De-Coding.
This commit is contained in:
parent
43be28d6ad
commit
6177c854d0
|
@ -31,9 +31,13 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
|
|||
MinecraftForgeClient.registerItemRenderer( this, new ItemEncodedPatternRenderer() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||
private boolean clearPattern(ItemStack stack, EntityPlayer player)
|
||||
{
|
||||
if ( player.isSneaking() )
|
||||
{
|
||||
if ( Platform.isClient() )
|
||||
return false;
|
||||
|
||||
InventoryPlayer inv = player.inventory;
|
||||
|
||||
for (int s = 0; s < player.inventory.getSizeInventory(); s++)
|
||||
|
@ -44,14 +48,22 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
|
|||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World w, EntityPlayer p)
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
return AEApi.instance().materials().materialBlankPattern.stack( stack.stackSize );
|
||||
return clearPattern( stack, player );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World w, EntityPlayer player)
|
||||
{
|
||||
clearPattern( stack, player );
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue