This commit is contained in:
noil755 2019-11-29 20:31:22 -05:00
parent 03d27f12ea
commit b6871bd02b
11 changed files with 225 additions and 188 deletions

View File

@ -4,8 +4,7 @@ import me.rigamortis.seppuku.api.event.EventStageable;
import me.rigamortis.seppuku.api.event.network.EventReceivePacket;
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.OptionalValue;
import me.rigamortis.seppuku.api.value.Value;
import net.minecraft.client.Minecraft;
import net.minecraft.init.MobEffects;
import net.minecraft.network.play.server.SPacketEntityEffect;
@ -19,8 +18,13 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
*/
public final class BrightnessModule extends Module {
public final OptionalValue mode = new OptionalValue("Mode", new String[]{"Mode", "M"}, 0, new String[]{"Gamma", "Potion", "Table"});
public final BooleanValue effects = new BooleanValue("Effects", new String[]{"Eff"}, true);
public final Value<Mode> mode = new Value<Mode>("Mode", new String[]{"Mode", "M"}, "The brightness mode to use.", Mode.GAMMA);
private enum Mode {
GAMMA, POTION, TABLE
}
public final Value<Boolean> effects = new Value<Boolean>("Effects", new String[]{"Eff"}, "Blocks blindness & nausea effects if enabled.", true);
private float lastGamma;
@ -33,7 +37,7 @@ public final class BrightnessModule extends Module {
@Override
public void onEnable() {
super.onEnable();
if (this.mode.getInt() == 0) {
if (this.mode.getValue() == Mode.GAMMA) {
this.lastGamma = Minecraft.getMinecraft().gameSettings.gammaSetting;
}
}
@ -42,13 +46,15 @@ public final class BrightnessModule extends Module {
public void onDisable() {
super.onDisable();
if (this.mode.getInt() == 0) {
if (this.mode.getValue() == Mode.GAMMA) {
Minecraft.getMinecraft().gameSettings.gammaSetting = this.lastGamma;
}
if (this.mode.getInt() == 1 && Minecraft.getMinecraft().player != null) {
if (this.mode.getValue() == Mode.POTION && Minecraft.getMinecraft().player != null) {
Minecraft.getMinecraft().player.removePotionEffect(MobEffects.NIGHT_VISION);
}
if (this.mode.getInt() == 2) {
if (this.mode.getValue() == Mode.TABLE) {
if (Minecraft.getMinecraft().world != null) {
float f = 0.0F;
@ -62,21 +68,21 @@ public final class BrightnessModule extends Module {
@Override
public String getMetaData() {
return this.mode.getSelectedOption();
return this.mode.getValue().name();
}
@Listener
public void onUpdate(EventPlayerUpdate event) {
if (event.getStage() == EventStageable.EventStage.PRE) {
switch (this.mode.getInt()) {
case 0:
switch (this.mode.getValue()) {
case GAMMA:
Minecraft.getMinecraft().gameSettings.gammaSetting = 1000;
break;
case 1:
case POTION:
Minecraft.getMinecraft().player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, 5210));
break;
case 2:
if(this.world != Minecraft.getMinecraft().world) {
case TABLE:
if (this.world != Minecraft.getMinecraft().world) {
if (Minecraft.getMinecraft().world != null) {
for (int i = 0; i <= 15; ++i) {
Minecraft.getMinecraft().world.provider.getLightBrightnessTable()[i] = 1.0f;
@ -93,7 +99,7 @@ public final class BrightnessModule extends Module {
public void receivePacket(EventReceivePacket event) {
if (event.getStage() == EventStageable.EventStage.PRE) {
if (event.getPacket() instanceof SPacketEntityEffect) {
if (this.effects.getBoolean()) {
if (this.effects.getValue()) {
final SPacketEntityEffect packet = (SPacketEntityEffect) event.getPacket();
if (Minecraft.getMinecraft().player != null && packet.getEntityId() == Minecraft.getMinecraft().player.getEntityId()) {
if (packet.getEffectId() == 9 || packet.getEffectId() == 15) {

View File

@ -3,8 +3,7 @@ package me.rigamortis.seppuku.impl.module.render;
import me.rigamortis.seppuku.api.event.EventStageable;
import me.rigamortis.seppuku.api.event.render.EventRenderEntity;
import me.rigamortis.seppuku.api.module.Module;
import me.rigamortis.seppuku.api.value.old.BooleanValue;
import me.rigamortis.seppuku.api.value.old.OptionalValue;
import me.rigamortis.seppuku.api.value.Value;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
@ -27,12 +26,16 @@ import static org.lwjgl.opengl.GL11.*;
*/
public final class ChamsModule 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 Value<Boolean> players = new Value<Boolean>("Players", new String[]{"Player"}, "Choose to enable on players.", true);
public final Value<Boolean> mobs = new Value<Boolean>("Mobs", new String[]{"Mob"}, "Choose to enable on mobs.", true);
public final Value<Boolean> animals = new Value<Boolean>("Animals", new String[]{"Animal"}, "Choose to enable on animals.", true);
public final Value<Boolean> vehicles = new Value<Boolean>("Vehicles", new String[]{"Vehic", "Vehicle"}, "Choose to enable on vehicles.", true);
public final OptionalValue mode = new OptionalValue("Mode", new String[]{"Mode"}, 0, new String[]{"Normal", "Texture", "Flat", "WireFrame"});
public final Value<Mode> mode = new Value<Mode>("Mode", new String[]{"Mode"}, "The chams mode to use.", Mode.NORMAL);
private enum Mode {
NORMAL, TEXTURE, FLAT, WIREFRAME
}
public ChamsModule() {
super("Chams", new String[]{"Cham", "Chameleon"}, "Allows you to see entities through walls", "NONE", -1, ModuleType.RENDER);
@ -40,7 +43,7 @@ public final class ChamsModule extends Module {
@Override
public String getMetaData() {
return this.mode.getSelectedOption();
return this.mode.getValue().name();
}
@Listener
@ -54,15 +57,15 @@ public final class ChamsModule extends Module {
Minecraft.getMinecraft().getRenderManager().setRenderShadow(false);
Minecraft.getMinecraft().getRenderManager().setRenderOutlines(false);
switch (this.mode.getInt()) {
case 0:
switch (this.mode.getValue()) {
case NORMAL:
GlStateManager.pushMatrix();
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0F, 240.0F);
glEnable(GL11.GL_POLYGON_OFFSET_FILL);
glPolygonOffset(1.0f, -1100000.0f);
GlStateManager.popMatrix();
break;
case 1:
case TEXTURE:
GlStateManager.pushMatrix();
glEnable(GL11.GL_POLYGON_OFFSET_FILL);
glPolygonOffset(1.0f, -1100000.0f);
@ -70,7 +73,7 @@ public final class ChamsModule extends Module {
GlStateManager.color(1, 1, 1);
GlStateManager.popMatrix();
break;
case 2:
case FLAT:
GlStateManager.pushMatrix();
glEnable(GL11.GL_POLYGON_OFFSET_FILL);
glPolygonOffset(1.0f, -1100000.0f);
@ -79,7 +82,7 @@ public final class ChamsModule extends Module {
GlStateManager.color(1, 1, 1);
GlStateManager.popMatrix();
break;
case 3:
case WIREFRAME:
GlStateManager.pushMatrix();
glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_LINE);
glEnable(GL11.GL_POLYGON_OFFSET_LINE);
@ -98,21 +101,21 @@ public final class ChamsModule extends Module {
Minecraft.getMinecraft().getRenderManager().setRenderShadow(shadow);
switch (this.mode.getInt()) {
case 0:
switch (this.mode.getValue()) {
case NORMAL:
GlStateManager.pushMatrix();
glDisable(GL11.GL_POLYGON_OFFSET_FILL);
glPolygonOffset(1.0f, 1100000.0f);
GlStateManager.popMatrix();
break;
case 1:
case TEXTURE:
GlStateManager.pushMatrix();
glDisable(GL11.GL_POLYGON_OFFSET_FILL);
glPolygonOffset(1.0f, 1100000.0f);
glEnable(GL11.GL_TEXTURE_2D);
GlStateManager.popMatrix();
break;
case 2:
case FLAT:
GlStateManager.pushMatrix();
glDisable(GL11.GL_POLYGON_OFFSET_FILL);
glPolygonOffset(1.0f, 1100000.0f);
@ -120,7 +123,7 @@ public final class ChamsModule extends Module {
glEnable(GL11.GL_LIGHTING);
GlStateManager.popMatrix();
break;
case 3:
case WIREFRAME:
GlStateManager.pushMatrix();
glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_FILL);
glDisable(GL11.GL_POLYGON_OFFSET_LINE);
@ -148,19 +151,19 @@ public final class ChamsModule extends Module {
ret = false;
}
if (this.players.getBoolean() && entity instanceof EntityPlayer && entity != Minecraft.getMinecraft().player) {
if (this.players.getValue() && entity instanceof EntityPlayer && entity != Minecraft.getMinecraft().player) {
ret = true;
}
if (this.animals.getBoolean() && entity instanceof IAnimals) {
if (this.animals.getValue() && entity instanceof IAnimals) {
ret = true;
}
if (this.mobs.getBoolean() && entity instanceof IMob) {
if (this.mobs.getValue() && 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;
}

View File

@ -4,8 +4,7 @@ import me.rigamortis.seppuku.api.event.player.EventPlayerUpdate;
import me.rigamortis.seppuku.api.event.render.EventRender3D;
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.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
@ -28,9 +27,8 @@ import static org.lwjgl.opengl.GL11.*;
*/
public final class HolesModule extends Module {
public final NumberValue radius = new NumberValue("Radius", new String[]{"Radius", "Range", "Distance"}, 8, Integer.class, 0, 32, 1);
public final BooleanValue fade = new BooleanValue("Fade", new String[]{"f"}, true);
public final Value<Integer> radius = new Value<Integer>("Radius", new String[]{"Radius", "Range", "Distance"}, "Radius in blocks to scan for holes.", 8, 0, 32, 1);
public final Value<Boolean> fade = new Value<Boolean>("Fade", new String[]{"f"}, "Fades the opacity of the hole the closer your player is to it when enabled.", true);
public final List<Hole> holes = new ArrayList<>();
@ -51,8 +49,8 @@ public final class HolesModule extends Module {
final Vec3i playerPos = new Vec3i(mc.player.posX, mc.player.posY, mc.player.posZ);
for (int x = playerPos.getX() - radius.getInt(); x < playerPos.getX() + radius.getInt(); x++) {
for (int z = playerPos.getZ() - radius.getInt(); z < playerPos.getZ() + radius.getInt(); z++) {
for (int x = playerPos.getX() - radius.getValue(); x < playerPos.getX() + radius.getValue(); x++) {
for (int z = playerPos.getZ() - radius.getValue(); z < playerPos.getZ() + radius.getValue(); z++) {
for (int y = playerPos.getY(); y > playerPos.getY() - 4; y--) {
final BlockPos blockPos = new BlockPos(x, y, z);
final IBlockState blockState = mc.world.getBlockState(blockPos);
@ -105,10 +103,10 @@ public final class HolesModule extends Module {
final double dist = mc.player.getDistance(hole.getX() + 0.5f, hole.getY() + 0.5f, hole.getZ() + 0.5f) * 0.75f;
float alpha = MathUtil.clamp((float) (dist * 255.0f / (this.radius.getInt()) / 255.0f), 0.0f, 0.3f);
float alpha = MathUtil.clamp((float) (dist * 255.0f / (this.radius.getValue()) / 255.0f), 0.0f, 0.3f);
RenderGlobal.renderFilledBox(bb, 0, 1, 0, this.fade.getBoolean() ? alpha : 0.25f);
RenderGlobal.drawBoundingBox(bb.minX, bb.minY, bb.minZ, bb.maxX, bb.maxY, bb.maxZ, 0, 1, 0, this.fade.getBoolean() ? alpha : 0.25f);
RenderGlobal.renderFilledBox(bb, 0, 1, 0, this.fade.getValue() ? alpha : 0.25f);
RenderGlobal.drawBoundingBox(bb.minX, bb.minY, bb.minZ, bb.maxX, bb.maxY, bb.maxZ, 0, 1, 0, this.fade.getValue() ? alpha : 0.25f);
glDisable(GL_LINE_SMOOTH);
GlStateManager.depthMask(true);
GlStateManager.enableDepth();

View File

@ -5,7 +5,7 @@ import me.rigamortis.seppuku.api.event.gui.EventRenderPotions;
import me.rigamortis.seppuku.api.event.render.EventRender2D;
import me.rigamortis.seppuku.api.gui.hud.component.HudComponent;
import me.rigamortis.seppuku.api.module.Module;
import me.rigamortis.seppuku.api.value.old.BooleanValue;
import me.rigamortis.seppuku.api.value.Value;
import me.rigamortis.seppuku.impl.gui.hud.GuiHudEditor;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
@ -17,7 +17,7 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
*/
public final class HudModule extends Module {
public final BooleanValue hidePotions = new BooleanValue("HidePotions", new String[]{"HidePotions", "HidePots", "Hide_Potions"}, true);
public final Value<Boolean> hidePotions = new Value<Boolean>("HidePotions", new String[]{"HidePotions", "HidePots", "Hide_Potions"}, "Hides the Vanilla potion hud (at the top right of the screen).", true);
public HudModule() {
super("Hud", new String[]{"Overlay"}, "Shows lots of useful info", "NONE", -1, ModuleType.RENDER);
@ -49,7 +49,7 @@ public final class HudModule extends Module {
@Listener
public void renderPotions(EventRenderPotions event) {
if (this.hidePotions.getBoolean()) {
if (this.hidePotions.getValue()) {
event.setCanceled(true);
}
}

View File

@ -9,7 +9,7 @@ import me.rigamortis.seppuku.api.event.render.EventRender2D;
import me.rigamortis.seppuku.api.event.render.EventRender3D;
import me.rigamortis.seppuku.api.module.Module;
import me.rigamortis.seppuku.api.util.GLUProjection;
import me.rigamortis.seppuku.api.value.old.NumberValue;
import me.rigamortis.seppuku.api.value.Value;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
@ -23,7 +23,7 @@ import java.util.Map;
*/
public final class LogoutSpotsModule extends Module {
public final NumberValue<Integer> removeDistance = new NumberValue<Integer>("RemoveDistance", new String[]{"RD", "RemoveRange"}, 200, Integer.class, 1, 2000, 1);
public final Value<Integer> removeDistance = new Value<Integer>("RemoveDistance", new String[]{"RD", "RemoveRange"}, "Minimum distance in blocks the player must be away from the spot for it to be removed.", 200, 1, 2000, 1);
private final Map<String, EntityPlayer> playerCache = Maps.newConcurrentMap();
private final Map<String, PlayerData> logoutCache = Maps.newConcurrentMap();
@ -158,7 +158,7 @@ public final class LogoutSpotsModule extends Module {
private boolean isOutOfRange(PlayerData data) {
Vec3d position = data.position;
return Minecraft.getMinecraft().player.getDistance(position.x, position.y, position.z) > this.removeDistance.getInt();
return Minecraft.getMinecraft().player.getDistance(position.x, position.y, position.z) > this.removeDistance.getValue();
}
private class PlayerData {

View File

@ -6,7 +6,7 @@ import me.rigamortis.seppuku.api.event.render.EventRender3D;
import me.rigamortis.seppuku.api.event.render.EventRenderBlockModel;
import me.rigamortis.seppuku.api.event.world.EventLightUpdate;
import me.rigamortis.seppuku.api.module.Module;
import me.rigamortis.seppuku.api.value.old.BooleanValue;
import me.rigamortis.seppuku.api.value.Value;
import net.minecraft.block.Block;
import net.minecraft.block.BlockPistonExtension;
import net.minecraft.block.BlockPistonMoving;
@ -27,11 +27,11 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
*/
public final class NoLagModule extends Module {
public final BooleanValue light = new BooleanValue("Light", new String[]{"Lit"}, true);
public final BooleanValue signs = new BooleanValue("Signs", new String[]{"Sign"}, false);
public final BooleanValue sounds = new BooleanValue("Sounds", new String[]{"Sound"}, true);
public final BooleanValue pistons = new BooleanValue("Pistons", new String[]{"Piston"}, false);
public final BooleanValue slimes = new BooleanValue("Slimes", new String[]{"Slime"}, false);
public final Value<Boolean> light = new Value<Boolean>("Light", new String[]{"Lit"}, "Choose to enable the lighting lag fix. Disables lighting updates.", true);
public final Value<Boolean> signs = new Value<Boolean>("Signs", new String[]{"Sign"}, "Choose to enable the sign lag fix. Disables the rendering of sign text.", false);
public final Value<Boolean> sounds = new Value<Boolean>("Sounds", new String[]{"Sound"}, "Choose to enable the sound lag fix. Disable entity swap-item/equip sound.", true);
public final Value<Boolean> pistons = new Value<Boolean>("Pistons", new String[]{"Piston"}, "Choose to enable the piston lag fix. Disables pistons from rendering.", false);
public final Value<Boolean> slimes = new Value<Boolean>("Slimes", new String[]{"Slime"}, "Choose to enable the slime lag fix. Disables slimes from spawning.", false);
//TODO slimes, names, items, sounds
public NoLagModule() {
@ -40,8 +40,8 @@ public final class NoLagModule extends Module {
@Listener
public void recievePacket(EventReceivePacket event) {
if(event.getStage() == EventStageable.EventStage.PRE) {
if (this.slimes.getBoolean()) {
if (event.getStage() == EventStageable.EventStage.PRE) {
if (this.slimes.getValue()) {
if (event.getPacket() instanceof SPacketSpawnMob) {
final SPacketSpawnMob packet = (SPacketSpawnMob) event.getPacket();
if (packet.getEntityType() == 55) {
@ -54,14 +54,14 @@ public final class NoLagModule extends Module {
@Listener
public void updateLighting(EventLightUpdate event) {
if (this.light.getBoolean()) {
if (this.light.getValue()) {
event.setCanceled(true);
}
}
@Listener
public void renderBlockModel(EventRenderBlockModel event) {
if (this.pistons.getBoolean()) {
if (this.pistons.getValue()) {
final Block block = event.getBlockState().getBlock();
if (block instanceof BlockPistonMoving || block instanceof BlockPistonExtension) {
event.setRenderable(false);
@ -74,7 +74,7 @@ public final class NoLagModule extends Module {
@Listener
public void renderWorld(EventRender3D event) {
final Minecraft mc = Minecraft.getMinecraft();
if (this.signs.getBoolean()) {
if (this.signs.getValue()) {
for (TileEntity te : mc.world.loadedTileEntityList) {
if (te instanceof TileEntitySign) {
final TileEntitySign sign = (TileEntitySign) te;
@ -88,7 +88,7 @@ public final class NoLagModule extends Module {
public void receivePacket(EventReceivePacket event) {
if (event.getStage() == EventStageable.EventStage.PRE) {
if (event.getPacket() instanceof SPacketSoundEffect) {
if (this.sounds.getBoolean()) {
if (this.sounds.getValue()) {
final SPacketSoundEffect packet = (SPacketSoundEffect) event.getPacket();
if (packet.getCategory() == SoundCategory.PLAYERS && packet.getSound() == SoundEvents.ITEM_ARMOR_EQUIP_GENERIC) {
event.setCanceled(true);

View File

@ -4,7 +4,7 @@ import me.rigamortis.seppuku.api.event.gui.EventRenderHelmet;
import me.rigamortis.seppuku.api.event.gui.EventRenderPortal;
import me.rigamortis.seppuku.api.event.render.EventRenderOverlay;
import me.rigamortis.seppuku.api.module.Module;
import me.rigamortis.seppuku.api.value.old.BooleanValue;
import me.rigamortis.seppuku.api.value.Value;
import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
/**
@ -13,11 +13,11 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
*/
public final class NoOverlayModule extends Module {
public final BooleanValue portal = new BooleanValue("Portal", new String[]{}, true);
public final BooleanValue helmet = new BooleanValue("Helmet", new String[]{}, true);
public final BooleanValue block = new BooleanValue("Block", new String[]{}, true);
public final BooleanValue water = new BooleanValue("Water", new String[]{}, true);
public final BooleanValue fire = new BooleanValue("Fire", new String[]{}, true);
public final Value<Boolean> portal = new Value<Boolean>("Portal", new String[]{}, "Disables the portal screen overlay when using a portal.", true);
public final Value<Boolean> helmet = new Value<Boolean>("Helmet", new String[]{}, "Disables the helmet/pumpkin screen overlay.", true);
public final Value<Boolean> block = new Value<Boolean>("Block", new String[]{}, "Disables the block-side screen overlay when inside of a block.", true);
public final Value<Boolean> water = new Value<Boolean>("Water", new String[]{}, "Disables the water screen overlay when under water.", true);
public final Value<Boolean> fire = new Value<Boolean>("Fire", new String[]{}, "Disables the fire screen overlay when on fire.", true);
public NoOverlayModule() {
super("NoOverlay", new String[]{"AntiOverlay"}, "Removes screen overlay effects", "NONE", -1, ModuleType.RENDER);
@ -25,27 +25,27 @@ public final class NoOverlayModule extends Module {
@Listener
public void renderOverlay(EventRenderOverlay event) {
if (this.block.getBoolean() && event.getType() == EventRenderOverlay.OverlayType.BLOCK) {
if (this.block.getValue() && event.getType() == EventRenderOverlay.OverlayType.BLOCK) {
event.setCanceled(true);
}
if (this.water.getBoolean() && event.getType() == EventRenderOverlay.OverlayType.LIQUID) {
if (this.water.getValue() && event.getType() == EventRenderOverlay.OverlayType.LIQUID) {
event.setCanceled(true);
}
if (this.fire.getBoolean() && event.getType() == EventRenderOverlay.OverlayType.FIRE) {
if (this.fire.getValue() && event.getType() == EventRenderOverlay.OverlayType.FIRE) {
event.setCanceled(true);
}
}
@Listener
public void renderHelmet(EventRenderHelmet event) {
if (this.helmet.getBoolean()) {
if (this.helmet.getValue()) {
event.setCanceled(true);
}
}
@Listener
public void renderPortal(EventRenderPortal event) {
if (this.portal.getBoolean()) {
if (this.portal.getValue()) {
event.setCanceled(true);
}
}

View File

@ -11,9 +11,7 @@ import me.rigamortis.seppuku.api.event.world.EventLoadWorld;
import me.rigamortis.seppuku.api.module.Module;
import me.rigamortis.seppuku.api.util.GLUProjection;
import me.rigamortis.seppuku.api.util.RenderUtil;
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.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
@ -37,18 +35,24 @@ import java.util.concurrent.CopyOnWriteArrayList;
*/
public final class PortalFinderModule extends Module {
public final OptionalValue mode = new OptionalValue("Mode", new String[]{"Mode"}, 0, new String[]{"2D", "3D"});
public final BooleanValue chat = new BooleanValue("Chat", new String[]{"Chat", "ChatMessages", "ChatNotifications"}, true);
public final BooleanValue remove = new BooleanValue("Remove", new String[]{"R", "Delete"}, true);
public final Value<Mode> mode = new Value<Mode>("Mode", new String[]{"Mode"}, "Rendering mode to use for drawing found portals.", Mode.TWO_DIMENSIONAL);
public final NumberValue<Integer> removeDistance = new NumberValue<Integer>("RemoveDistance", new String[]{"RD", "RemoveRange"}, 200, Integer.class, 1, 2000, 1);
public final BooleanValue showInfo = new BooleanValue("ShowInfo", new String[]{"SI", "DrawInfo", "DrawText"}, true);
public final NumberValue<Float> infoScale = new NumberValue<Float>("InfoScale", new String[]{"IS", "Scale", "TextScale"}, 1.0f, Float.class, 0.0f, 3.0f, 0.25f);
private enum Mode {
TWO_DIMENSIONAL, THREE_DIMENSIONAL
}
public final NumberValue<Float> width = new NumberValue<Float>("Width", new String[]{"W", "Width"}, 0.5f, Float.class, 0.0f, 5.0f, 0.1f);
public final NumberValue<Float> red = new NumberValue<Float>("Red", new String[]{"R"}, 255.0f, Float.class, 0.0f, 255.0f, 1.0f);
public final NumberValue<Float> green = new NumberValue<Float>("Green", new String[]{"G"}, 255.0f, Float.class, 0.0f, 255.0f, 1.0f);
public final NumberValue<Float> blue = new NumberValue<Float>("Blue", new String[]{"B"}, 255.0f, Float.class, 0.0f, 255.0f, 1.0f);
public final Value<Boolean> chat = new Value<Boolean>("Chat", new String[]{"Chat", "ChatMessages", "ChatNotifications"}, "Display a message in chat when a portal is found (Hover the message for more info).", true);
public final Value<Boolean> remove = new Value<Boolean>("Remove", new String[]{"R", "Delete"}, "Removes a portal from being drawn if the player is a distance aways from it.", true);
public final Value<Integer> removeDistance = new Value<Integer>("RemoveDistance", new String[]{"RD", "RemoveRange"}, "Minimum distance in blocks the player must be from a portal for it to stop being drawn.", 200, 1, 2000, 1);
public final Value<Boolean> showInfo = new Value<Boolean>("ShowInfo", new String[]{"SI", "DrawInfo", "DrawText"}, "Draws information about the portal at it's location.", true);
public final Value<Float> infoScale = new Value<Float>("InfoScale", new String[]{"IS", "Scale", "TextScale"}, "Scale of the text size on the drawn information.", 1.0f, 0.0f, 3.0f, 0.25f);
public final Value<Float> width = new Value<Float>("Width", new String[]{"W", "Width"}, "Width of each line that is drawn to indicate a portal's location.", 0.5f, 0.0f, 5.0f, 0.1f);
public final Value<Float> red = new Value<Float>("Red", new String[]{"R"}, "Red value for each drawn line.", 255.0f, 0.0f, 255.0f, 1.0f);
public final Value<Float> green = new Value<Float>("Green", new String[]{"G"}, "Green value for each drawn line.", 255.0f, 0.0f, 255.0f, 1.0f);
public final Value<Float> blue = new Value<Float>("Blue", new String[]{"B"}, "Blue value for each drawn line.", 255.0f, 0.0f, 255.0f, 1.0f);
private final List<Vec3d> portals = new CopyOnWriteArrayList<>();
@ -66,16 +70,16 @@ public final class PortalFinderModule extends Module {
@Listener
public void render2D(EventRender2D event) {
if (this.mode.getInt() == 0) {
if (this.mode.getValue() == Mode.TWO_DIMENSIONAL) {
final Minecraft mc = Minecraft.getMinecraft();
for (Vec3d portal : this.portals) {
final GLUProjection.Projection projection = GLUProjection.getInstance().project(portal.x - mc.getRenderManager().viewerPosX, portal.y - mc.getRenderManager().viewerPosY, portal.z - mc.getRenderManager().viewerPosZ, GLUProjection.ClampMode.NONE, true);
if (projection != null) {
RenderUtil.drawLine((float) projection.getX(), (float) projection.getY(), event.getScaledResolution().getScaledWidth() / 2, event.getScaledResolution().getScaledHeight() / 2, this.width.getFloat(), new Color(red.getFloat() / 255.0f, green.getFloat() / 255.0f, blue.getFloat() / 255.0f).getRGB());
RenderUtil.drawLine((float) projection.getX(), (float) projection.getY(), event.getScaledResolution().getScaledWidth() / 2, event.getScaledResolution().getScaledHeight() / 2, this.width.getValue(), new Color(red.getValue() / 255.0f, green.getValue() / 255.0f, blue.getValue() / 255.0f).getRGB());
if (this.showInfo.getBoolean() && projection.isType(GLUProjection.Projection.Type.INSIDE)) {
final float scale = this.infoScale.getFloat();
if (this.showInfo.getValue() && projection.isType(GLUProjection.Projection.Type.INSIDE)) {
final float scale = this.infoScale.getValue();
GlStateManager.pushMatrix();
GlStateManager.scale(scale, scale, scale);
this.drawPortalInfoText(portal, (float) projection.getX() / scale, (float) projection.getY() / scale);
@ -89,7 +93,7 @@ public final class PortalFinderModule extends Module {
@Listener
public void render3D(EventRender3D event) {
if (this.mode.getInt() == 1) {
if (this.mode.getValue() == Mode.THREE_DIMENSIONAL) {
final Minecraft mc = Minecraft.getMinecraft();
for (Vec3d portal : this.portals) {
@ -101,11 +105,11 @@ public final class PortalFinderModule extends Module {
final Vec3d forward = new Vec3d(0, 0, 1).rotatePitch(-(float) Math.toRadians(Minecraft.getMinecraft().player.rotationPitch)).rotateYaw(-(float) Math.toRadians(Minecraft.getMinecraft().player.rotationYaw));
// Line
RenderUtil.drawLine3D((float) forward.x, (float) forward.y + mc.player.getEyeHeight(), (float) forward.z, (float) (portal.x - mc.getRenderManager().renderPosX), (float) (portal.y - mc.getRenderManager().renderPosY), (float) (portal.z - mc.getRenderManager().renderPosZ), this.width.getFloat(), new Color(red.getFloat() / 255.0f, green.getFloat() / 255.0f, blue.getFloat() / 255.0f).getRGB());
RenderUtil.drawLine3D((float) forward.x, (float) forward.y + mc.player.getEyeHeight(), (float) forward.z, (float) (portal.x - mc.getRenderManager().renderPosX), (float) (portal.y - mc.getRenderManager().renderPosY), (float) (portal.z - mc.getRenderManager().renderPosZ), this.width.getValue(), new Color(red.getValue() / 255.0f, green.getValue() / 255.0f, blue.getValue() / 255.0f).getRGB());
// Info
if (this.showInfo.getBoolean()) {
RenderUtil.glBillboardDistanceScaled((float) portal.x, (float) portal.y, (float) portal.z, mc.player, this.infoScale.getFloat());
if (this.showInfo.getValue()) {
RenderUtil.glBillboardDistanceScaled((float) portal.x, (float) portal.y, (float) portal.z, mc.player, this.infoScale.getValue());
GlStateManager.disableDepth();
this.drawPortalInfoText(portal, 0, 0);
GlStateManager.enableDepth();
@ -155,7 +159,7 @@ public final class PortalFinderModule extends Module {
if (!isPortalCached(position.getX(), position.getY(), position.getZ())) {
final Vec3d portal = new Vec3d(position.getX(), position.getY(), position.getZ());
this.portals.add(portal);
if (this.chat.getBoolean()) {
if (this.chat.getValue()) {
this.printPortalToChat(portal);
}
return;
@ -167,9 +171,9 @@ public final class PortalFinderModule extends Module {
}
break;
case UNLOAD:
if (this.remove.getBoolean()) {
if (this.remove.getValue()) {
for (Vec3d portal : this.portals) {
if (mc.player.getDistance(portal.x, portal.y, portal.z) > this.removeDistance.getInt()) {
if (mc.player.getDistance(portal.x, portal.y, portal.z) > this.removeDistance.getValue()) {
this.portals.remove(portal);
}
}

View File

@ -6,9 +6,7 @@ import me.rigamortis.seppuku.api.module.Module;
import me.rigamortis.seppuku.api.util.ColorUtil;
import me.rigamortis.seppuku.api.util.GLUProjection;
import me.rigamortis.seppuku.api.util.RenderUtil;
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.client.renderer.culling.Frustum;
import net.minecraft.client.renderer.culling.ICamera;
@ -24,22 +22,26 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
*/
public final class StorageESPModule extends Module {
public final OptionalValue mode = new OptionalValue("Mode", new String[]{"Mode", "M"}, 1, new String[]{"2D", "3D"});
public final BooleanValue name = new BooleanValue("Name", new String[]{"Nam", "N", "Names"}, true);
public final NumberValue opacity = new NumberValue("Opacity", new String[]{"Opacity", "Transparency", "Alpha"}, 128, Integer.class, 0, 255, 1);
//(String displayName, String[] alias, Object value, Object type, T min, T max, T increment
public final Value<Mode> mode = new Value<Mode>("Mode", new String[]{"Mode", "M"}, "Rendering mode", Mode.THREE_DIMENSIONAL);
private enum Mode {
TWO_DIMENSIONAL, THREE_DIMENSIONAL
}
public final Value<Boolean> name = new Value<Boolean>("Name", new String[]{"Nam", "N", "Names"}, "Renders the name of the drawn storage object.", false);
public final Value<Integer> opacity = new Value<Integer>("Opacity", new String[]{"Opacity", "Transparency", "Alpha"}, "Opacity of the rendered esp.", 128, 0, 255, 1);
private ICamera camera = new Frustum();
public StorageESPModule() {
super("Storage", new String[]{"StorageESP", "ChestFinder", "ChestESP"}, "Highlights different types of storage entities", "NONE", -1, ModuleType.RENDER);
super("Storage", new String[]{"StorageESP", "ChestFinder", "ChestESP"}, "Highlights different types of storage entities.", "NONE", -1, ModuleType.RENDER);
}
@Listener
public void render2D(EventRender2D event) {
final Minecraft mc = Minecraft.getMinecraft();
if (this.mode.getInt() == 1 && !this.name.getBoolean()) // if 3D and names are off, return
if (this.mode.getValue() == Mode.THREE_DIMENSIONAL && !this.name.getValue()) // if 3D and names are off, return
return;
for (TileEntity te : mc.world.loadedTileEntityList) {
@ -49,15 +51,15 @@ public final class StorageESPModule extends Module {
if (bb != null) {
final float[] bounds = this.convertBounds(bb, event.getScaledResolution().getScaledWidth(), event.getScaledResolution().getScaledHeight());
if (bounds != null) {
if (this.mode.getInt() == 0) { // 2D
RenderUtil.drawOutlineRect(bounds[0], bounds[1], bounds[2], bounds[3], 1.5f, ColorUtil.changeAlpha(0xAA000000, opacity.getInt()));
RenderUtil.drawOutlineRect(bounds[0] - 0.5f, bounds[1] - 0.5f, bounds[2] + 0.5f, bounds[3] + 0.5f, 0.5f, ColorUtil.changeAlpha(this.getColor(te), opacity.getInt()));
if (this.mode.getValue() == Mode.TWO_DIMENSIONAL) { // 2D
RenderUtil.drawOutlineRect(bounds[0], bounds[1], bounds[2], bounds[3], 1.5f, ColorUtil.changeAlpha(0xAA000000, this.opacity.getValue()));
RenderUtil.drawOutlineRect(bounds[0] - 0.5f, bounds[1] - 0.5f, bounds[2] + 0.5f, bounds[3] + 0.5f, 0.5f, ColorUtil.changeAlpha(this.getColor(te), this.opacity.getValue()));
}
if (this.name.getBoolean()) {
if (this.name.getValue()) {
final String name = te.getBlockType().getLocalizedName();
GL11.glEnable(GL11.GL_BLEND);
mc.fontRenderer.drawStringWithShadow(name, bounds[0] + (bounds[2] - bounds[0]) / 2 - mc.fontRenderer.getStringWidth(name) / 2, bounds[1] + (bounds[3] - bounds[1]) - mc.fontRenderer.FONT_HEIGHT - 1, ColorUtil.changeAlpha(0xFFFFFFFF, opacity.getInt()));
mc.fontRenderer.drawStringWithShadow(name, bounds[0] + (bounds[2] - bounds[0]) / 2 - mc.fontRenderer.getStringWidth(name) / 2, bounds[1] + (bounds[3] - bounds[1]) - mc.fontRenderer.FONT_HEIGHT - 1, ColorUtil.changeAlpha(0xFFFFFFFF, this.opacity.getValue()));
GL11.glDisable(GL11.GL_BLEND);
}
}
@ -70,7 +72,7 @@ public final class StorageESPModule extends Module {
@Listener
public void render3D(EventRender3D event) {
final Minecraft mc = Minecraft.getMinecraft();
if (this.mode.getInt() == 1) {
if (this.mode.getValue() == Mode.THREE_DIMENSIONAL) {
for (TileEntity te : mc.world.loadedTileEntityList) {
if (te != null) {
if (this.isTileStorage(te)) {
@ -84,8 +86,8 @@ public final class StorageESPModule extends Module {
bb.maxX + mc.getRenderManager().viewerPosX,
bb.maxY + mc.getRenderManager().viewerPosY,
bb.maxZ + mc.getRenderManager().viewerPosZ))) {
RenderUtil.drawFilledBox(bb, ColorUtil.changeAlpha(this.getColor(te), opacity.getInt()));
RenderUtil.drawBoundingBox(bb, 1.5f, ColorUtil.changeAlpha(this.getColor(te), opacity.getInt()));
RenderUtil.drawFilledBox(bb, ColorUtil.changeAlpha(this.getColor(te), this.opacity.getValue()));
RenderUtil.drawBoundingBox(bb, 1.5f, ColorUtil.changeAlpha(this.getColor(te), this.opacity.getValue()));
}
}
}

View File

@ -7,9 +7,7 @@ import me.rigamortis.seppuku.api.module.Module;
import me.rigamortis.seppuku.api.util.GLUProjection;
import me.rigamortis.seppuku.api.util.MathUtil;
import me.rigamortis.seppuku.api.util.RenderUtil;
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.entity.Entity;
import net.minecraft.entity.item.EntityBoat;
@ -28,15 +26,19 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
*/
public final class TracersModule 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 items = new BooleanValue("Items", new String[]{"Item"}, true);
public final Value<Boolean> players = new Value<Boolean>("Players", new String[]{"Player"}, "Choose to enable on players.", true);
public final Value<Boolean> mobs = new Value<Boolean>("Mobs", new String[]{"Mob"}, "Choose to enable on mobs.", true);
public final Value<Boolean> animals = new Value<Boolean>("Animals", new String[]{"Animal"}, "Choose to enable on animals.", true);
public final Value<Boolean> vehicles = new Value<Boolean>("Vehicles", new String[]{"Vehic", "Vehicle"}, "Choose to enable on vehicles.", true);
public final Value<Boolean> items = new Value<Boolean>("Items", new String[]{"Item"}, "Choose to enable on items.", true);
public final OptionalValue mode = new OptionalValue("Mode", new String[]{"Mode"}, 0, new String[]{"2D", "3D"});
public final Value<Mode> mode = new Value<Mode>("Mode", new String[]{"Mode"}, "The rendering mode to use for drawing the tracer-line.", Mode.TWO_DIMENSIONAL);
public final NumberValue width = new NumberValue("Width", new String[]{"Wid"}, 0.5f, Float.class, 0.0f, 5.0f, 0.1f);
private enum Mode {
TWO_DIMENSIONAL, THREE_DIMENSIONAL
}
public final Value<Float> width = new Value<Float>("Width", new String[]{"Wid"}, "Pixel width of each tracer-line.", 0.5f, 0.0f, 5.0f, 0.1f);
public TracersModule() {
super("Tracers", new String[]{"Trace", "Tracer", "Snapline", "Snaplines"}, "Draws a line to entities", "NONE", -1, ModuleType.RENDER);
@ -44,12 +46,12 @@ public final class TracersModule extends Module {
@Override
public String getMetaData() {
return this.mode.getSelectedOption();
return this.mode.getValue().name();
}
@Listener
public void render2D(EventRender2D event) {
if (this.mode.getInt() == 0) {
if (this.mode.getValue() == Mode.TWO_DIMENSIONAL) {
final Minecraft mc = Minecraft.getMinecraft();
for (Entity e : mc.world.loadedEntityList) {
@ -60,7 +62,7 @@ public final class TracersModule extends Module {
if (pos != null) {
final GLUProjection.Projection projection = GLUProjection.getInstance().project(pos.x - mc.getRenderManager().viewerPosX, pos.y - mc.getRenderManager().viewerPosY, pos.z - mc.getRenderManager().viewerPosZ, GLUProjection.ClampMode.NONE, true);
if (projection != null) {
RenderUtil.drawLine((float) projection.getX(), (float) projection.getY(), event.getScaledResolution().getScaledWidth() / 2, event.getScaledResolution().getScaledHeight() / 2, this.width.getFloat(), this.getColor(e));
RenderUtil.drawLine((float) projection.getX(), (float) projection.getY(), event.getScaledResolution().getScaledWidth() / 2, event.getScaledResolution().getScaledHeight() / 2, this.width.getValue(), this.getColor(e));
}
}
}
@ -71,7 +73,7 @@ public final class TracersModule extends Module {
@Listener
public void render3D(EventRender3D event) {
if (this.mode.getInt() == 1) {
if (this.mode.getValue() == Mode.THREE_DIMENSIONAL) {
final Minecraft mc = Minecraft.getMinecraft();
for (Entity e : mc.world.loadedEntityList) {
@ -84,7 +86,7 @@ public final class TracersModule extends Module {
mc.gameSettings.viewBobbing = false;
mc.entityRenderer.setupCameraTransform(event.getPartialTicks(), 0);
final Vec3d forward = new Vec3d(0, 0, 1).rotatePitch(-(float) Math.toRadians(Minecraft.getMinecraft().player.rotationPitch)).rotateYaw(-(float) Math.toRadians(Minecraft.getMinecraft().player.rotationYaw));
RenderUtil.drawLine3D((float) forward.x, (float) forward.y + mc.player.getEyeHeight(), (float) forward.z, (float) pos.x, (float) pos.y, (float) pos.z, this.width.getFloat(), this.getColor(e));
RenderUtil.drawLine3D((float) forward.x, (float) forward.y + mc.player.getEyeHeight(), (float) forward.z, (float) pos.x, (float) pos.y, (float) pos.z, this.width.getValue(), this.getColor(e));
mc.gameSettings.viewBobbing = bobbing;
mc.entityRenderer.setupCameraTransform(event.getPartialTicks(), 0);
}
@ -97,19 +99,23 @@ public final class TracersModule extends Module {
private boolean checkFilter(Entity entity) {
boolean ret = false;
if (this.players.getBoolean() && entity instanceof EntityPlayer && entity != Minecraft.getMinecraft().player) {
if (this.players.getValue() && entity instanceof EntityPlayer && entity != Minecraft.getMinecraft().player) {
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.items.getBoolean() && entity instanceof EntityItem) {
if (this.items.getValue() && entity instanceof EntityItem) {
ret = true;
}
@ -122,15 +128,19 @@ public final class TracersModule extends Module {
if (entity instanceof IAnimals && !(entity instanceof IMob)) {
ret = 0xFF00FF44;
}
if (entity instanceof IMob) {
ret = 0xFFFFAA00;
}
if (entity instanceof EntityBoat || entity instanceof EntityMinecart || entity instanceof EntityMinecartContainer) {
ret = 0xFF00FFAA;
}
if (entity instanceof EntityItem) {
ret = 0xFF00FFAA;
}
if (entity instanceof EntityPlayer) {
ret = 0xFFFF4444;
@ -138,6 +148,7 @@ public final class TracersModule extends Module {
ret = 0xFF9900EE;
}
}
return ret;
}

View File

@ -10,8 +10,7 @@ import me.rigamortis.seppuku.api.event.render.EventRenderName;
import me.rigamortis.seppuku.api.friend.Friend;
import me.rigamortis.seppuku.api.module.Module;
import me.rigamortis.seppuku.api.util.*;
import me.rigamortis.seppuku.api.value.old.BooleanValue;
import me.rigamortis.seppuku.api.value.old.OptionalValue;
import me.rigamortis.seppuku.api.value.Value;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
@ -52,28 +51,40 @@ import java.util.concurrent.CopyOnWriteArrayList;
*/
public final class WallHackModule extends Module {
public final OptionalValue mode = new OptionalValue("Mode", new String[]{"Mode", "M"}, 0, new String[]{"None", "Box"});
public final Value<Mode> mode = new Value<Mode>("Mode", new String[]{"Mode", "M"}, "The mode of the drawn esp/wallhack.", Mode.OPAQUE);
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 local = new BooleanValue("Local", new String[]{"Self"}, true);
public final BooleanValue items = new BooleanValue("Items", new String[]{"Item"}, true);
public final BooleanValue crystals = new BooleanValue("Crystals", new String[]{"crystal", "crystals", "endcrystal", "endcrystals"}, true);
public final BooleanValue footsteps = new BooleanValue("FootSteps", new String[]{"FootStep", "Steps"}, false);
public final BooleanValue armorStand = new BooleanValue("ArmorStands", new String[]{"ArmorStand", "ArmourStand", "ArmourStands", "ArmStand"}, true);
private enum Mode {
OPAQUE, BOX
}
public final BooleanValue name = new BooleanValue("Name", new String[]{"Nam"}, true);
public final BooleanValue ping = new BooleanValue("Ping", new String[]{"Ms"}, true);
public final BooleanValue armor = new BooleanValue("Armor", new String[]{"Arm"}, true);
public final BooleanValue hearts = new BooleanValue("Hearts", new String[]{"Hrts"}, true);
public final BooleanValue enchants = new BooleanValue("Enchants", new String[]{"Ench"}, true);
public final OptionalValue potions = new OptionalValue("Potions", new String[]{"Pot", "Pots", "PotsMode"}, 1, new String[]{"None", "Icons", "Text"});
public final Value<Boolean> players = new Value<Boolean>("Players", new String[]{"Player"}, "Choose to enable on players.", true);
public final Value<Boolean> mobs = new Value<Boolean>("Mobs", new String[]{"Mob"}, "Choose to enable on mobs.", true);
public final Value<Boolean> animals = new Value<Boolean>("Animals", new String[]{"Animal"}, "Choose to enable on animals.", true);
public final Value<Boolean> vehicles = new Value<Boolean>("Vehicles", new String[]{"Vehic", "Vehicle"}, "Choose to enable on vehicles.", true);
public final Value<Boolean> items = new Value<Boolean>("Items", new String[]{"Item"}, "Choose to enable on items.", true);
public final Value<Boolean> local = new Value<Boolean>("Local", new String[]{"Self"}, "Choose to enable on self/local-player.", true);
public final Value<Boolean> crystals = new Value<Boolean>("Crystals", new String[]{"crystal", "crystals", "endcrystal", "endcrystals"}, "Choose to enable on end crystals.", true);
public final Value<Boolean> armorStand = new Value<Boolean>("ArmorStands", new String[]{"ArmorStand", "ArmourStand", "ArmourStands", "ArmStand"}, "Choose to enable on armor-stands.", true);
public final Value<Boolean> footsteps = new Value<Boolean>("FootSteps", new String[]{"FootStep", "Steps"}, "Choose to draw entity footsteps.", false);
public final BooleanValue background = new BooleanValue("Background", new String[]{"Bg"}, true);
public final Value<Boolean> name = new Value<Boolean>("Name", new String[]{"Nam"}, "Draw the entity's name.", true);
public final Value<Boolean> ping = new Value<Boolean>("Ping", new String[]{"Ms"}, "Draw the entity's ping (only works on players).", true);
public final Value<Boolean> armor = new Value<Boolean>("Armor", new String[]{"Arm"}, "Draw the entity's equipped armor.", true);
public final Value<Boolean> hearts = new Value<Boolean>("Hearts", new String[]{"Hrts"}, "Draw the entity's hearts in decimal format.", true);
public final Value<Boolean> enchants = new Value<Boolean>("Enchants", new String[]{"Ench"}, "Draw enchant names above the entity's equipped armor. (requires Armor value to be enabled.", true);
public final Value<PotionsMode> potions = new Value<PotionsMode>("Potions", new String[]{"Pot", "Pots", "PotsMode"}, "Rendering mode for active potion-effects on the entity.", PotionsMode.NONE);
public final OptionalValue hpMode = new OptionalValue("Hp", new String[]{"Health", "HpMode"}, 0, new String[]{"None", "Bar", "BarText"});
private enum PotionsMode {
NONE, ICON, TEXT
}
public final Value<Boolean> background = new Value<Boolean>("Background", new String[]{"Bg"}, "Draw a transparent black background behind any text or icon drawn.", true);
public final Value<HealthMode> hpMode = new Value<HealthMode>("Hp", new String[]{"Health", "HpMode"}, "Rendering mode for the health bar.", HealthMode.NONE);
private enum HealthMode {
NONE, BAR, BARTEXT
}
private ICamera camera = new Frustum();
private final ResourceLocation inventory = new ResourceLocation("textures/gui/container/inventory.png");
@ -89,7 +100,7 @@ public final class WallHackModule extends Module {
public void render2D(EventRender2D event) {
final Minecraft mc = Minecraft.getMinecraft();
if (this.footsteps.getBoolean()) {
if (this.footsteps.getValue()) {
for (FootstepData data : this.footstepDataList) {
final GLUProjection.Projection projection = GLUProjection.getInstance().project(data.x - mc.getRenderManager().viewerPosX, data.y - mc.getRenderManager().viewerPosY, data.z - mc.getRenderManager().viewerPosZ, GLUProjection.ClampMode.NONE, false);
if (projection != null && projection.getType() == GLUProjection.Projection.Type.INSIDE) {
@ -108,7 +119,7 @@ public final class WallHackModule extends Module {
final float[] bounds = this.convertBounds(e, event.getPartialTicks(), event.getScaledResolution().getScaledWidth(), event.getScaledResolution().getScaledHeight());
if (bounds != null) {
if (this.mode.getInt() == 1) {
if (this.mode.getValue() == Mode.BOX) {
RenderUtil.drawOutlineRect(bounds[0], bounds[1], bounds[2], bounds[3], 1.5f, 0xAA000000);
RenderUtil.drawOutlineRect(bounds[0] - 0.5f, bounds[1] - 0.5f, bounds[2] + 0.5f, bounds[3] + 0.5f, 0.5f, this.getColor(e));
}
@ -117,7 +128,7 @@ public final class WallHackModule extends Module {
String heartsFormatted = null;
String pingFormatted = null;
if (this.name.getBoolean()) {
if (this.name.getValue()) {
int color = -1;
final Friend friend = Seppuku.INSTANCE.getFriendManager().isFriend(e);
@ -127,7 +138,7 @@ public final class WallHackModule extends Module {
color = 0xFF9900EE;
}
if (this.background.getBoolean()) {
if (this.background.getValue()) {
RenderUtil.drawRect(bounds[0] + (bounds[2] - bounds[0]) / 2 - mc.fontRenderer.getStringWidth(name) / 2 - 1, bounds[1] + (bounds[3] - bounds[1]) - mc.fontRenderer.FONT_HEIGHT - 2, bounds[0] + (bounds[2] - bounds[0]) / 2 + mc.fontRenderer.getStringWidth(name) / 2 + 1, bounds[1] + (bounds[3] - bounds[1]) - 1, 0x75101010);
}
@ -136,7 +147,7 @@ public final class WallHackModule extends Module {
if (e instanceof EntityPlayer) {
final EntityPlayer player = (EntityPlayer) e;
if (this.ping.getBoolean()) {
if (this.ping.getValue()) {
int responseTime = -1;
try {
responseTime = (int) MathUtil.clamp(mc.getConnection().getPlayerInfo(player.getUniqueID()).getResponseTime(), 0, 300);
@ -145,15 +156,15 @@ public final class WallHackModule extends Module {
pingFormatted = responseTime + "ms";
float startX = -mc.fontRenderer.getStringWidth(pingFormatted) / 2.0f;
if (this.name.getBoolean())
if (this.name.getValue())
startX = (mc.fontRenderer.getStringWidth(name) / 2.0f) + 2.0f;
else if (this.hearts.getBoolean())
else if (this.hearts.getValue())
startX = (mc.fontRenderer.getStringWidth(heartsFormatted) / 2.0f) + (mc.fontRenderer.getStringWidth(heartsFormatted) / 2.0f);
int pingRounded = Math.round(255.0f - (responseTime * 255.0f / 300.0f)); // 300 = max response time (red, laggy)
int pingColor = 255 - pingRounded << 16 | pingRounded << 8;
if (this.background.getBoolean()) {
if (this.background.getValue()) {
RenderUtil.drawRect(bounds[0] + (bounds[2] - bounds[0]) / 2 + startX, bounds[1] + (bounds[3] - bounds[1]) - mc.fontRenderer.FONT_HEIGHT - 2, bounds[0] + (bounds[2] - bounds[0]) / 2 + startX + mc.fontRenderer.getStringWidth(pingFormatted), bounds[1] + (bounds[3] - bounds[1]) - 1, 0x75101010);
}
@ -164,7 +175,7 @@ public final class WallHackModule extends Module {
if (e instanceof EntityLivingBase) {
final EntityLivingBase entityLiving = (EntityLivingBase) e;
if (this.hearts.getBoolean()) {
if (this.hearts.getValue()) {
final float hearts = entityLiving.getHealth() / 2.0f;
if (hearts <= 0)
@ -178,28 +189,28 @@ public final class WallHackModule extends Module {
}
float startX = -mc.fontRenderer.getStringWidth(heartsFormatted) / 2.0f;
if (this.name.getBoolean())
if (this.name.getValue())
startX = -(mc.fontRenderer.getStringWidth(name) / 2.0f) - 2.0f - mc.fontRenderer.getStringWidth(heartsFormatted);
else if (this.ping.getBoolean() && entityLiving instanceof EntityPlayer)
else if (this.ping.getValue() && entityLiving instanceof EntityPlayer)
startX = -(mc.fontRenderer.getStringWidth(pingFormatted) / 2.0f) - (mc.fontRenderer.getStringWidth(heartsFormatted) / 2.0f);
int heartsRounded = Math.round(255.0f - (hearts * 255.0f / (entityLiving.getMaxHealth() / 2)));
int heartsColor = 255 - heartsRounded << 8 | heartsRounded << 16;
if (this.background.getBoolean()) {
if (this.background.getValue()) {
RenderUtil.drawRect(bounds[0] + (bounds[2] - bounds[0]) / 2 + startX, bounds[1] + (bounds[3] - bounds[1]) - mc.fontRenderer.FONT_HEIGHT - 2, bounds[0] + (bounds[2] - bounds[0]) / 2 + startX + mc.fontRenderer.getStringWidth(heartsFormatted), bounds[1] + (bounds[3] - bounds[1]) - 1, 0x75101010);
}
mc.fontRenderer.drawStringWithShadow(heartsFormatted, bounds[0] + (bounds[2] - bounds[0]) / 2 + startX, bounds[1] + (bounds[3] - bounds[1]) - mc.fontRenderer.FONT_HEIGHT - 1, heartsColor);
}
if (this.hpMode.getInt() != 0) {
if (this.hpMode.getValue() != HealthMode.NONE) {
RenderUtil.drawRect(bounds[2] - 0.5f, bounds[1], bounds[2] - 2, bounds[3], 0xAA000000);
final float hpHeight = ((((EntityLivingBase) e).getHealth() * (bounds[3] - bounds[1])) / ((EntityLivingBase) e).getMaxHealth());
RenderUtil.drawRect(bounds[2] - 1, bounds[1] - 0.5f, bounds[2] - 1.5f, (bounds[1] - bounds[3]) + bounds[3] + hpHeight + 0.5f, getHealthColor(e));
if (this.hpMode.getInt() == 2) {
if (this.hpMode.getValue() == HealthMode.BARTEXT) {
if (((EntityLivingBase) e).getHealth() < ((EntityLivingBase) e).getMaxHealth() && ((EntityLivingBase) e).getHealth() > 0) {
final String hp = new DecimalFormat("#.#").format((int) ((EntityLivingBase) e).getHealth());
mc.fontRenderer.drawStringWithShadow(hp, (bounds[2] - 1 - mc.fontRenderer.getStringWidth(hp) / 2), ((bounds[1] - bounds[3]) + bounds[3] + hpHeight + 0.5f - mc.fontRenderer.FONT_HEIGHT / 2), -1);
@ -207,7 +218,7 @@ public final class WallHackModule extends Module {
}
}
if (this.potions.getInt() != 0) {
if (this.potions.getValue() != PotionsMode.NONE) {
float scale = 0.5f;
int offsetX = 0;
int offsetY = 0;
@ -216,7 +227,7 @@ public final class WallHackModule extends Module {
if (effect.getDuration() <= 0)
continue;
final Potion potion = effect.getPotion();
if (this.potions.getInt() == 1) {
if (this.potions.getValue() == PotionsMode.ICON) {
if (potion.hasStatusIcon()) {
GlStateManager.pushMatrix();
mc.getTextureManager().bindTexture(this.inventory);// bind the inventory texture
@ -232,7 +243,7 @@ public final class WallHackModule extends Module {
}
// check to draw the transparent background behind the icon
if (this.background.getBoolean()) {
if (this.background.getValue()) {
RenderUtil.drawRect(offsetX, offsetY, offsetX + 16, offsetY + 16, 0x75101010);
}
@ -242,7 +253,7 @@ public final class WallHackModule extends Module {
offsetY += 16;
}
} else if (this.potions.getInt() == 2) {
} else if (this.potions.getValue() == PotionsMode.TEXT) {
final List<String> potStringsToDraw = Lists.newArrayList();
final String effectString = PotionUtil.getNameDurationString(effect);
@ -261,9 +272,11 @@ public final class WallHackModule extends Module {
offsetY = 0;
offsetX += 16;
}
if (this.background.getBoolean()) {
if (this.background.getValue()) {
RenderUtil.drawRect(0, 0, mc.fontRenderer.getStringWidth(pString), mc.fontRenderer.FONT_HEIGHT - 1, 0x75101010);
}
mc.fontRenderer.drawStringWithShadow(pString, 0, 0, -1);
GlStateManager.scale(2, 2, 2);
@ -277,7 +290,7 @@ public final class WallHackModule extends Module {
}
}
if (this.armor.getBoolean()) {
if (this.armor.getValue()) {
final Iterator<ItemStack> items = e.getEquipmentAndArmor().iterator();
final ArrayList<ItemStack> stacks = new ArrayList<>();
@ -301,7 +314,7 @@ public final class WallHackModule extends Module {
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
RenderHelper.enableGUIStandardItemLighting();
GlStateManager.translate(bounds[0] + (bounds[2] - bounds[0]) / 2 + x - (16 * stacks.size() / 2), bounds[1] + (bounds[3] - bounds[1]) - mc.fontRenderer.FONT_HEIGHT - 19, 0);
if (this.background.getBoolean()) {
if (this.background.getValue()) {
RenderUtil.drawRect(0, 0, 16, 16, 0x75101010);
}
mc.getRenderItem().renderItemAndEffectIntoGUI(stack, 0, 0);
@ -312,7 +325,7 @@ public final class WallHackModule extends Module {
GlStateManager.popMatrix();
x += 16;
if (this.enchants.getBoolean()) {
if (this.enchants.getValue()) {
final List<String> stringsToDraw = Lists.newArrayList();
int y = 0;
@ -350,7 +363,7 @@ public final class WallHackModule extends Module {
GlStateManager.disableDepth();
GlStateManager.translate(bounds[0] + (bounds[2] - bounds[0]) / 2 + x - ((16.0f * stacks.size()) / 2.0f) - (16.0f / 2.0f) - (mc.fontRenderer.getStringWidth(string) / 4.0f), bounds[1] + (bounds[3] - bounds[1]) - mc.fontRenderer.FONT_HEIGHT - 23 - y, 0);
GlStateManager.scale(0.5f, 0.5f, 0.5f);
if (this.background.getBoolean()) {
if (this.background.getValue()) {
RenderUtil.drawRect(0, 0, mc.fontRenderer.getStringWidth(string), mc.fontRenderer.FONT_HEIGHT - 1, 0x75101010);
}
mc.fontRenderer.drawStringWithShadow(string, 0, 0, -1);
@ -426,28 +439,28 @@ public final class WallHackModule extends Module {
private boolean checkFilter(Entity entity) {
boolean ret = false;
if (this.local.getBoolean() && (entity == Minecraft.getMinecraft().player) && (Minecraft.getMinecraft().gameSettings.thirdPersonView != 0)) {
if (this.local.getValue() && (entity == Minecraft.getMinecraft().player) && (Minecraft.getMinecraft().gameSettings.thirdPersonView != 0)) {
ret = true;
}
if (this.players.getBoolean() && entity instanceof EntityPlayer && entity != Minecraft.getMinecraft().player) {
if (this.players.getValue() && entity instanceof EntityPlayer && entity != Minecraft.getMinecraft().player) {
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.items.getBoolean() && entity instanceof EntityItem) {
if (this.items.getValue() && entity instanceof EntityItem) {
ret = true;
}
if (this.crystals.getBoolean() && entity instanceof EntityEnderCrystal) {
if (this.crystals.getValue() && entity instanceof EntityEnderCrystal) {
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.armorStand.getBoolean() && entity instanceof EntityArmorStand) {
if (this.armorStand.getValue() && entity instanceof EntityArmorStand) {
ret = true;
}
if (Minecraft.getMinecraft().player.getRidingEntity() != null && entity == Minecraft.getMinecraft().player.getRidingEntity()) {