| 47 | } |
| 48 | |
| 49 | public static void throwPearl(int value) { |
| 50 | FindItemResult pearl = InvUtils.findInHotbar(Items.ENDER_PEARL); |
| 51 | if (!pearl.found()) return; |
| 52 | |
| 53 | assert mc.player != null; |
| 54 | Rotations.rotate(mc.player.getYaw(), value, () -> { |
| 55 | if (pearl.getHand() != null) { |
| 56 | mc.interactionManager.interactItem(mc.player, pearl.getHand()); |
| 57 | } else { |
| 58 | swap(pearl.slot(), true); |
| 59 | assert mc.interactionManager != null; |
| 60 | mc.interactionManager.interactItem(mc.player, pearl.getHand()); |
| 61 | InvUtils.swapBack(); |
| 62 | } |
| 63 | }); |
| 64 | } |
| 65 | |
| 66 | public static boolean isRange(PlayerEntity player, BlockPos poz, int range) { |
| 67 | BlockPos playerPos = player.getBlockPos(); |