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