use of me.earth.earthhack.impl.modules.combat.offhand.modes.OffhandMode 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.modes.OffhandMode 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());
});
}
}
}
Aggregations