diff --git a/src/main/java/me/rigamortis/seppuku/impl/module/combat/AutoArmorModule.java b/src/main/java/me/rigamortis/seppuku/impl/module/combat/AutoArmorModule.java index ff814f6..5dded63 100644 --- a/src/main/java/me/rigamortis/seppuku/impl/module/combat/AutoArmorModule.java +++ b/src/main/java/me/rigamortis/seppuku/impl/module/combat/AutoArmorModule.java @@ -4,8 +4,7 @@ import me.rigamortis.seppuku.api.event.EventStageable; import me.rigamortis.seppuku.api.event.player.EventPlayerUpdate; import me.rigamortis.seppuku.api.module.Module; import me.rigamortis.seppuku.api.util.Timer; -import me.rigamortis.seppuku.api.value.old.BooleanValue; -import me.rigamortis.seppuku.api.value.old.NumberValue; +import me.rigamortis.seppuku.api.value.Value; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiInventory; import net.minecraft.enchantment.EnchantmentHelper; @@ -23,9 +22,8 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener; */ public final class AutoArmorModule extends Module { - public final NumberValue delay = new NumberValue("Delay", new String[]{"Del"}, 50.0f, Float.class, 0.0f, 1000.0f, 1.0f); - - public final BooleanValue curse = new BooleanValue("Curse", new String[]{"Curses"}, false); + public final Value delay = new Value("Delay", new String[]{"Del"}, "The amount of delay in milliseconds.", 50.0f, 0.0f, 1000.0f, 1.0f); + public final Value curse = new Value("Curse", new String[]{"Curses"}, "Prevents you from equipping armor with cursed enchantments.", false); private Timer timer = new Timer(); @@ -84,7 +82,7 @@ public final class AutoArmorModule extends Module { } private void clickSlot(int slot, int mouse, ClickType type) { - if (this.timer.passed(this.delay.getFloat())) { + if (this.timer.passed(this.delay.getValue())) { Minecraft.getMinecraft().playerController.windowClick(Minecraft.getMinecraft().player.inventoryContainer.windowId, slot, mouse, type, Minecraft.getMinecraft().player); this.timer.reset(); } @@ -103,7 +101,7 @@ public final class AutoArmorModule extends Module { if (armor.armorType == type) { final float currentDamage = (armor.damageReduceAmount + EnchantmentHelper.getEnchantmentLevel(Enchantments.PROTECTION, s)); - final boolean cursed = this.curse.getBoolean() ? (EnchantmentHelper.hasBindingCurse(s)) : false; + final boolean cursed = this.curse.getValue() ? (EnchantmentHelper.hasBindingCurse(s)) : false; if (currentDamage > damage && !cursed) { damage = currentDamage; diff --git a/src/main/java/me/rigamortis/seppuku/impl/module/combat/AutoDisconnectModule.java b/src/main/java/me/rigamortis/seppuku/impl/module/combat/AutoDisconnectModule.java index cd6b1d6..0b7a0a6 100644 --- a/src/main/java/me/rigamortis/seppuku/impl/module/combat/AutoDisconnectModule.java +++ b/src/main/java/me/rigamortis/seppuku/impl/module/combat/AutoDisconnectModule.java @@ -3,7 +3,7 @@ package me.rigamortis.seppuku.impl.module.combat; import me.rigamortis.seppuku.api.event.EventStageable; import me.rigamortis.seppuku.api.event.player.EventPlayerUpdate; import me.rigamortis.seppuku.api.module.Module; -import me.rigamortis.seppuku.api.value.old.NumberValue; +import me.rigamortis.seppuku.api.value.Value; import net.minecraft.client.Minecraft; import net.minecraft.network.play.client.CPacketHeldItemChange; import team.stiff.pomelo.impl.annotated.handler.annotation.Listener; @@ -14,16 +14,16 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener; */ public final class AutoDisconnectModule extends Module { - public final NumberValue health = new NumberValue("Health", new String[]{"Hp"}, 8.0f, Float.class, 0.0f, 20.0f, 0.5f); + public final Value health = new Value("Health", new String[]{"Hp"}, "The amount of health needed to disconnect.", 8.0f, 0.0f, 20.0f, 0.5f); public AutoDisconnectModule() { - super("AutoDisconnect", new String[] {"Disconnect"}, "Automatically disconnects when health is low enough", "NONE", -1, ModuleType.COMBAT); + super("AutoDisconnect", new String[]{"Disconnect"}, "Automatically disconnects when health is low enough", "NONE", -1, ModuleType.COMBAT); } @Listener public void onUpdate(EventPlayerUpdate event) { - if(event.getStage() == EventStageable.EventStage.PRE) { - if(Minecraft.getMinecraft().player.getHealth() <= this.health.getFloat()) { + if (event.getStage() == EventStageable.EventStage.PRE) { + if (Minecraft.getMinecraft().player.getHealth() <= this.health.getValue()) { Minecraft.getMinecraft().player.connection.sendPacket(new CPacketHeldItemChange(420)); this.toggle(); } diff --git a/src/main/java/me/rigamortis/seppuku/impl/module/combat/AutoTotemModule.java b/src/main/java/me/rigamortis/seppuku/impl/module/combat/AutoTotemModule.java index c2a9c7c..c95a235 100644 --- a/src/main/java/me/rigamortis/seppuku/impl/module/combat/AutoTotemModule.java +++ b/src/main/java/me/rigamortis/seppuku/impl/module/combat/AutoTotemModule.java @@ -3,7 +3,7 @@ package me.rigamortis.seppuku.impl.module.combat; import me.rigamortis.seppuku.api.event.EventStageable; import me.rigamortis.seppuku.api.event.player.EventPlayerUpdate; import me.rigamortis.seppuku.api.module.Module; -import me.rigamortis.seppuku.api.value.old.NumberValue; +import me.rigamortis.seppuku.api.value.Value; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiInventory; import net.minecraft.init.Items; @@ -18,7 +18,7 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener; */ public final class AutoTotemModule extends Module { - public final NumberValue health = new NumberValue("Health", new String[]{"Hp"}, 16.0f, Float.class, 0.0f, 20.0f, 0.5f); + public final Value health = new Value("Health", new String[]{"Hp"}, "The amount of health needed to acquire a totem.", 16.0f, 0.0f, 20.0f, 0.5f); public AutoTotemModule() { super("AutoTotem", new String[] {"Totem"}, "Automatically places a totem of undying in your offhand", "NONE", -1, ModuleType.COMBAT); @@ -35,7 +35,7 @@ public final class AutoTotemModule extends Module { final Minecraft mc = Minecraft.getMinecraft(); if(mc.currentScreen == null || mc.currentScreen instanceof GuiInventory) { - if(mc.player.getHealth() <= this.health.getFloat()) { + if(mc.player.getHealth() <= this.health.getValue()) { final ItemStack offHand = mc.player.getHeldItemOffhand(); if (offHand.getItem() == Items.TOTEM_OF_UNDYING) { diff --git a/src/main/java/me/rigamortis/seppuku/impl/module/combat/CriticalsModule.java b/src/main/java/me/rigamortis/seppuku/impl/module/combat/CriticalsModule.java index 9eccf58..bf72cc4 100644 --- a/src/main/java/me/rigamortis/seppuku/impl/module/combat/CriticalsModule.java +++ b/src/main/java/me/rigamortis/seppuku/impl/module/combat/CriticalsModule.java @@ -3,7 +3,7 @@ package me.rigamortis.seppuku.impl.module.combat; import me.rigamortis.seppuku.api.event.EventStageable; import me.rigamortis.seppuku.api.event.network.EventSendPacket; import me.rigamortis.seppuku.api.module.Module; -import me.rigamortis.seppuku.api.value.old.OptionalValue; +import me.rigamortis.seppuku.api.value.Value; import net.minecraft.client.Minecraft; import net.minecraft.entity.EntityLivingBase; import net.minecraft.network.play.client.CPacketPlayer; @@ -16,31 +16,31 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener; */ public final class CriticalsModule extends Module { - public final OptionalValue mode = new OptionalValue("Mode", new String[]{"Mode", "M"}, 0, new String[]{"Jump", "Packet"}); + public final Value mode = new Value("Mode", new String[]{"Mode", "M"}, "The criticals mode to use.", Mode.PACKET); public CriticalsModule() { - super("Criticals", new String[] {"Crits"}, "Attempts to preform a critical while hitting entities", "NONE", -1, ModuleType.COMBAT); + super("Criticals", new String[]{"Crits"}, "Attempts to preform a critical while hitting entities", "NONE", -1, ModuleType.COMBAT); } @Override public String getMetaData() { - return this.mode.getSelectedOption(); + return this.mode.getValue().name(); } @Listener public void sendPacket(EventSendPacket event) { - if(event.getStage() == EventStageable.EventStage.PRE) { - if(event.getPacket() instanceof CPacketUseEntity) { + if (event.getStage() == EventStageable.EventStage.PRE) { + if (event.getPacket() instanceof CPacketUseEntity) { final CPacketUseEntity packet = (CPacketUseEntity) event.getPacket(); - if(packet.getAction() == CPacketUseEntity.Action.ATTACK) { + if (packet.getAction() == CPacketUseEntity.Action.ATTACK) { final Minecraft mc = Minecraft.getMinecraft(); - if(mc.player.onGround && !mc.gameSettings.keyBindJump.isKeyDown() && packet.getEntityFromWorld(mc.world) instanceof EntityLivingBase) { - switch (this.mode.getInt()) { - case 0: + if (mc.player.onGround && !mc.gameSettings.keyBindJump.isKeyDown() && packet.getEntityFromWorld(mc.world) instanceof EntityLivingBase) { + switch (this.mode.getValue()) { + case JUMP: mc.player.jump(); break; - case 1: + case PACKET: //TODO make sure u can actually go there mc.player.connection.sendPacket(new CPacketPlayer.Position(mc.player.posX, mc.player.posY + 0.1f, mc.player.posZ, false)); mc.player.connection.sendPacket(new CPacketPlayer.Position(mc.player.posX, mc.player.posY, mc.player.posZ, false)); @@ -52,4 +52,8 @@ public final class CriticalsModule extends Module { } } + private enum Mode { + JUMP, PACKET + } + } diff --git a/src/main/java/me/rigamortis/seppuku/impl/module/combat/CrystalAuraModule.java b/src/main/java/me/rigamortis/seppuku/impl/module/combat/CrystalAuraModule.java index f481371..951ecd7 100644 --- a/src/main/java/me/rigamortis/seppuku/impl/module/combat/CrystalAuraModule.java +++ b/src/main/java/me/rigamortis/seppuku/impl/module/combat/CrystalAuraModule.java @@ -10,8 +10,7 @@ import me.rigamortis.seppuku.api.util.ColorUtil; import me.rigamortis.seppuku.api.util.MathUtil; import me.rigamortis.seppuku.api.util.RenderUtil; import me.rigamortis.seppuku.api.util.Timer; -import me.rigamortis.seppuku.api.value.old.BooleanValue; -import me.rigamortis.seppuku.api.value.old.NumberValue; +import me.rigamortis.seppuku.api.value.Value; import me.rigamortis.seppuku.impl.module.player.GodModeModule; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; @@ -43,14 +42,14 @@ import java.util.concurrent.CopyOnWriteArrayList; */ public final class CrystalAuraModule extends Module { - public final NumberValue range = new NumberValue("Range", new String[]{"Dist"}, 4.5f, Float.class, 0.0f, 5.0f, 0.1f); - public final NumberValue delay = new NumberValue("Attack_Delay", new String[]{"AttackDelay", "AttackDel", "Del"}, 50.0f, Float.class, 0.0f, 1000.0f, 1.0f); - public final BooleanValue place = new BooleanValue("Place", new String[]{"AutoPlace"}, true); - public final NumberValue placeDelay = new NumberValue("Place_Delay", new String[]{"PlaceDelay", "PlaceDel"}, 50.0f, Float.class, 0.0f, 1000.0f, 1.0f); - public final NumberValue minDamage = new NumberValue("Min_Damage", new String[]{"MinDamage", "Min", "MinDmg"}, 1.0f, Float.class, 0.0f, 20.0f, 0.5f); - public final BooleanValue ignore = new BooleanValue("Ignore", new String[]{"Ig"}, false); - public final BooleanValue render = new BooleanValue("Render", new String[]{"R"}, true); - public final BooleanValue renderDamage = new BooleanValue("Render_Damage", new String[]{"RD", "RenderDamage", "ShowDamage"}, true); + public final Value range = new Value("Range", new String[]{"Dist"}, "The minimum range to attack crystals.", 4.5f, 0.0f, 5.0f, 0.1f); + public final Value delay = new Value("Attack_Delay", new String[]{"AttackDelay", "AttackDel", "Del"}, "The delay to attack in milliseconds.", 50.0f, 0.0f, 1000.0f, 1.0f); + public final Value place = new Value("Place", new String[]{"AutoPlace"}, "Automatically place crystals.", true); + public final Value placeDelay = new Value("Place_Delay", new String[]{"PlaceDelay", "PlaceDel"}, "The delay to place crystals.", 50.0f, 0.0f, 1000.0f, 1.0f); + public final Value minDamage = new Value("Min_Damage", new String[]{"MinDamage", "Min", "MinDmg"}, "The minimum explosion damage calculated to place down a crystal.", 1.0f, 0.0f, 20.0f, 0.5f); + public final Value ignore = new Value("Ignore", new String[]{"Ig"}, "Ignore self damage checks.", false); + public final Value render = new Value("Render", new String[]{"R"}, "Draws information about recently placed crystals from your player.", true); + public final Value renderDamage = new Value("Render_Damage", new String[]{"RD", "RenderDamage", "ShowDamage"}, "Draws calculated explosion damage on recently placed crystals from your player.", true); private Timer attackTimer = new Timer(); private Timer placeTimer = new Timer(); @@ -70,9 +69,9 @@ public final class CrystalAuraModule extends Module { return; } - if (this.place.getBoolean()) { - if (this.placeTimer.passed(this.placeDelay.getFloat())) { - final float radius = this.range.getFloat(); + if (this.place.getValue()) { + if (this.placeTimer.passed(this.placeDelay.getValue())) { + final float radius = this.range.getValue(); float damage = 0; double maxDist = 6.0f; @@ -108,7 +107,7 @@ public final class CrystalAuraModule extends Module { localDamage = -1; } - if (currentDamage > damage && currentDamage >= this.minDamage.getFloat() && localDamage <= currentDamage) { + if (currentDamage > damage && currentDamage >= this.minDamage.getValue() && localDamage <= currentDamage) { damage = currentDamage; pos = blockPos; } @@ -131,7 +130,7 @@ public final class CrystalAuraModule extends Module { for (Entity entity : mc.world.loadedEntityList) { if (entity != null && entity instanceof EntityEnderCrystal) { - if (mc.player.getDistance(entity) <= this.range.getFloat()) { + if (mc.player.getDistance(entity) <= this.range.getValue()) { for (Entity ent : mc.world.loadedEntityList) { if (ent != null && ent != mc.player && (ent.getDistance(entity) <= 14.0f) && ent != entity && ent instanceof EntityPlayer) { final EntityPlayer player = (EntityPlayer) ent; @@ -142,10 +141,10 @@ public final class CrystalAuraModule extends Module { localDamage = -1; } - if (localDamage <= currentDamage && currentDamage >= this.minDamage.getFloat()) { + if (localDamage <= currentDamage && currentDamage >= this.minDamage.getValue()) { final float[] angle = MathUtil.calcAngle(mc.player.getPositionEyes(mc.getRenderPartialTicks()), entity.getPositionVector()); Seppuku.INSTANCE.getRotationManager().setPlayerRotations(angle[0], angle[1]); - if (this.attackTimer.passed(this.delay.getFloat())) { + if (this.attackTimer.passed(this.delay.getValue())) { mc.player.swingArm(EnumHand.MAIN_HAND); mc.playerController.attackEntity(mc.player, entity); this.attackTimer.reset(); @@ -177,7 +176,7 @@ public final class CrystalAuraModule extends Module { @Listener public void onRender(EventRender3D event) { - if (!this.render.getBoolean()) + if (!this.render.getValue()) return; final Minecraft mc = Minecraft.getMinecraft(); @@ -202,7 +201,7 @@ public final class CrystalAuraModule extends Module { RenderUtil.drawFilledBox(bb, ColorUtil.changeAlpha(0xAA9900EE, placeLocation.alpha / 2)); RenderUtil.drawBoundingBox(bb, 1, ColorUtil.changeAlpha(0xAAAAAAAA, placeLocation.alpha)); - if (this.renderDamage.getBoolean()) { + if (this.renderDamage.getValue()) { GlStateManager.pushMatrix(); RenderUtil.glBillboardDistanceScaled((float) placeLocation.getX() + 0.5f, (float) placeLocation.getY() + 0.5f, (float) placeLocation.getZ() + 0.5f, mc.player, 1); final float damage = placeLocation.damage; @@ -229,7 +228,7 @@ public final class CrystalAuraModule extends Module { return false; } - if (this.ignore.getBoolean()) { + if (this.ignore.getValue()) { return false; } @@ -247,7 +246,7 @@ public final class CrystalAuraModule extends Module { if (floor == Blocks.AIR && ceil == Blocks.AIR) { if (mc.world.getEntitiesWithinAABBExcludingEntity(null, new AxisAlignedBB(pos.add(0, 1, 0))).isEmpty()) { - if (mc.player.getDistance(pos.getX() + 0.5f, pos.getY() + 0.5f, pos.getZ() + 0.5f) <= this.range.getFloat()) { + if (mc.player.getDistance(pos.getX() + 0.5f, pos.getY() + 0.5f, pos.getZ() + 0.5f) <= this.range.getValue()) { return true; } } diff --git a/src/main/java/me/rigamortis/seppuku/impl/module/combat/KillAuraModule.java b/src/main/java/me/rigamortis/seppuku/impl/module/combat/KillAuraModule.java index f113d78..3778eb7 100644 --- a/src/main/java/me/rigamortis/seppuku/impl/module/combat/KillAuraModule.java +++ b/src/main/java/me/rigamortis/seppuku/impl/module/combat/KillAuraModule.java @@ -5,8 +5,7 @@ import me.rigamortis.seppuku.api.event.EventStageable; import me.rigamortis.seppuku.api.event.player.EventUpdateWalkingPlayer; import me.rigamortis.seppuku.api.module.Module; import me.rigamortis.seppuku.api.util.MathUtil; -import me.rigamortis.seppuku.api.value.old.BooleanValue; -import me.rigamortis.seppuku.api.value.old.NumberValue; +import me.rigamortis.seppuku.api.value.Value; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -32,16 +31,16 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener; */ public final class KillAuraModule extends Module { - public final BooleanValue players = new BooleanValue("Players", new String[]{"Player"}, true); - public final BooleanValue mobs = new BooleanValue("Mobs", new String[]{"Mob"}, true); - public final BooleanValue animals = new BooleanValue("Animals", new String[]{"Animal"}, true); - public final BooleanValue vehicles = new BooleanValue("Vehicles", new String[]{"Vehic", "Vehicle"}, true); - public final BooleanValue projectiles = new BooleanValue("Projectile", new String[]{"Proj"}, true); + public final Value players = new Value("Players", new String[]{"Player"}, "Choose to target players.", true); + public final Value mobs = new Value("Mobs", new String[]{"Mob"}, "Choose to target mobs.", true); + public final Value animals = new Value("Animals", new String[]{"Animal"}, "Choose to target animals.", true); + public final Value vehicles = new Value("Vehicles", new String[]{"Vehic", "Vehicle"}, "Choose to target vehicles.", true); + public final Value projectiles = new Value("Projectile", new String[]{"Proj"}, "Choose to target projectiles", true); - public final NumberValue range = new NumberValue("Range", new String[]{"Dist"}, 4.5f, Float.class, 0.0f, 5.0f, 0.1f); - public final BooleanValue coolDown = new BooleanValue("CoolDown", new String[]{"CoolD"}, true); - public final BooleanValue sync = new BooleanValue("Sync", new String[]{"snc"}, true); - public final BooleanValue teleport = new BooleanValue("Teleport", new String[]{"tp"}, false); + public final Value range = new Value<>("Range", new String[]{"Dist"}, "The minimum range to attack.", 4.5f, 0.0f, 5.0f, 0.1f); + public final Value coolDown = new Value("CoolDown", new String[]{"CoolD"}, "Delay your hits to gain damage.", true); + public final Value sync = new Value("Sync", new String[]{"snc"}, "Sync your hits with the server's estimated TPS.", true); + public final Value teleport = new Value("Teleport", new String[]{"tp"}, "Teleports to your target(Only works on vanilla).", false); public KillAuraModule() { super("KillAura", new String[]{"Aura"}, "Automatically aims and attacks enemies", "NONE", -1, ModuleType.COMBAT); @@ -60,12 +59,12 @@ public final class KillAuraModule extends Module { final float ticks = 20.0f - Seppuku.INSTANCE.getTickRateManager().getTickRate(); - final boolean canAttack = this.coolDown.getBoolean() ? (mc.player.getCooledAttackStrength(this.sync.getBoolean() ? -ticks : 0.0f) >= 1) : true; + final boolean canAttack = this.coolDown.getValue() ? (mc.player.getCooledAttackStrength(this.sync.getValue() ? -ticks : 0.0f) >= 1) : true; final ItemStack stack = mc.player.getHeldItem(EnumHand.OFF_HAND); //TODO interp - if(this.teleport.getBoolean()) { + if(this.teleport.getValue()) { Seppuku.INSTANCE.getPositionManager().setPlayerPosition(target.posX, target.posY, target.posZ); } @@ -87,7 +86,7 @@ public final class KillAuraModule extends Module { final Minecraft mc = Minecraft.getMinecraft(); - float maxDist = this.range.getFloat(); + float maxDist = this.range.getValue(); for (Entity e : mc.world.loadedEntityList) { if (e != null) { @@ -108,23 +107,23 @@ public final class KillAuraModule extends Module { private boolean checkFilter(Entity entity) { boolean ret = false; - if (this.players.getBoolean() && entity instanceof EntityPlayer && entity != Minecraft.getMinecraft().player && Seppuku.INSTANCE.getFriendManager().isFriend(entity) == null && !entity.getName().equals(Minecraft.getMinecraft().player.getName())) { + if (this.players.getValue() && entity instanceof EntityPlayer && entity != Minecraft.getMinecraft().player && Seppuku.INSTANCE.getFriendManager().isFriend(entity) == null && !entity.getName().equals(Minecraft.getMinecraft().player.getName())) { ret = true; } - if (this.mobs.getBoolean() && entity instanceof IMob) { + if (this.mobs.getValue() && entity instanceof IMob) { ret = true; } - if (this.animals.getBoolean() && entity instanceof IAnimals && !(entity instanceof IMob)) { + if (this.animals.getValue() && entity instanceof IAnimals && !(entity instanceof IMob)) { ret = true; } - if (this.vehicles.getBoolean() && (entity instanceof EntityBoat || entity instanceof EntityMinecart || entity instanceof EntityMinecartContainer)) { + if (this.vehicles.getValue() && (entity instanceof EntityBoat || entity instanceof EntityMinecart || entity instanceof EntityMinecartContainer)) { ret = true; } - if(this.projectiles.getBoolean() && (entity instanceof EntityShulkerBullet || entity instanceof EntityFireball)) { + if(this.projectiles.getValue() && (entity instanceof EntityShulkerBullet || entity instanceof EntityFireball)) { ret = true; } diff --git a/src/main/java/me/rigamortis/seppuku/impl/module/combat/NoCrystalModule.java b/src/main/java/me/rigamortis/seppuku/impl/module/combat/NoCrystalModule.java index 8835648..8de7dfd 100644 --- a/src/main/java/me/rigamortis/seppuku/impl/module/combat/NoCrystalModule.java +++ b/src/main/java/me/rigamortis/seppuku/impl/module/combat/NoCrystalModule.java @@ -5,7 +5,7 @@ import me.rigamortis.seppuku.api.event.EventStageable; import me.rigamortis.seppuku.api.event.player.EventUpdateWalkingPlayer; import me.rigamortis.seppuku.api.module.Module; import me.rigamortis.seppuku.api.util.MathUtil; -import me.rigamortis.seppuku.api.value.old.BooleanValue; +import me.rigamortis.seppuku.api.value.Value; import me.rigamortis.seppuku.impl.module.player.FreeCamModule; import net.minecraft.block.Block; import net.minecraft.block.BlockAir; @@ -31,7 +31,7 @@ public final class NoCrystalModule extends Module { private final Minecraft mc = Minecraft.getMinecraft(); - public final BooleanValue disable = new BooleanValue("Disable", new String[]{"dis"}, false); + public final Value disable = new Value("Disable", new String[]{"dis"}, "Automatically disable after it places.", false); private int lastSlot; @@ -78,7 +78,7 @@ public final class NoCrystalModule extends Module { mc.player.inventory.currentItem = this.lastSlot; mc.playerController.updateController(); - if(this.disable.getBoolean()) { + if(this.disable.getValue()) { this.toggle(); } } diff --git a/src/main/java/me/rigamortis/seppuku/impl/module/combat/RegenModule.java b/src/main/java/me/rigamortis/seppuku/impl/module/combat/RegenModule.java index 53225f9..203cc51 100644 --- a/src/main/java/me/rigamortis/seppuku/impl/module/combat/RegenModule.java +++ b/src/main/java/me/rigamortis/seppuku/impl/module/combat/RegenModule.java @@ -3,9 +3,7 @@ package me.rigamortis.seppuku.impl.module.combat; import me.rigamortis.seppuku.api.event.EventStageable; import me.rigamortis.seppuku.api.event.player.EventPlayerUpdate; import me.rigamortis.seppuku.api.module.Module; -import me.rigamortis.seppuku.api.value.old.BooleanValue; -import me.rigamortis.seppuku.api.value.old.NumberValue; -import me.rigamortis.seppuku.api.value.old.OptionalValue; +import me.rigamortis.seppuku.api.value.Value; import net.minecraft.client.Minecraft; import net.minecraft.init.Items; import net.minecraft.inventory.ClickType; @@ -20,11 +18,11 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener; */ public final class RegenModule extends Module { - public final OptionalValue mode = new OptionalValue("Mode", new String[]{"Mode", "M"}, 0, new String[]{"Potion", "Gapple"}); + public final Value mode = new Value("Mode", new String[]{"Mode", "M"}, "The regen mode to use.", Mode.GAPPLE); - public final NumberValue health = new NumberValue("Health", new String[]{"Hp"}, 8.0f, Float.class, 0.0f, 20.0f, 0.5f); + public final Value health = new Value("Health", new String[]{"Hp"}, "The minimum health required to heal.", 8.0f, 0.0f, 20.0f, 0.5f); - public final BooleanValue refill = new BooleanValue("Refill", new String[]{"ref"}, true); + public final Value refill = new Value("Refill", new String[]{"ref"}, "Automatically refill the hotbar with gapples.", true); private int gappleSlot = -1; @@ -34,7 +32,7 @@ public final class RegenModule extends Module { @Override public String getMetaData() { - return this.mode.getSelectedOption(); + return this.mode.getValue().name(); } @Override @@ -49,11 +47,11 @@ public final class RegenModule extends Module { final ItemStack stack = mc.player.inventory.getCurrentItem(); - switch (this.mode.getInt()) { - case 0: + switch (this.mode.getValue()) { + case POTION: break; - case 1: - if (mc.player.getHealth() <= this.health.getFloat() && mc.player.getAbsorptionAmount() <= 0) { + case GAPPLE: + if (mc.player.getHealth() <= this.health.getValue() && mc.player.getAbsorptionAmount() <= 0) { gappleSlot = getItemHotbar(Items.GOLDEN_APPLE); } @@ -73,9 +71,9 @@ public final class RegenModule extends Module { gappleSlot = -1; } } - }else{ - if (mc.player.getHealth() <= this.health.getFloat() && mc.player.getAbsorptionAmount() <= 0) { - if (this.refill.getBoolean()) { + } else { + if (mc.player.getHealth() <= this.health.getValue() && mc.player.getAbsorptionAmount() <= 0) { + if (this.refill.getValue()) { final int invSlot = findStackInventory(Items.GOLDEN_APPLE); if (invSlot != -1) { final int empty = findEmptyhotbar(); @@ -104,7 +102,7 @@ public final class RegenModule extends Module { for (int i = 0; i < 9; i++) { final ItemStack stack = Minecraft.getMinecraft().player.inventory.getStackInSlot(i); - if(stack.getItem() == Items.AIR) { + if (stack.getItem() == Items.AIR) { return i; } } @@ -121,4 +119,8 @@ public final class RegenModule extends Module { return -1; } + private enum Mode { + POTION, GAPPLE + } + } diff --git a/src/main/java/me/rigamortis/seppuku/impl/module/combat/VelocityModule.java b/src/main/java/me/rigamortis/seppuku/impl/module/combat/VelocityModule.java index 44bb418..401684b 100644 --- a/src/main/java/me/rigamortis/seppuku/impl/module/combat/VelocityModule.java +++ b/src/main/java/me/rigamortis/seppuku/impl/module/combat/VelocityModule.java @@ -3,8 +3,7 @@ package me.rigamortis.seppuku.impl.module.combat; import me.rigamortis.seppuku.api.event.EventStageable; import me.rigamortis.seppuku.api.event.network.EventReceivePacket; import me.rigamortis.seppuku.api.module.Module; -import me.rigamortis.seppuku.api.value.old.BooleanValue; -import me.rigamortis.seppuku.api.value.old.NumberValue; +import me.rigamortis.seppuku.api.value.Value; import net.minecraft.client.Minecraft; import net.minecraft.network.play.server.SPacketEntityVelocity; import net.minecraft.network.play.server.SPacketExplosion; @@ -16,9 +15,9 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener; */ public final class VelocityModule extends Module { - public final NumberValue horizontal_vel = new NumberValue("Horizontal_Velocity", new String[]{"Horizontal_Velocity", "HVel", "HV", "HorizontalVel"}, 0, Integer.class, 0, 100, 1); - public final NumberValue vertical_vel = new NumberValue("Vertical_Velocity", new String[]{"Vertical_Velocity", "VVel", "VV", "VerticalVel"}, 0, Integer.class, 0, 100, 1); - public final BooleanValue explosions = new BooleanValue("Explosions", new String[]{"Explosions", "Explosion", "EXP", "EX", "Expl"}, true); + public final Value horizontal_vel = new Value("Horizontal_Velocity", new String[]{"Horizontal_Velocity", "HVel", "HV", "HorizontalVel"}, "The horizontal velocity you will take.", 0, 0, 100, 1); + public final Value vertical_vel = new Value("Vertical_Velocity", new String[]{"Vertical_Velocity", "VVel", "VV", "VerticalVel"}, "The vertical velocity you will take.", 0, 0, 100, 1); + public final Value explosions = new Value("Explosions", new String[]{"Explosions", "Explosion", "EXP", "EX", "Expl"}, "Apply velocity modifier on explosion velocity.", true); public VelocityModule() { super("Velocity", new String[]{"Vel", "AntiVelocity", "Knockback", "AntiKnockback"}, "Modify the velocity you take", "NONE", -1, ModuleType.COMBAT); @@ -30,36 +29,36 @@ public final class VelocityModule extends Module { if (event.getPacket() instanceof SPacketEntityVelocity) { final SPacketEntityVelocity packet = (SPacketEntityVelocity) event.getPacket(); if (packet.getEntityID() == Minecraft.getMinecraft().player.getEntityId()) { - if (this.horizontal_vel.getInt() == 0 && this.vertical_vel.getInt() == 0) { + if (this.horizontal_vel.getValue() == 0 && this.vertical_vel.getValue() == 0) { event.setCanceled(true); return; } - if (this.horizontal_vel.getInt() != 100) { - packet.motionX = packet.motionX / 100 * this.horizontal_vel.getInt(); - packet.motionZ = packet.motionZ / 100 * this.horizontal_vel.getInt(); + if (this.horizontal_vel.getValue() != 100) { + packet.motionX = packet.motionX / 100 * this.horizontal_vel.getValue(); + packet.motionZ = packet.motionZ / 100 * this.horizontal_vel.getValue(); } - if (this.vertical_vel.getInt() != 100) { - packet.motionY = packet.motionY / 100 * this.vertical_vel.getInt(); + if (this.vertical_vel.getValue() != 100) { + packet.motionY = packet.motionY / 100 * this.vertical_vel.getValue(); } } } - if (event.getPacket() instanceof SPacketExplosion && this.explosions.getBoolean()) { + if (event.getPacket() instanceof SPacketExplosion && this.explosions.getValue()) { final SPacketExplosion packet = (SPacketExplosion) event.getPacket(); - if (this.horizontal_vel.getInt() == 0 && this.vertical_vel.getInt() == 0) { + if (this.horizontal_vel.getValue() == 0 && this.vertical_vel.getValue() == 0) { event.setCanceled(true); return; } - if (this.horizontal_vel.getInt() != 100) { - packet.motionX = packet.motionX / 100 * this.horizontal_vel.getInt(); - packet.motionZ = packet.motionZ / 100 * this.horizontal_vel.getInt(); + if (this.horizontal_vel.getValue() != 100) { + packet.motionX = packet.motionX / 100 * this.horizontal_vel.getValue(); + packet.motionZ = packet.motionZ / 100 * this.horizontal_vel.getValue(); } - if (this.vertical_vel.getInt() != 100) { - packet.motionY = packet.motionY / 100 * this.vertical_vel.getInt(); + if (this.vertical_vel.getValue() != 100) { + packet.motionY = packet.motionY / 100 * this.vertical_vel.getValue(); } } }