init
This commit is contained in:
commit
956a6e515f
376 files changed
+144945
No files matched your search
@@ -0,0 +1,58 @@
|
||||
package shit.zen.manager;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import shit.zen.ZenClient;
|
||||
import shit.zen.command.Command;
|
||||
import shit.zen.command.impl.BindCommand;
|
||||
import shit.zen.command.impl.ConfigCommand;
|
||||
import shit.zen.command.impl.LanguageCommand;
|
||||
import shit.zen.command.impl.ToggleCommand;
|
||||
import shit.zen.event.impl.ChatEvent;
|
||||
import shit.zen.utils.misc.ChatUtil;
|
||||
import shit.zen.event.EventTarget;
|
||||
|
||||
public class CommandManager {
|
||||
public static final String PREFIX = ".";
|
||||
public final Map<String, Command> aliasMap = new HashMap<>();
|
||||
|
||||
public CommandManager() {
|
||||
ZenClient.getInstance().getEventBus().register(this);
|
||||
}
|
||||
|
||||
public void initCommands() {
|
||||
this.registerCommand(new BindCommand());
|
||||
this.registerCommand(new ConfigCommand());
|
||||
this.registerCommand(new LanguageCommand());
|
||||
this.registerCommand(new ToggleCommand());
|
||||
}
|
||||
|
||||
private void registerCommand(Command command) {
|
||||
this.aliasMap.put(command.getPrefix().toLowerCase(), command);
|
||||
for (String string : command.getAliases()) {
|
||||
this.aliasMap.put(string.toLowerCase(), command);
|
||||
}
|
||||
}
|
||||
|
||||
@EventTarget
|
||||
public void onChat(ChatEvent chatEvent) {
|
||||
if (chatEvent.getMessage().startsWith(PREFIX)) {
|
||||
chatEvent.setCancelled(true);
|
||||
String string = chatEvent.getMessage().substring(PREFIX.length());
|
||||
String[] stringArray = string.split(" ");
|
||||
if (stringArray.length < 1) {
|
||||
ChatUtil.print("Unknown command");
|
||||
return;
|
||||
}
|
||||
String alias = stringArray[0].toLowerCase();
|
||||
Command command = this.aliasMap.get(alias);
|
||||
if (command == null) {
|
||||
ChatUtil.print("Unknown command");
|
||||
return;
|
||||
}
|
||||
String[] args = new String[stringArray.length - 1];
|
||||
System.arraycopy(stringArray, 1, args, 0, args.length);
|
||||
command.onCommand(args);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package shit.zen.manager;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import shit.zen.ZenClient;
|
||||
import shit.zen.config.Config;
|
||||
import shit.zen.config.ModulesConfig;
|
||||
import shit.zen.config.ValuesConfig;
|
||||
|
||||
public class ConfigManager {
|
||||
public static final Logger LOGGER = LogManager.getLogger("ConfigManager");
|
||||
public static final File CONFIG_DIR = new File(ZenClient.configDir, "configs");
|
||||
private final List<Config> configs;
|
||||
|
||||
public ConfigManager() {
|
||||
this.configs = new ArrayList<>();
|
||||
if (!CONFIG_DIR.exists() && CONFIG_DIR.mkdir()) {
|
||||
LOGGER.info("Created config directory");
|
||||
}
|
||||
this.configs.add(new ModulesConfig());
|
||||
this.configs.add(new ValuesConfig());
|
||||
}
|
||||
|
||||
public void loadAll() {
|
||||
for (Config config : this.configs) {
|
||||
try {
|
||||
File file = config.getFile();
|
||||
if (file.exists()) {
|
||||
readConfigFile(config, file);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
LOGGER.error("Failed to load config " + config.getName(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void readConfigFile(Config config, File file) throws IOException {
|
||||
try (BufferedReader reader = new BufferedReader(
|
||||
new InputStreamReader(Files.newInputStream(file.toPath()), StandardCharsets.UTF_8))) {
|
||||
config.read(reader);
|
||||
}
|
||||
}
|
||||
|
||||
public void saveAll() {
|
||||
for (Config config : this.configs) {
|
||||
this.saveConfig(config);
|
||||
}
|
||||
LOGGER.info("Saved all configs");
|
||||
}
|
||||
|
||||
private void saveConfig(Config config) {
|
||||
try (BufferedWriter writer = new BufferedWriter(
|
||||
new OutputStreamWriter(Files.newOutputStream(config.getFile().toPath()), StandardCharsets.UTF_8))) {
|
||||
config.save(writer);
|
||||
} catch (IOException e) {
|
||||
LOGGER.error("Failed to save config " + config.getName(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package shit.zen.manager;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import shit.zen.ClientBase;
|
||||
import shit.zen.ZenClient;
|
||||
import shit.zen.event.impl.GlRenderEvent;
|
||||
import shit.zen.event.impl.Render2DEvent;
|
||||
import shit.zen.event.impl.TickEvent;
|
||||
import shit.zen.gui.IntroAnimation;
|
||||
import shit.zen.hud.HudElement;
|
||||
import shit.zen.hud.KeyBindsHud;
|
||||
import shit.zen.hud.LieDetector;
|
||||
import shit.zen.hud.ModuleListHud;
|
||||
import shit.zen.hud.PlayerListHud;
|
||||
import shit.zen.hud.PotionEffectsHud;
|
||||
import shit.zen.hud.TargetHud;
|
||||
import shit.zen.event.EventTarget;
|
||||
|
||||
public class HudManager {
|
||||
private final Map<String, HudElement> hudElements = new HashMap<>();
|
||||
|
||||
public HudManager() {
|
||||
this.init();
|
||||
}
|
||||
|
||||
public void init() {
|
||||
this.registerHudElement(new TargetHud());
|
||||
this.registerHudElement(new KeyBindsHud());
|
||||
this.registerHudElement(new ModuleListHud());
|
||||
this.registerHudElement(new PlayerListHud());
|
||||
this.registerHudElement(new PotionEffectsHud());
|
||||
this.registerHudElement(new LieDetector());
|
||||
}
|
||||
|
||||
private void registerHudElement(HudElement hudElement) {
|
||||
ZenClient.getInstance().getModuleManager().register(hudElement);
|
||||
this.hudElements.put(hudElement.getClass().getSimpleName(), hudElement);
|
||||
}
|
||||
|
||||
public <T extends HudElement> T getHudElement(Class<T> clazz) {
|
||||
return clazz.cast(this.hudElements.get(clazz.getSimpleName()));
|
||||
}
|
||||
|
||||
public HudElement getHudElementByName(String string) {
|
||||
return this.hudElements.values().stream().filter(hudElement -> hudElement.getName().equalsIgnoreCase(string)).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
public Collection<HudElement> getHudElements() {
|
||||
return this.hudElements.values();
|
||||
}
|
||||
|
||||
@EventTarget
|
||||
public void onTick(TickEvent tickEvent) {
|
||||
if (ClientBase.mc.screen == null) {
|
||||
try {
|
||||
for (HudElement hudElement : ZenClient.getInstance().getHudManager().getHudElements()) {
|
||||
hudElement.stopDragging();
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
ClientBase.logger.error(exception);
|
||||
ClientBase.logger.error(exception.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventTarget
|
||||
public void onRender2D(Render2DEvent render2DEvent) {
|
||||
if (IntroAnimation.isRunning()) {
|
||||
return;
|
||||
}
|
||||
for (HudElement hudElement : this.getHudElements()) {
|
||||
if (!hudElement.isEnabled()) continue;
|
||||
hudElement.onRender2D(render2DEvent, hudElement.getX(), hudElement.getY());
|
||||
}
|
||||
}
|
||||
|
||||
@EventTarget
|
||||
public void onGlRender(GlRenderEvent glRenderEvent) {
|
||||
if (IntroAnimation.isRunning()) {
|
||||
return;
|
||||
}
|
||||
for (HudElement hudElement : this.getHudElements()) {
|
||||
if (!hudElement.isEnabled()) continue;
|
||||
hudElement.onGlRender(glRenderEvent, hudElement.getX(), hudElement.getY());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package shit.zen.manager;
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Queue;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import net.minecraft.network.protocol.Packet;
|
||||
import net.minecraft.network.protocol.game.ServerboundKeepAlivePacket;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import shit.zen.ClientBase;
|
||||
import shit.zen.event.impl.PacketEvent;
|
||||
import shit.zen.event.impl.TickEvent;
|
||||
import shit.zen.event.EventTarget;
|
||||
|
||||
public class LagManager {
|
||||
public static LagManager INSTANCE;
|
||||
@Getter @Setter
|
||||
private long lagTime = 500L;
|
||||
@Getter
|
||||
private boolean blinking;
|
||||
private int blinkCount = 0;
|
||||
private final Queue<Pair<Packet<?>, Long>> packetQueue = new ArrayDeque<>();
|
||||
|
||||
public LagManager() {
|
||||
INSTANCE = this;
|
||||
}
|
||||
|
||||
public void setBlink(boolean bl) {
|
||||
if (bl) {
|
||||
++this.blinkCount;
|
||||
} else if (this.blinkCount > 0) {
|
||||
--this.blinkCount;
|
||||
}
|
||||
boolean bl2 = this.blinkCount > 0;
|
||||
if (this.blinking == bl2) {
|
||||
return;
|
||||
}
|
||||
this.blinking = bl2;
|
||||
if (this.blinking) {
|
||||
this.packetQueue.clear();
|
||||
} else {
|
||||
this.flushQueue();
|
||||
}
|
||||
}
|
||||
|
||||
private void flushQueue() {
|
||||
if (ClientBase.mc.getConnection() == null) {
|
||||
this.packetQueue.clear();
|
||||
return;
|
||||
}
|
||||
while (!this.packetQueue.isEmpty()) {
|
||||
ClientBase.mc.getConnection().send(this.packetQueue.poll().getLeft());
|
||||
}
|
||||
}
|
||||
|
||||
@EventTarget
|
||||
public void onPacket(PacketEvent packetEvent) {
|
||||
if (!this.blinking || ClientBase.mc.getConnection() == null || !packetEvent.isIncomingRaw()) {
|
||||
return;
|
||||
}
|
||||
if (packetEvent.getPacket() instanceof ServerboundKeepAlivePacket) {
|
||||
this.packetQueue.add(Pair.of(packetEvent.getPacket(), System.currentTimeMillis()));
|
||||
packetEvent.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventTarget
|
||||
public void onTick(TickEvent tickEvent) {
|
||||
if (!this.blinking || ClientBase.mc.getConnection() == null) {
|
||||
return;
|
||||
}
|
||||
long l = System.currentTimeMillis();
|
||||
while (!this.packetQueue.isEmpty() && l - this.packetQueue.peek().getRight() >= this.lagTime) {
|
||||
ClientBase.mc.getConnection().send(this.packetQueue.poll().getLeft());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,200 @@
|
||||
package shit.zen.manager;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.stream.Collectors;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import shit.zen.ClientBase;
|
||||
import shit.zen.ZenClient;
|
||||
import shit.zen.event.impl.KeyEvent;
|
||||
import shit.zen.exception.ModuleNotFoundException;
|
||||
import shit.zen.modules.Category;
|
||||
import shit.zen.modules.Module;
|
||||
import shit.zen.modules.impl.combat.AntiBots;
|
||||
import shit.zen.modules.impl.combat.AntiFireball;
|
||||
import shit.zen.modules.impl.combat.AntiKB;
|
||||
import shit.zen.modules.impl.combat.AutoOffHand;
|
||||
import shit.zen.modules.impl.combat.AutoSoup;
|
||||
import shit.zen.modules.impl.combat.AutoThrow;
|
||||
import shit.zen.modules.impl.combat.Backtrack;
|
||||
import shit.zen.modules.impl.combat.Critical;
|
||||
import shit.zen.modules.impl.combat.CrystalAura;
|
||||
import shit.zen.modules.impl.combat.KillAura;
|
||||
import shit.zen.modules.impl.exploit.Disabler;
|
||||
import shit.zen.modules.impl.exploit.FastPlace;
|
||||
import shit.zen.modules.impl.misc.AimAssist;
|
||||
import shit.zen.modules.impl.misc.AutoClicker;
|
||||
import shit.zen.modules.impl.misc.AutoRod;
|
||||
import shit.zen.modules.impl.misc.SafeWalk;
|
||||
import shit.zen.modules.impl.movement.CollisionSpeed;
|
||||
import shit.zen.modules.impl.movement.FastUse;
|
||||
import shit.zen.modules.impl.movement.FastWeb;
|
||||
import shit.zen.modules.impl.movement.FireballBlink;
|
||||
import shit.zen.modules.impl.movement.Fly;
|
||||
import shit.zen.modules.impl.movement.GuiMove;
|
||||
import shit.zen.modules.impl.movement.HighJump;
|
||||
import shit.zen.modules.impl.movement.NoDelay;
|
||||
import shit.zen.modules.impl.movement.NoPush;
|
||||
import shit.zen.modules.impl.movement.Scaffold;
|
||||
import shit.zen.modules.impl.movement.Sprint;
|
||||
import shit.zen.modules.impl.movement.TargetStrafe;
|
||||
import shit.zen.modules.impl.player.AntiTNT;
|
||||
import shit.zen.modules.impl.player.AntiVoid;
|
||||
import shit.zen.modules.impl.player.AntiWeb;
|
||||
import shit.zen.modules.impl.player.AutoMLG;
|
||||
import shit.zen.modules.impl.player.AutoWebPlace;
|
||||
import shit.zen.modules.impl.player.ChestStealer;
|
||||
import shit.zen.modules.impl.player.GhostHand;
|
||||
import shit.zen.modules.impl.player.Helper;
|
||||
import shit.zen.modules.impl.player.InventoryManager;
|
||||
import shit.zen.modules.impl.player.MidPearl;
|
||||
import shit.zen.modules.impl.player.NoFall;
|
||||
import shit.zen.modules.impl.player.Stuck;
|
||||
import shit.zen.modules.impl.render.AspectRatio;
|
||||
import shit.zen.modules.impl.render.ChestESP;
|
||||
import shit.zen.modules.impl.render.ClickGuiModule;
|
||||
import shit.zen.modules.impl.render.Compass;
|
||||
import shit.zen.modules.impl.render.DamageGlow;
|
||||
import shit.zen.modules.impl.render.ESP;
|
||||
import shit.zen.modules.impl.render.FullBright;
|
||||
import shit.zen.modules.impl.render.Interface;
|
||||
import shit.zen.modules.impl.render.ItemTags;
|
||||
import shit.zen.modules.impl.render.NameProtect;
|
||||
import shit.zen.modules.impl.render.NameTags;
|
||||
import shit.zen.modules.impl.render.NoHurtCam;
|
||||
import shit.zen.modules.impl.render.OldHitting;
|
||||
import shit.zen.modules.impl.render.Projectiles;
|
||||
import shit.zen.modules.impl.render.Watermark;
|
||||
import shit.zen.modules.impl.render.XRay;
|
||||
import shit.zen.modules.impl.world.AntiStaff;
|
||||
import shit.zen.modules.impl.world.AutoPlay;
|
||||
import shit.zen.modules.impl.world.AutoTools;
|
||||
import shit.zen.modules.impl.world.Debugger;
|
||||
import shit.zen.modules.impl.world.Teams;
|
||||
import shit.zen.modules.impl.world.WebUI;
|
||||
import shit.zen.event.EventTarget;
|
||||
|
||||
public class ModuleManager extends ClientBase {
|
||||
private final Map<String, Module> moduleMap = new ConcurrentHashMap<>();
|
||||
|
||||
public ModuleManager() {
|
||||
ZenClient.getInstance().getEventBus().register(this);
|
||||
}
|
||||
|
||||
public void initModules() {
|
||||
this.register(new AntiBots());
|
||||
this.register(new AntiFireball());
|
||||
this.register(new AntiKB());
|
||||
this.register(new AutoOffHand());
|
||||
this.register(new AutoSoup());
|
||||
this.register(new AutoThrow());
|
||||
this.register(new Backtrack());
|
||||
this.register(new Critical());
|
||||
this.register(new CrystalAura());
|
||||
this.register(new KillAura());
|
||||
|
||||
this.register(new Disabler());
|
||||
this.register(new FastPlace());
|
||||
|
||||
this.register(new AimAssist());
|
||||
this.register(new AutoClicker());
|
||||
this.register(new AutoRod());
|
||||
this.register(new SafeWalk());
|
||||
|
||||
this.register(new CollisionSpeed());
|
||||
this.register(new FastUse());
|
||||
this.register(new FastWeb());
|
||||
this.register(new FireballBlink());
|
||||
this.register(new Fly());
|
||||
this.register(new GuiMove());
|
||||
this.register(new HighJump());
|
||||
this.register(new NoDelay());
|
||||
this.register(new NoPush());
|
||||
this.register(new Scaffold());
|
||||
this.register(new Sprint());
|
||||
this.register(new TargetStrafe());
|
||||
|
||||
this.register(new AntiTNT());
|
||||
this.register(new AntiVoid());
|
||||
this.register(new AntiWeb());
|
||||
this.register(new AutoMLG());
|
||||
this.register(new AutoWebPlace());
|
||||
this.register(new ChestStealer());
|
||||
this.register(new GhostHand());
|
||||
this.register(new Helper());
|
||||
this.register(new InventoryManager());
|
||||
this.register(new MidPearl());
|
||||
this.register(new NoFall());
|
||||
this.register(new Stuck());
|
||||
|
||||
this.register(new AspectRatio());
|
||||
this.register(new ChestESP());
|
||||
this.register(new ClickGuiModule());
|
||||
this.register(new Compass());
|
||||
this.register(new DamageGlow());
|
||||
this.register(new ESP());
|
||||
this.register(new FullBright());
|
||||
this.register(new Interface());
|
||||
this.register(new ItemTags());
|
||||
this.register(new NameProtect());
|
||||
this.register(new NameTags());
|
||||
this.register(new NoHurtCam());
|
||||
this.register(new OldHitting());
|
||||
this.register(new Projectiles());
|
||||
this.register(new Watermark());
|
||||
this.register(new XRay());
|
||||
|
||||
this.register(new AntiStaff());
|
||||
this.register(new AutoPlay());
|
||||
this.register(new AutoTools());
|
||||
this.register(new Debugger());
|
||||
this.register(new Teams());
|
||||
this.register(new WebUI());
|
||||
}
|
||||
|
||||
public void register(Module module) {
|
||||
this.moduleMap.put(module.getClass().getSimpleName(), module);
|
||||
module.registerSettings();
|
||||
}
|
||||
|
||||
public Module getModule(String string) {
|
||||
Module module = null;
|
||||
for (Module module2 : this.moduleMap.values()) {
|
||||
if (!StringUtils.replace(module2.getName(), " ", "").equalsIgnoreCase(string)) continue;
|
||||
module = module2;
|
||||
}
|
||||
if (module == null) {
|
||||
throw new ModuleNotFoundException();
|
||||
}
|
||||
return module;
|
||||
}
|
||||
|
||||
public <T extends Module> T getModule(Class<T> clazz) {
|
||||
Module module = clazz.cast(this.moduleMap.get(clazz.getSimpleName()));
|
||||
if (module == null) {
|
||||
throw new ModuleNotFoundException();
|
||||
}
|
||||
return (T) module;
|
||||
}
|
||||
|
||||
public List<Module> getModules() {
|
||||
return this.moduleMap.values().stream().toList();
|
||||
}
|
||||
|
||||
public List<Module> getModulesByCategory(Category category) {
|
||||
return this.moduleMap.values().stream()
|
||||
.filter(module -> module.getCategory().equals(category))
|
||||
.sorted((a, b) -> a.getName().compareTo(b.getName()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@EventTarget
|
||||
public void onKey(KeyEvent event) {
|
||||
for (Module module : this.moduleMap.values()) {
|
||||
if (module.getKey() != 0 && module.getKey() == event.getKeyCode() && event.isPressed()) {
|
||||
module.toggle();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package shit.zen.manager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
import lombok.Generated;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import shit.zen.ClientBase;
|
||||
import shit.zen.ZenClient;
|
||||
import shit.zen.event.impl.GameTickEvent;
|
||||
import shit.zen.modules.impl.combat.KillAura;
|
||||
import shit.zen.utils.game.RotationUtil;
|
||||
import shit.zen.event.EventTarget;
|
||||
|
||||
public class TargetManager
|
||||
extends ClientBase {
|
||||
public static TargetManager INSTANCE;
|
||||
private final List<LivingEntity> targets = new ArrayList<>();
|
||||
|
||||
public TargetManager() {
|
||||
INSTANCE = this;
|
||||
}
|
||||
|
||||
@EventTarget
|
||||
public void onGameTick(GameTickEvent gameTickEvent) {
|
||||
if (mc.level == null) {
|
||||
return;
|
||||
}
|
||||
if (KillAura.INSTANCE == null) {
|
||||
return;
|
||||
}
|
||||
if (!ZenClient.isReady()) {
|
||||
return;
|
||||
}
|
||||
this.targets.clear();
|
||||
for (Entity entity : mc.level.entitiesForRendering()) {
|
||||
if (!(entity instanceof LivingEntity livingEntity)) continue;
|
||||
if (!KillAura.INSTANCE.isValidTarget(entity)) continue;
|
||||
this.targets.add(livingEntity);
|
||||
}
|
||||
}
|
||||
|
||||
public Stream<LivingEntity> getTargetsStream(float f) {
|
||||
if (mc.player == null) {
|
||||
return Stream.empty();
|
||||
}
|
||||
return new ArrayList<>(this.targets).stream().filter(livingEntity -> {
|
||||
Vec3 vec3 = RotationUtil.closestPoint(mc.player.getEyePosition(), livingEntity.getBoundingBox());
|
||||
return vec3.distanceTo(mc.player.getEyePosition()) <= (double)f;
|
||||
});
|
||||
}
|
||||
|
||||
public List<LivingEntity> getTargets(float f) {
|
||||
return this.getTargetsStream(f).toList();
|
||||
}
|
||||
|
||||
@Generated
|
||||
public List<LivingEntity> getTargetList() {
|
||||
return this.targets;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user