Fix more items and unsafe checks that made items get deleted.
This commit is contained in:
@@ -144,9 +144,9 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard
|
||||
{
|
||||
if( player.isSneaking() && !w.isRemote )
|
||||
{
|
||||
final IMemoryCard mem = (IMemoryCard) player.getHeldItemMainhand().getItem();
|
||||
final IMemoryCard mem = (IMemoryCard) player.getHeldItem(hand).getItem();
|
||||
mem.notifyUser( player, MemoryCardMessages.SETTINGS_CLEARED );
|
||||
player.getHeldItemMainhand().setTagCompound( null );
|
||||
player.getHeldItem(hand).setTagCompound( null );
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -67,7 +67,7 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell,
|
||||
public ActionResult<ItemStack> onItemRightClick( final World w, final EntityPlayer player, final EnumHand hand )
|
||||
{
|
||||
Platform.openGUI( player, null, AEPartLocation.INTERNAL, GuiBridge.GUI_PORTABLE_CELL );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, player.getHeldItemMainhand() );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, player.getHeldItem(hand) );
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
|
||||
@@ -58,8 +58,8 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick( final World w, final EntityPlayer player, final EnumHand hand )
|
||||
{
|
||||
AEApi.instance().registries().wireless().openWirelessTerminalGui( player.getHeldItemMainhand(), w, player );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, player.getHeldItemMainhand() );
|
||||
AEApi.instance().registries().wireless().openWirelessTerminalGui( player.getHeldItem(hand), w, player );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, player.getHeldItem(hand) );
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
|
||||
Reference in New Issue
Block a user