MCPcopy Create free account
hub / github.com/SplashAni/RandomMeteor / throwPearl

Method throwPearl

src/main/java/random/meteor/utils/Utils.java:49–64  ·  view source on GitHub ↗
(int value)

Source from the content-addressed store, hash-verified

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();

Callers 1

onActivateMethod · 0.95

Calls 1

rotateMethod · 0.80

Tested by

no test coverage detected