use of meteordevelopment.orbit.EventHandler in project vector-addon by cally72jhb.
the class BowBomb method onSendPacket.
@EventHandler
private void onSendPacket(PacketEvent.Send event) {
if (event.packet == null)
return;
if (event.packet instanceof PlayerActionC2SPacket) {
PlayerActionC2SPacket packet = (PlayerActionC2SPacket) event.packet;
if (packet.getAction() == PlayerActionC2SPacket.Action.RELEASE_USE_ITEM) {
if (isSpoofable()) {
deactivate();
spoofed = false;
if (System.currentTimeMillis() - lastShoot >= timeout.get()) {
lastShoot = System.currentTimeMillis();
float value = (float) Math.pow(base.get(), -exponent.get());
if (sprint.get())
mc.player.networkHandler.sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.START_SPRINTING));
for (int index = 0; index < spoofs.get(); ++index) {
if (bypass.get()) {
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY() + value, mc.player.getZ(), false));
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY() - value, mc.player.getZ(), true));
} else {
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY() - value, mc.player.getZ(), true));
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY() + value, mc.player.getZ(), false));
}
}
spoofed = true;
}
}
}
}
}
use of meteordevelopment.orbit.EventHandler in project banana-for-everyone by Bennooo.
the class AutoAuto method onTick.
@EventHandler
private void onTick(TickEvent.Pre event) {
// Fields
Modules modules = Modules.get();
SurroundPlus SP = modules.get(SurroundPlus.class);
AntiGhostBlock AGB = modules.get(AntiGhostBlock.class);
AutoCityPlus AC = modules.get(AutoCityPlus.class);
BurrowMiner BM = modules.get(BurrowMiner.class);
if (surroundPlus.get()) {
if ((onlyGround.get() && mc.player.isOnGround()) || !onlyGround.get()) {
if (((BPlusEntityUtils.isInHole(mc.player, true, BPlusEntityUtils.BlastResistantType.Any) && allowDouble.get()) || (BPlusEntityUtils.isSurrounded(mc.player, BPlusEntityUtils.BlastResistantType.Any))) && !SP.isActive()) {
SP.toggle();
}
}
}
if (antiGhost.get()) {
if (SP.isActive() && BPlusEntityUtils.isSurrounded(mc.player, BPlusEntityUtils.BlastResistantType.Any) && !mc.player.getAbilities().creativeMode) {
shouldAntiGhost = true;
if (!AGB.isActive() && AGB.autoToggle.get() && shouldAntiGhost && !didAntiGhost) {
AGB.toggle();
shouldAntiGhost = false;
didAntiGhost = true;
}
if (!AGB.autoToggle.get() && AGB.isActive() && shouldAntiGhost && !didAntiGhost) {
AGB.toggle();
AGB.toggle();
shouldAntiGhost = false;
didAntiGhost = true;
}
} else {
shouldAntiGhost = false;
didAntiGhost = false;
}
}
if (autoCity.get()) {
if ((AConlyinHole.get() && (BPlusEntityUtils.isSurrounded(mc.player, BPlusEntityUtils.BlastResistantType.Any) || (BPlusEntityUtils.isInHole(mc.player, true, BPlusEntityUtils.BlastResistantType.Any) && ACallowDoubleHole.get()))) || !AConlyinHole.get()) {
if (!AC.isActive()) {
PlayerEntity ACtarget = TargetUtils.getPlayerTarget(ACtargetRange.get(), SortPriority.LowestDistance);
if (ACtarget == null)
return;
else {
if (BPlusEntityUtils.isBurrowed(ACtarget, BPlusEntityUtils.BlastResistantType.Mineable) || (BPlusEntityUtils.isSurrounded(ACtarget, BPlusEntityUtils.BlastResistantType.Mineable))) {
AC.toggle();
}
}
}
}
}
if (burrowMiner.get()) {
if ((BMonlyinHole.get() && BPlusEntityUtils.isSurrounded(mc.player, BPlusEntityUtils.BlastResistantType.Any) || (BPlusEntityUtils.isInHole(mc.player, true, BPlusEntityUtils.BlastResistantType.Any) && BMallowDoubleHole.get())) || !BMonlyinHole.get()) {
if (!BM.isActive()) {
PlayerEntity BMtarget = TargetUtils.getPlayerTarget(BMtargetRange.get(), SortPriority.LowestDistance);
if (BMtarget == null)
return;
else {
if (BPlusEntityUtils.isBurrowed(BMtarget, BPlusEntityUtils.BlastResistantType.Any)) {
BM.toggle();
}
}
}
}
}
}
use of meteordevelopment.orbit.EventHandler in project banana-for-everyone by Bennooo.
the class AutoCityPlus method onTick.
@EventHandler
private void onTick(TickEvent.Pre event) {
if (mode.get() == Mode.Normal) {
if (TargetUtils.isBadTarget(target, targetRange.get())) {
PlayerEntity search = TargetUtils.getPlayerTarget(targetRange.get(), SortPriority.LowestDistance);
if (search != target)
sentMessage = false;
target = search;
}
if (TargetUtils.isBadTarget(target, targetRange.get())) {
target = null;
blockPosTarget = null;
toggle();
return;
}
if (prioBurrowed.get() && BPlusEntityUtils.isBurrowed(target, BPlusEntityUtils.BlastResistantType.Mineable)) {
blockPosTarget = target.getBlockPos();
if (!burrowMessage && chatInfo.get()) {
warning("Mining %s's burrow.", target.getEntityName());
burrowMessage = true;
}
} else if (noCitySurrounded.get() && !BPlusEntityUtils.isSurrounded(target, BPlusEntityUtils.BlastResistantType.Any)) {
warning("%s is not surrounded... disabling", target.getEntityName());
blockPosTarget = null;
toggle();
return;
} else if (avoidSelf.get()) {
blockPosTarget = BPlusEntityUtils.getTargetBlock(target);
if (blockPosTarget == null && lastResort.get())
blockPosTarget = BPlusEntityUtils.getCityBlock(target);
} else
blockPosTarget = BPlusEntityUtils.getCityBlock(target);
}
if (blockPosTarget == null) {
error("No target block found... disabling.");
toggle();
target = null;
return;
} else if (!sentMessage && chatInfo.get() && blockPosTarget != target.getBlockPos()) {
warning("Attempting to city %s.", target.getEntityName());
sentMessage = true;
}
if (BPlusPlayerUtils.distanceFromEye(blockPosTarget) > mineRange.get()) {
error("Target block out of reach... disabling.");
toggle();
return;
}
Modules modules = Modules.get();
if (turnOnBBomber.get() && blockPosTarget != null && !modules.get(BananaBomber.class).isActive())
modules.get(BananaBomber.class).toggle();
if (turnOnButtonTrap.get() && blockPosTarget != null && !modules.get(AntiSurround.class).isActive())
modules.get(AntiSurround.class).toggle();
if (turnOffInstaMine.get() && blockPosTarget != null && modules.get(InstaMine.class).isActive())
modules.get(InstaMine.class).toggle();
FindItemResult pickaxe = InvUtils.find(itemStack -> itemStack.getItem() == Items.DIAMOND_PICKAXE || itemStack.getItem() == Items.NETHERITE_PICKAXE);
if (!pickaxe.isHotbar()) {
error("No pickaxe found... disabling.");
toggle();
return;
}
if (support.get() && !BPlusEntityUtils.isBurrowed(target, BPlusEntityUtils.BlastResistantType.Any)) {
if (BPlusPlayerUtils.distanceFromEye(blockPosTarget.down(1)) < supportRange.get()) {
BlockUtils.place(blockPosTarget.down(1), InvUtils.findInHotbar(Items.OBSIDIAN), rotate.get(), 0, true);
} else if (!supportMessage && blockPosTarget != target.getBlockPos()) {
warning("Unable to support %s... mining anyway.", target.getEntityName());
supportMessage = true;
}
}
if (autoSwitch.get())
InvUtils.swap(pickaxe.slot(), false);
if (mode.get() == Mode.Normal) {
if (rotate.get())
Rotations.rotate(Rotations.getYaw(blockPosTarget), Rotations.getPitch(blockPosTarget), () -> mine(blockPosTarget));
else
mine(blockPosTarget);
}
if (mode.get() == Mode.Instant) {
if (target == null || !target.isAlive() || count >= instaToggle.get()) {
toggle();
}
direction = BPlusEntityUtils.rayTraceCheck(blockPosTarget, true);
if (!mc.world.isAir(blockPosTarget)) {
instamine(blockPosTarget);
} else
++count;
}
}
use of meteordevelopment.orbit.EventHandler in project banana-for-everyone by Bennooo.
the class BurrowESP method onTick.
@EventHandler
private void onTick(TickEvent.Post event) {
PlayerEntity targetEntity = TargetUtils.getPlayerTarget(mc.interactionManager.getReachDistance() + 2, SortPriority.LowestDistance);
if (TargetUtils.isBadTarget(targetEntity, mc.interactionManager.getReachDistance() + 2)) {
target = null;
} else if (renderWebbed.get() && BPlusEntityUtils.isWebbed(targetEntity)) {
target = targetEntity.getBlockPos();
} else if (BPlusEntityUtils.isBurrowed(targetEntity, BPlusEntityUtils.BlastResistantType.Any)) {
target = targetEntity.getBlockPos();
} else
target = null;
isTargetWebbed = (target != null && BPlusEntityUtils.isWebbed(targetEntity));
isTargetBurrowed = (target != null && BPlusEntityUtils.isBurrowed(targetEntity, BPlusEntityUtils.BlastResistantType.Any));
}
use of meteordevelopment.orbit.EventHandler in project banana-for-everyone by Bennooo.
the class Monkhand method onTick.
@EventHandler
private void onTick(TickEvent.Pre event) {
net.minecraft.item.Item mainHand = mc.player.getMainHandStack().getItem();
Modules modules = Modules.get();
AutoTotem autoTotem = modules.get(AutoTotem.class);
MonkeTotem monkeTotem = modules.get(MonkeTotem.class);
// Gap
if (mainHand instanceof SwordItem && swordGap.get() && allowGap())
currentItem = Item.EGap;
else if (mainHand instanceof AxeItem && axeGap.get() && allowGap())
currentItem = Item.EGap;
else // Ca, mining, cev
if ((modules.isActive(CrystalAura.class) && crystalCa.get() || modules.isActive(BananaBomber.class) && crystalCa.get()) || mc.interactionManager.isBreakingBlock() && crystalMine.get() || modules.isActive(CevBreaker.class) && crystalCev.get())
currentItem = Item.Crystal;
else // Xp
if (modules.isActive(AutoXP.class) && modules.get(AutoXP.class).isOnStandby && modules.get(AutoXP.class).isRepairing && AutoXP.get())
currentItem = Item.Exp;
else // Rocket
if ((mc.player.getMainHandStack().getItem() instanceof CrossbowItem) && RocketBow.get())
currentItem = Item.Firework;
else
currentItem = item.get();
// Checking offhand item
if (mc.player.getOffHandStack().getItem() != currentItem.item) {
FindItemResult item = InvUtils.find(itemStack -> itemStack.getItem() == currentItem.item, hotbar.get() ? 0 : 9, 35);
// No offhand item
if (!item.found())
item = InvUtils.find(itemStack -> itemStack.getItem() == fallbackItem.get().item, hotbar.get() ? 0 : 9, 35);
if (currentItem == Item.EGap && allowCrapples.get()) {
if (!item.found())
item = InvUtils.find(itemStack -> itemStack.getItem() == Items.GOLDEN_APPLE, hotbar.get() ? 0 : 9, 35);
}
if (!item.found()) {
if (!sentMessage) {
warning("Chosen item not found.");
sentMessage = true;
}
} else // Swap to offhand
if ((isClicking || !rightClick.get()) && (!autoTotem.isLocked() && !monkeTotem.isLocked()) && !item.isOffhand()) {
InvUtils.move().from(item.slot()).toOffhand();
sentMessage = false;
}
} else // If not clicking, set to totem if auto totem is on
if (!isClicking && rightClick.get()) {
if (autoTotem.isActive() || monkeTotem.isActive()) {
FindItemResult totem = InvUtils.find(itemStack -> itemStack.getItem() == Items.TOTEM_OF_UNDYING, hotbar.get() ? 0 : 9, 35);
if (totem.found() && !totem.isOffhand()) {
InvUtils.move().from(totem.slot()).toOffhand();
}
} else {
FindItemResult empty = InvUtils.find(ItemStack::isEmpty, hotbar.get() ? 0 : 9, 35);
if (empty.found())
InvUtils.move().fromOffhand().to(empty.slot());
}
}
}
Aggregations