use of me.earth.earthhack.impl.modules.combat.offhand.Offhand in project 3arthh4ck by 3arthqu4ke.
the class ListenerMotion method doObby.
private void doObby(MotionUpdateEvent event, Vec3i[] offsets) {
if (event.getStage() == Stage.PRE) {
// TODO: this looks very similar to AutoTrap,
// maybe its possible to abstract this even further?
module.rotations = null;
module.blocksPlaced = 0;
for (BlockPos confirmed : module.confirmed) {
module.placed.remove(confirmed);
}
module.placed.entrySet().removeIf(entry -> System.currentTimeMillis() - entry.getValue() >= module.confirm.getValue());
BlockPos playerPos = PositionUtil.getPosition();
BlockPos[] positions = new BlockPos[offsets.length];
for (int i = 0; i < offsets.length; i++) {
Vec3i offset = offsets[i];
if (module.mode.getValue() == AntiTrapMode.Fill) {
if (mc.world.getBlockState(playerPos.add(offset.getX() / 2, 0, offset.getZ() / 2)).getBlock() == Blocks.BEDROCK) {
continue;
}
}
positions[i] = playerPos.add(offset);
}
if (module.offhand.getValue()) {
if (!InventoryUtil.isHolding(Blocks.OBSIDIAN)) {
module.previous = OFFHAND.returnIfPresent(Offhand::getMode, null);
OFFHAND.computeIfPresent(o -> o.setMode(OffhandMode.CRYSTAL));
return;
}
} else {
module.slot = InventoryUtil.findHotbarBlock(Blocks.OBSIDIAN);
if (module.slot == -1) {
ModuleUtil.disable(module, TextColor.RED + "No Obsidian found.");
return;
}
}
boolean done = true;
List<BlockPos> toPlace = new LinkedList<>();
for (BlockPos pos : positions) {
if (pos == null) {
continue;
}
if (module.mode.getValue() == AntiTrapMode.Fill && !module.highFill.getValue() && pos.getY() > playerPos.getY()) {
continue;
}
if (mc.world.getBlockState(pos).getMaterial().isReplaceable()) {
toPlace.add(pos);
done = false;
}
}
if (done) {
module.disable();
return;
}
boolean hasPlaced = false;
Optional<BlockPos> crystalPos = toPlace.stream().filter(pos -> !mc.world.getEntitiesWithinAABB(EntityEnderCrystal.class, new AxisAlignedBB(pos)).isEmpty() && mc.world.getBlockState(pos).getMaterial().isReplaceable()).findFirst();
if (crystalPos.isPresent()) {
BlockPos pos = crystalPos.get();
hasPlaced = module.placeBlock(pos);
}
// Only after here we need to use the Helper to get the BlockStates.
if (!hasPlaced) {
for (BlockPos pos : toPlace) {
if (!module.placed.containsKey(pos) && HELPER.getBlockState(pos).getMaterial().isReplaceable()) {
module.confirmed.remove(pos);
if (module.placeBlock(pos)) {
break;
}
}
}
}
if (module.rotate.getValue() != Rotate.None) {
if (module.rotations != null) {
event.setYaw(module.rotations[0]);
event.setPitch(module.rotations[1]);
}
} else {
Locks.acquire(Locks.PLACE_SWITCH_LOCK, module::execute);
}
} else {
Locks.acquire(Locks.PLACE_SWITCH_LOCK, module::execute);
}
}
use of me.earth.earthhack.impl.modules.combat.offhand.Offhand in project 3arthh4ck by 3arthqu4ke.
the class ListenerKeyboard method invoke.
@Override
public void invoke(KeyboardEvent event) {
if (event.getEventState() && event.getKey() == module.switchBind.getValue().getKey()) {
if (module.useAsOffhand.getValue() || module.isPingBypass()) {
OffhandMode m = OFFHAND.returnIfPresent(Offhand::getMode, null);
if (m != null) {
if (m.equals(OffhandMode.CRYSTAL)) {
OFFHAND.computeIfPresent(o -> o.setMode(OffhandMode.TOTEM));
} else {
OFFHAND.computeIfPresent(o -> o.setMode(OffhandMode.CRYSTAL));
}
}
module.switching = false;
} else if (module.autoSwitch.getValue() == AutoSwitch.Bind) {
module.switching = !module.switching;
}
}
}
use of me.earth.earthhack.impl.modules.combat.offhand.Offhand in project 3arthh4ck by 3arthqu4ke.
the class ModuleManager method init.
public void init() {
Earthhack.getLogger().info("Initializing Modules.");
this.forceRegister(new AutoConfig());
this.forceRegister(new ClickGui());
this.forceRegister(new Colors());
this.forceRegister(new Commands());
this.forceRegister(new Debug());
this.forceRegister(new FontMod());
this.forceRegister(new HUD());
this.forceRegister(new Management());
this.forceRegister(new Notifications());
this.forceRegister(new Compatibility());
this.forceRegister(new Safety());
this.forceRegister(new ServerModule());
this.forceRegister(new TabModule());
this.forceRegister(new Media());
this.forceRegister(new HudEditor());
this.forceRegister(new AntiSurround());
this.forceRegister(new AntiTrap());
this.forceRegister(new Auto32k());
this.forceRegister(new AnvilAura());
this.forceRegister(new AutoArmor());
this.forceRegister(new AutoCrystal());
this.forceRegister(new AutoTrap());
this.forceRegister(new BedBomb());
this.forceRegister(new BowSpam());
this.forceRegister(new BowKiller());
this.forceRegister(new Criticals());
this.forceRegister(new CrystalBomber());
this.forceRegister(new HoleFiller());
this.forceRegister(new KillAura());
this.forceRegister(new LegSwitch());
this.forceRegister(new Offhand());
this.forceRegister(new PistonAura());
this.forceRegister(new Surround());
this.forceRegister(new Snowballer());
this.forceRegister(new SelfTrap());
this.forceRegister(new WebAura());
this.forceRegister(new Announcer());
this.forceRegister(new AntiAim());
this.forceRegister(new AntiPackets());
this.forceRegister(new AntiPotion());
this.forceRegister(new AntiVanish());
this.forceRegister(new AutoEat());
this.forceRegister(new AutoFish());
this.forceRegister(new AutoLog());
this.forceRegister(new AutoReconnect());
this.forceRegister(new AutoRespawn());
this.forceRegister(new BuildHeight());
this.forceRegister(new Chat());
this.forceRegister(new ExtraTab());
this.forceRegister(new Logger());
this.forceRegister(new MCF());
this.forceRegister(new MobOwner());
this.forceRegister(new NoAFK());
this.forceRegister(new NoHandShake());
this.forceRegister(new NoInteract());
this.forceRegister(new NoInterp());
this.forceRegister(new NoSoundLag());
this.forceRegister(new Nuker());
this.forceRegister(new Packets());
this.forceRegister(new PingSpoof());
this.forceRegister(new Portals());
this.forceRegister(new SettingSpoof());
this.forceRegister(new SkinBlink());
this.forceRegister(new Spammer());
this.forceRegister(new ToolTips());
this.forceRegister(new TpsSync());
this.forceRegister(new Tracker());
this.forceRegister(new TrueDurability());
this.forceRegister(new AutoCraft());
this.forceRegister(new AutoRegear());
this.forceRegister(new PacketDelay());
this.forceRegister(new RPC());
this.forceRegister(new Anchor());
this.forceRegister(new AutoSprint());
this.forceRegister(new BlockLag());
this.forceRegister(new BoatFly());
this.forceRegister(new ElytraFlight());
this.forceRegister(new EntityControl());
this.forceRegister(new EntitySpeed());
this.forceRegister(new FastSwim());
this.forceRegister(new Flight());
this.forceRegister(new HighJump());
this.forceRegister(new ReverseStep());
this.forceRegister(new IceSpeed());
this.forceRegister(new Jesus());
this.forceRegister(new LongJump());
this.forceRegister(new NoFall());
this.forceRegister(new NoMove());
this.forceRegister(new NoSlowDown());
this.forceRegister(new PacketFly());
this.forceRegister(new Phase());
this.forceRegister(new SafeWalk());
this.forceRegister(new Speed());
this.forceRegister(new Step());
this.forceRegister(new Velocity());
this.forceRegister(new AutoMine());
this.forceRegister(new AutoTool());
this.forceRegister(new Blink());
this.forceRegister(new BlockTweaks());
this.forceRegister(new Cleaner());
this.forceRegister(new ExpTweaks());
this.forceRegister(new FakePlayer());
this.forceRegister(new FastPlace());
this.forceRegister(new FastEat());
this.forceRegister(new Freecam());
this.forceRegister(new LiquidInteract());
this.forceRegister(new MiddleClickPearl());
this.forceRegister(new MultiTask());
this.forceRegister(new NCPTweaks());
this.forceRegister(new NoGlitchBlocks());
this.forceRegister(new NoHunger());
this.forceRegister(new InventorySync());
this.forceRegister(new NoRotate());
this.forceRegister(new Arrows());
this.forceRegister(new RayTrace());
this.forceRegister(new Reach());
this.forceRegister(new Replenish());
this.forceRegister(new Scaffold());
this.forceRegister(new Sorter());
this.forceRegister(new Spectate());
this.forceRegister(new Speedmine());
this.forceRegister(new Suicide());
this.forceRegister(new Timer());
this.forceRegister(new XCarry());
this.forceRegister(new BlockHighlight());
this.forceRegister(new BreadCrumbs());
this.forceRegister(new Chams());
this.forceRegister(new ESP());
this.forceRegister(new Fullbright());
this.forceRegister(new HoleESP());
this.forceRegister(new LagOMeter());
this.forceRegister(new LogoutSpots());
this.forceRegister(new VoidESP());
this.forceRegister(new Nametags());
this.forceRegister(new NewChunks());
this.forceRegister(new NoRender());
this.forceRegister(new Search());
this.forceRegister(new Skeleton());
this.forceRegister(new Sounds());
this.forceRegister(new Tracers());
this.forceRegister(new CameraClip());
this.forceRegister(new ViewModel());
this.forceRegister(new XRay());
this.forceRegister(new CrystalScale());
this.forceRegister(new Trails());
this.forceRegister(new Trajectories());
this.forceRegister(new Penis());
this.forceRegister(new WayPoints());
this.forceRegister(new Weather());
this.forceRegister(new HandChams());
this.forceRegister(new CrystalChams());
this.forceRegister(new RainbowEnchant());
this.forceRegister(new Crosshair());
this.forceRegister(new PopChams());
this.forceRegister(new ItemChams());
this.forceRegister(new Ambience());
this.forceRegister(new PingBypass());
Bus.EVENT_BUS.post(new PostInitEvent());
}
use of me.earth.earthhack.impl.modules.combat.offhand.Offhand in project 3arthh4ck by 3arthqu4ke.
the class ListenerSetSlot method invoke.
@Override
public void invoke(PacketEvent.Receive<SPacketSetSlot> event) {
if (module.getParent().isEnabled() && mc.player != null) {
SPacketSetSlot packet = event.getPacket();
if (packet.getSlot() == -1337) {
((IContainer) mc.player.openContainer).setTransactionID((short) packet.getWindowId());
// make NetHandlerPlayClient set mouse slot.
((ISPacketSetSlot) packet).setWindowId(-1);
} else if (packet.getWindowId() == -128) {
event.setCancelled(true);
mc.addScheduledTask(() -> {
OffhandMode recovery = OFFHAND.returnIfPresent(Offhand::getMode, null);
OFFHAND.computeIfPresent(offhand -> {
offhand.setMode(OffhandMode.TOTEM);
offhand.postWindowClick();
});
OFFHAND.computeIfPresent(offhand -> offhand.setRecovery(recovery));
Slot slot = mc.player.inventoryContainer.inventorySlots.get(packet.getSlot());
slot.putStack(packet.getStack());
});
}
}
}
use of me.earth.earthhack.impl.modules.combat.offhand.Offhand in project 3arthh4ck by 3arthqu4ke.
the class ListenerMotion method doCrystal.
private void doCrystal(MotionUpdateEvent event) {
if (event.getStage() == Stage.PRE) {
List<BlockPos> positions = module.getCrystalPositions();
if (positions.isEmpty() || !module.isEnabled()) {
if (!module.empty.getValue()) {
module.disable();
}
return;
}
if (module.offhand.getValue()) {
if (!InventoryUtil.isHolding(Items.END_CRYSTAL)) {
module.previous = OFFHAND.returnIfPresent(Offhand::getMode, null);
OFFHAND.computeIfPresent(o -> o.setMode(OffhandMode.CRYSTAL));
return;
}
} else {
module.slot = InventoryUtil.findHotbarItem(Items.END_CRYSTAL);
if (module.slot == -1) {
ModuleUtil.disable(module, TextColor.RED + "No crystals found.");
return;
}
}
EntityPlayer closest = EntityUtil.getClosestEnemy();
if (closest != null) {
positions.sort(Comparator.comparingDouble(pos -> BlockUtil.getDistanceSq(closest, pos)));
}
// get last, furthest away, pos.
module.pos = positions.get(positions.size() - 1);
module.rotations = RotationUtil.getRotationsToTopMiddle(module.pos.up());
module.result = RayTraceUtil.getRayTraceResult(module.rotations[0], module.rotations[1], 3.0f);
if (module.rotate.getValue() == Rotate.Normal) {
event.setYaw(module.rotations[0]);
event.setPitch(module.rotations[1]);
} else {
executeCrystal();
}
} else {
executeCrystal();
}
}
Aggregations