@Override public ActionResult<ItemStack> onItemRightClick( final World w, final EntityPlayer player, final EnumHand hand ) { this.clearPattern( player.getHeldItem( hand ), player ); return new ActionResult<>( EnumActionResult.SUCCESS, player.getHeldItem( hand ) ); }
@Override public EnumActionResult onItemUse( EntityPlayer p, World w, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ ) { return this.onItemUse( p.getHeldItem( hand ), p, w, pos, hand, side, hitX, hitY, hitZ ); }
@Override public EnumActionResult onItemUseFirst( final EntityPlayer player, final World world, final BlockPos pos, final EnumFacing side, final float hitX, final float hitY, final float hitZ, final EnumHand hand ) { return this.disassembleDrive( player.getHeldItem( hand ), world, player ) ? EnumActionResult.SUCCESS : EnumActionResult.PASS; }
@Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing s, float xs, float ys, float zs) { ItemStack stack = player.getHeldItem(hand); return addStack(world, pos, stack, player.capabilities.isCreativeMode); }
private ItemStack getAmmo(EntityPlayer player) { if(isArrow(player.getHeldItem(EnumHand.OFF_HAND))) return player.getHeldItem(EnumHand.OFF_HAND); else if(isArrow(player.getHeldItem(EnumHand.MAIN_HAND))) return player.getHeldItem(EnumHand.MAIN_HAND); else for(int i = 0; i < player.inventory.getSizeInventory(); ++i) { ItemStack itemstack = player.inventory.getStackInSlot(i); if (isArrow(itemstack)) return itemstack; } return ItemStack.EMPTY; }
@Nonnull @Override public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, @Nonnull EnumHand hand) { player.openGui(Botania.instance, LibGuiIDs.BAUBLE_BOX, world, hand == EnumHand.OFF_HAND ? 1 : 0, 0, 0); return ActionResult.newResult(EnumActionResult.SUCCESS, player.getHeldItem(hand)); }
@Nonnull @Override public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, @Nonnull EnumHand hand) { player.setActiveHand(hand); return ActionResult.newResult(EnumActionResult.SUCCESS, player.getHeldItem(hand)); }
@Nonnull @Override public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, @Nonnull EnumHand hand) { player.setActiveHand(hand); return ActionResult.newResult(EnumActionResult.SUCCESS, player.getHeldItem(hand)); }
@Nonnull @Override public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, @Nonnull EnumHand hand) { player.setActiveHand(hand); return ActionResult.newResult(EnumActionResult.SUCCESS, player.getHeldItem(hand)); }
@Nonnull @Override public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, @Nonnull EnumHand hand) { player.setActiveHand(hand); return ActionResult.newResult(EnumActionResult.SUCCESS, player.getHeldItem(hand)); }
@Nonnull @Override public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, @Nonnull EnumHand hand) { player.openGui(Botania.instance, LibGuiIDs.FLOWER_BAG, world, hand == EnumHand.OFF_HAND ? 1 : 0, 0, 0); return ActionResult.newResult(EnumActionResult.SUCCESS, player.getHeldItem(hand)); }
private void clearCard( final EntityPlayer player, final World w, final EnumHand hand ) { final IMemoryCard mem = (IMemoryCard) player.getHeldItem( hand ).getItem(); mem.notifyUser( player, MemoryCardMessages.SETTINGS_CLEARED ); player.getHeldItem( hand ).setTagCompound( null ); } }
@Override public ActionResult<ItemStack> onItemRightClick( final World w, final EntityPlayer p, final EnumHand hand ) { if( p.isSneaking() ) { this.encode( p.getHeldItem( hand ), p ); p.swingArm( hand ); return new ActionResult<>( EnumActionResult.SUCCESS, p.getHeldItem( hand ) ); } return new ActionResult<>( EnumActionResult.PASS, p.getHeldItem( hand ) ); }
@Override public ActionResult<ItemStack> onItemRightClick( final World w, final EntityPlayer player, final EnumHand hand ) { AEApi.instance().registries().wireless().openWirelessTerminalGui( player.getHeldItem( hand ), w, player ); return new ActionResult<>( EnumActionResult.SUCCESS, player.getHeldItem( hand ) ); }
@Nonnull @Override public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, @Nonnull EnumHand hand) { ItemStack stack = player.getHeldItem(hand); int dmg = stack.getItemDamage(); stack.setItemDamage(~dmg & 1); world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP, SoundCategory.NEUTRAL, 0.3F, 0.1F); return ActionResult.newResult(EnumActionResult.SUCCESS, stack); }
@Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing s, float xs, float ys, float zs) { ItemStack stack = player.getHeldItem(hand); if(!stack.isEmpty()) { TileCorporeaCrystalCube cube = (TileCorporeaCrystalCube) world.getTileEntity(pos); cube.setRequestTarget(stack); return true; } return false; }
@Override public EnumActionResult onItemUseFirst( final EntityPlayer player, final World world, final BlockPos pos, final EnumFacing side, final float hitX, final float hitY, final float hitZ, final EnumHand hand ) { return AEApi.instance().partHelper().placeBus( player.getHeldItem( hand ), pos, side, player, hand, world ); }
@Nonnull @Override public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, @Nonnull EnumHand hand) { ItemStack stack = player.getHeldItem(hand); if(getBlock(stack) != null && player.isSneaking()) { int dmg = stack.getItemDamage(); stack.setItemDamage(~dmg & 1); player.playSound(SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP, 0.3F, 0.1F); return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } return ActionResult.newResult(EnumActionResult.PASS, stack); }
@Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { if(hand == EnumHand.MAIN_HAND && playerIn.isSneaking() && playerIn.getHeldItem(hand).isEmpty()) { ((TileAnimatedTorch) worldIn.getTileEntity(pos)).handRotate(); return true; } return false; }
@Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { ItemStack stack = player.getHeldItem(hand); if(!stack.isEmpty() && stack.getItem() == ModItems.dye) { EnumDyeColor newColor = EnumDyeColor.byMetadata(stack.getItemDamage()); EnumDyeColor oldColor = state.getValue(BotaniaStateProps.COLOR); if(newColor != oldColor) world.setBlockState(pos, state.withProperty(BotaniaStateProps.COLOR, newColor), 1 | 2); return true; } return ((TileSpecialFlower) world.getTileEntity(pos)).onBlockActivated(world, pos, state, player, hand, side, hitX, hitY, hitZ); }