@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.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.setActiveHand(hand); ItemStack stack = player.getHeldItem(hand); setCharging(stack, true); return ActionResult.newResult(EnumActionResult.SUCCESS, stack); }
@Nonnull @Override public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, @Nonnull EnumHand hand) { ItemStack stack = player.getHeldItem(hand); if(getSound(stack) != null) player.setActiveHand(hand); return ActionResult.newResult(EnumActionResult.SUCCESS, stack); }
@Nonnull @Override public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, @Nonnull EnumHand hand) { ItemStack stack = player.getHeldItem(hand); if(player.capabilities.isCreativeMode || PlayerHelper.hasAmmo(player, AMMO_FUNC)) { player.setActiveHand(hand); return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } return ActionResult.newResult(EnumActionResult.PASS, stack); }
@Nonnull @Override public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, @Nonnull EnumHand hand) { ItemStack stack = player.getHeldItem(hand); if(player.canEat(false) && isRightPlayer(player, stack)) { player.setActiveHand(hand); return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } return ActionResult.newResult(EnumActionResult.PASS, stack); }
@Nonnull @Override public ActionResult<ItemStack> onItemRightClick(@Nonnull World world, EntityPlayer player, @Nonnull EnumHand hand) { ItemStack stack = player.getHeldItem(hand); // Copy from superclass with our own check boolean flag = canFire(stack, player); ActionResult<ItemStack> ret = ForgeEventFactory.onArrowNock(stack, world, player, hand, flag); if (ret != null) return ret; if (!player.capabilities.isCreativeMode && !flag) { return new ActionResult<>(EnumActionResult.FAIL, stack); } else { player.setActiveHand(hand); return new ActionResult<>(EnumActionResult.SUCCESS, stack); } }
@Nonnull @Override public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, @Nonnull EnumHand hand) { ItemStack stack = player.getHeldItem(hand); int meta = stack.getItemDamage(); if(meta != 0 || ManaItemHandler.requestManaExactForTool(stack, player, COST, false)) { player.setActiveHand(hand); if(meta == 0) { ManaItemHandler.requestManaExactForTool(stack, player, COST, true); setFlying(stack, true); } return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } return ActionResult.newResult(EnumActionResult.PASS, stack); }
@Nonnull @Override public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, @Nonnull EnumHand hand) { Botania.proxy.removeSextantMultiblock(); ItemStack stack = player.getHeldItem(hand); if(!player.isSneaking()) { RayTraceResult pos = ToolCommons.raytraceFromEntity(world, player, false, 128); if(pos != null && pos.entityHit == null && pos.getBlockPos() != null) { if(!world.isRemote) { ItemNBTHelper.setInt(stack, TAG_SOURCE_X, pos.getBlockPos().getX()); ItemNBTHelper.setInt(stack, TAG_SOURCE_Y, pos.getBlockPos().getY()); ItemNBTHelper.setInt(stack, TAG_SOURCE_Z, pos.getBlockPos().getZ()); } } else ItemNBTHelper.setInt(stack, TAG_SOURCE_Y, -1); player.setActiveHand(hand); } return ActionResult.newResult(EnumActionResult.SUCCESS, stack); }
@Override public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) { playerIn.setActiveHand(handIn); ItemStack itemStack = playerIn.getHeldItem(handIn); return new ActionResult<>(EnumActionResult.SUCCESS, itemStack); }
@Override public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand){ player.setActiveHand(hand); return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, player.getHeldItem(hand)); }
@Override public @Nonnull ActionResult<ItemStack> onItemRightClick(@Nonnull World world, @Nonnull EntityPlayer player, @Nonnull EnumHand hand) { ItemStack stack = player.getHeldItem(hand); long lastUsed = LAST_USED_TICK.getLong(stack); if ((lastUsed < 0 || (world.getTotalWorldTime() - lastUsed) > 20) && getEnergyStored(stack) > 0) { player.setActiveHand(hand); } return new ActionResult<ItemStack>(EnumActionResult.PASS, stack); }
@Override public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand hand) { if(hasLiquid) { if(playerIn.getFoodStats().needFood()) { playerIn.setActiveHand(hand); } } return new ActionResult<>(EnumActionResult.SUCCESS, playerIn.getHeldItem(hand)); }
@Override public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand hand) { ItemStack itemStackHeld = playerIn.getHeldItem(hand); int metadata = itemStackHeld.getMetadata(); int fullnessBits = (metadata >> 2) & 0x07; EnumBottleFullness fullness = EnumBottleFullness.byMetadata(fullnessBits); if (fullness == EnumBottleFullness.EMPTY) return new ActionResult(EnumActionResult.FAIL, itemStackHeld); playerIn.setActiveHand(hand); return new ActionResult(EnumActionResult.PASS, itemStackHeld); }