@Override public final ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand){ return super.onItemRightClick(world, player, hand); }
@Override public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) { recalculatePowers(player.getHeldItem(hand), world, player); return super.onItemRightClick(world, player, hand); }
@Override public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) { ItemStack stack = player.getHeldItem(hand); if (player.isSneaking()) setActivatedState(stack, !getActivated(stack)); // if (!player.isSneaking() && getActivated(stack)) // { // BoundToolEvent.Charge event = new BoundToolEvent.Charge(player, stack); // if (MinecraftForge.EVENT_BUS.post(event)) // return new ActionResult<ItemStack>(EnumActionResult.FAIL, event.result); // // player.setActiveHand(hand); // return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack); // } return super.onItemRightClick(world, player, hand); }
@Override @Nonnull public ActionResult<ItemStack> onItemRightClick(@Nonnull World world, @Nonnull EntityPlayer player, @Nonnull EnumHand hand) { if (hand == EnumHand.MAIN_HAND) { ItemStack stack = player.getHeldItem(hand); if (isTravelUpgradeActive(player, stack)) { if (world.isRemote) { if (TravelController.instance.activateTravelAccessable(stack, hand, world, player, TravelSource.STAFF)) { player.swingArm(hand); return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack); } } long ticksSinceBlink = EnderIO.proxy.getTickCount() - lastBlickTick; if (ticksSinceBlink < 0) { lastBlickTick = -1; } if (TeleportConfig.enableBlink.get() && world.isRemote && ticksSinceBlink >= TeleportConfig.blinkDelay.get()) { if (TravelController.instance.doBlink(stack, hand, player)) { player.swingArm(hand); lastBlickTick = EnderIO.proxy.getTickCount(); } } return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack); } } return super.onItemRightClick(world, player, hand); }