diff --git a/src/main/java/me/rigamortis/seppuku/impl/gui/hud/component/EnabledModsComponent.java b/src/main/java/me/rigamortis/seppuku/impl/gui/hud/component/EnabledModsComponent.java index 6f55435..3546096 100644 --- a/src/main/java/me/rigamortis/seppuku/impl/gui/hud/component/EnabledModsComponent.java +++ b/src/main/java/me/rigamortis/seppuku/impl/gui/hud/component/EnabledModsComponent.java @@ -113,36 +113,36 @@ public final class EnabledModsComponent extends DraggableHudComponent { } if (this.getAnchorPoint() != null) { - switch (this.getAnchorPoint().getPoint()) { - case TOP_CENTER: - case BOTTOM_CENTER: - xOffset = (this.getW() - mc.fontRenderer.getStringWidth(name)) / 2; - break; - case TOP_LEFT: - case BOTTOM_LEFT: - xOffset = 0; - break; - case TOP_RIGHT: - case BOTTOM_RIGHT: - xOffset = this.getW() - mc.fontRenderer.getStringWidth(name); - break; - } - } + if (this.getAnchorPoint().getPoint() != null) { + switch (this.getAnchorPoint().getPoint()) { + case TOP_CENTER: + case BOTTOM_CENTER: + xOffset = (this.getW() - mc.fontRenderer.getStringWidth(name)) / 2; + break; + case TOP_LEFT: + case BOTTOM_LEFT: + xOffset = 0; + break; + case TOP_RIGHT: + case BOTTOM_RIGHT: + xOffset = this.getW() - mc.fontRenderer.getStringWidth(name); + break; + } - if (this.getAnchorPoint() != null) { - switch (this.getAnchorPoint().getPoint()) { - case TOP_CENTER: - case TOP_LEFT: - case TOP_RIGHT: - mc.fontRenderer.drawStringWithShadow(name, this.getX() + xOffset, this.getY() + yOffset, color); - yOffset += (mc.fontRenderer.FONT_HEIGHT + 1); - break; - case BOTTOM_CENTER: - case BOTTOM_LEFT: - case BOTTOM_RIGHT: - mc.fontRenderer.drawStringWithShadow(name, this.getX() + xOffset, this.getY() + (this.getH() - mc.fontRenderer.FONT_HEIGHT) + yOffset, color); - yOffset -= (mc.fontRenderer.FONT_HEIGHT + 1); - break; + switch (this.getAnchorPoint().getPoint()) { + case TOP_CENTER: + case TOP_LEFT: + case TOP_RIGHT: + mc.fontRenderer.drawStringWithShadow(name, this.getX() + xOffset, this.getY() + yOffset, color); + yOffset += (mc.fontRenderer.FONT_HEIGHT + 1); + break; + case BOTTOM_CENTER: + case BOTTOM_LEFT: + case BOTTOM_RIGHT: + mc.fontRenderer.drawStringWithShadow(name, this.getX() + xOffset, this.getY() + (this.getH() - mc.fontRenderer.FONT_HEIGHT) + yOffset, color); + yOffset -= (mc.fontRenderer.FONT_HEIGHT + 1); + break; + } } } else { mc.fontRenderer.drawStringWithShadow(name, this.getX() + xOffset, this.getY() + yOffset, color); diff --git a/src/main/java/me/rigamortis/seppuku/impl/gui/hud/component/EntityListComponent.java b/src/main/java/me/rigamortis/seppuku/impl/gui/hud/component/EntityListComponent.java index c308382..d472d20 100644 --- a/src/main/java/me/rigamortis/seppuku/impl/gui/hud/component/EntityListComponent.java +++ b/src/main/java/me/rigamortis/seppuku/impl/gui/hud/component/EntityListComponent.java @@ -75,11 +75,15 @@ public final class EntityListComponent extends DraggableHudComponent { } } + if (this.getAnchorPoint() == null) { + this.components.add(new TextLineEntity(null, ChatFormatting.GRAY + "(text radar)")); + } + if (entityGroups.size() > 0) { for (EntityGroup entityGroup : entityGroups) { String line = entityGroup.getEntityName(); if (entityGroup.getCount() > 1) { - line = String.format("%s (%s)", entityGroup.getEntityName(), entityGroup.getCount()); + line = String.format("%s [%s]", entityGroup.getEntityName(), entityGroup.getCount()); } this.components.add(new TextLineEntity(entityGroup.getEntity(), line)); } @@ -202,26 +206,27 @@ public final class EntityListComponent extends DraggableHudComponent { } return ChatFormatting.RED + entity.getName() + ChatFormatting.RESET + " (" + (int) mc.player.getDistance(entity) + "m)"; } else if (entity instanceof EntityLiving) { - return EntityList.getEntityString(entity); + final EntityLiving entityLiving = (EntityLiving) entity; + return EntityList.getEntityString(entity) + " (" + ChatFormatting.GREEN + (int) entityLiving.getHealth() + ChatFormatting.RESET + ")"; } else if (entity instanceof EntityItem) { EntityItem item = (EntityItem) entity; ItemStack stack = item.getItem(); int stackSize = stack.getCount(); boolean moreThanZero = stackSize > 1; if (stack.isItemEnchanted()) { - name = ChatFormatting.AQUA + stack.getDisplayName() + ChatFormatting.RESET + (moreThanZero ? " (" + ChatFormatting.YELLOW + stackSize + ChatFormatting.RESET + ")" : ""); + name = ChatFormatting.AQUA + stack.getDisplayName() + (moreThanZero ? " (" + ChatFormatting.YELLOW + "x" + stackSize + ChatFormatting.AQUA + ")" : ""); } else { - name = stack.getDisplayName() + (moreThanZero ? " (" + ChatFormatting.YELLOW + stackSize + ChatFormatting.RESET + ")" : ""); + name = ChatFormatting.GRAY + stack.getDisplayName() + (moreThanZero ? " (" + ChatFormatting.YELLOW + "x" + stackSize + ChatFormatting.GRAY + ")" : ""); } } else if (entity instanceof EntityThrowable) { EntityThrowable throwable = (EntityThrowable) entity; if (throwable instanceof EntityEnderPearl) { - name = "Ender Pearl"; + name = ChatFormatting.DARK_AQUA + "Ender Pearl"; } else { name = throwable.getName(); } } else if (entity instanceof EntityEnderCrystal) { - name = "Ender Crystal"; + name = ChatFormatting.LIGHT_PURPLE + "Ender Crystal"; } return name; } @@ -320,7 +325,7 @@ public final class EntityListComponent extends DraggableHudComponent { final String info = String.format("\n%s\n- Key: %s\n- Enchantments: %s\n- Durability: %s", ChatFormatting.AQUA + itemStack.getDisplayName() + ChatFormatting.RESET, itemStack.getTranslationKey(), enchantStringBuilder.toString(), itemStack.getMaxDamage() - itemStack.getItemDamage()); Seppuku.INSTANCE.logChat(info); } else { - final String info = String.format("\n%s\n- Key: %s\n- Count: %s\n- Metadata: %s\n- Damage: %s\n- Max Damage: %s\n- Durability: %s", itemStack.getDisplayName(), itemStack.getTranslationKey(), itemStack.getCount(), itemStack.getMetadata(), itemStack.getItemDamage(), itemStack.getMaxDamage(), itemStack.getMaxDamage() - itemStack.getItemDamage()); + final String info = String.format("\n%s\n- Key: %s\n- Count: %s\n- Metadata: %s\n- Damage: %s\n- Max Damage: %s\n- Durability: %s", ChatFormatting.GRAY + itemStack.getDisplayName(), itemStack.getTranslationKey(), itemStack.getCount(), itemStack.getMetadata(), itemStack.getItemDamage(), itemStack.getMaxDamage(), itemStack.getMaxDamage() - itemStack.getItemDamage()); Seppuku.INSTANCE.logChat(info); NBTTagCompound tagCompound = itemStack.getTagCompound(); if (tagCompound != null && !tagCompound.isEmpty()) { diff --git a/src/main/java/me/rigamortis/seppuku/impl/gui/hud/component/HubComponent.java b/src/main/java/me/rigamortis/seppuku/impl/gui/hud/component/HubComponent.java index aaa6028..8d9c2d1 100644 --- a/src/main/java/me/rigamortis/seppuku/impl/gui/hud/component/HubComponent.java +++ b/src/main/java/me/rigamortis/seppuku/impl/gui/hud/component/HubComponent.java @@ -109,8 +109,8 @@ public final class HubComponent extends ResizableHudComponent { RenderUtil.drawRect(this.getX() + this.getW() - SCROLL_WIDTH, MathHelper.clamp((this.getY() + offsetY + BORDER) + ((this.getH() * this.scroll) / this.totalHeight), (this.getY() + offsetY + BORDER), (this.getY() + this.getH() - BORDER)), this.getX() + this.getW() - BORDER, MathHelper.clamp((this.getY() + this.getH() - BORDER) - (this.getH() * (this.totalHeight - this.getH() - this.scroll) / this.totalHeight), (this.getY() + offsetY + BORDER), (this.getY() + this.getH() - BORDER)), ColorUtil.changeAlpha(0xFF909090, mouseInside ? 0xFF : 0x99)); // Begin scissoring and render the component "buttons" - RenderUtil.glScissor(this.getX() + BORDER, this.getY() + offsetY + BORDER, this.getX() + this.getW() - BORDER - SCROLL_WIDTH, this.getY() + this.getH() - BORDER, sr); GL11.glEnable(GL11.GL_SCISSOR_TEST); + RenderUtil.glScissor(this.getX() + BORDER, this.getY() + offsetY + BORDER, this.getX() + this.getW() - BORDER - SCROLL_WIDTH, this.getY() + this.getH() - BORDER, sr); for (HudComponent component : Seppuku.INSTANCE.getHudManager().getComponentList()) { if (component != this) { RenderUtil.drawRect(this.getX() + BORDER + TEXT_GAP, this.getY() + offsetY + BORDER + TEXT_GAP - this.scroll, this.getX() + BORDER + TEXT_GAP + this.getW() - BORDER - SCROLL_WIDTH - BORDER - 2, this.getY() + offsetY + BORDER + TEXT_GAP + mc.fontRenderer.FONT_HEIGHT - this.scroll, component.isVisible() ? 0x45002e00 : 0x452e0000); diff --git a/src/main/java/me/rigamortis/seppuku/impl/gui/hud/component/module/ModuleListComponent.java b/src/main/java/me/rigamortis/seppuku/impl/gui/hud/component/module/ModuleListComponent.java index b058a81..539390c 100644 --- a/src/main/java/me/rigamortis/seppuku/impl/gui/hud/component/module/ModuleListComponent.java +++ b/src/main/java/me/rigamortis/seppuku/impl/gui/hud/component/module/ModuleListComponent.java @@ -103,6 +103,7 @@ public final class ModuleListComponent extends ResizableHudComponent { } // Background & title + //RenderUtil.begin2D(); RenderUtil.drawRect(this.getX() - 1, this.getY() - 1, this.getX() + this.getW() + 1, this.getY() + this.getH() + 1, 0x99101010); RenderUtil.drawRect(this.getX(), this.getY(), this.getX() + this.getW(), this.getY() + this.getH(), ColorUtil.changeAlpha(0xFF202020, mouseInside ? 0xFF : 0x99)); GlStateManager.enableBlend(); @@ -134,8 +135,8 @@ public final class ModuleListComponent extends ResizableHudComponent { RenderUtil.drawRect(this.getX() + this.getW() - SCROLL_WIDTH, MathHelper.clamp((this.getY() + offsetY + BORDER) + ((this.getH() * this.scroll) / this.totalHeight), (this.getY() + offsetY + BORDER), (this.getY() + this.getH() - BORDER)), this.getX() + this.getW() - BORDER, MathHelper.clamp((this.getY() + this.getH() - BORDER) - (this.getH() * (this.totalHeight - this.getH() - this.scroll) / this.totalHeight), (this.getY() + offsetY + BORDER), (this.getY() + this.getH() - BORDER)), ColorUtil.changeAlpha(0xFF909090, mouseInside ? 0xFF : 0x99)); // Begin scissoring and render the module "buttons" - RenderUtil.glScissor(this.getX() + BORDER, this.getY() + offsetY + BORDER, this.getX() + this.getW() - BORDER - SCROLL_WIDTH, this.getY() + this.getH() - BORDER, sr); GL11.glEnable(GL11.GL_SCISSOR_TEST); + RenderUtil.glScissor(this.getX() + BORDER, this.getY() + offsetY + BORDER, this.getX() + this.getW() - BORDER - SCROLL_WIDTH, this.getY() + this.getH() - BORDER, sr); if (this.currentSettings != null) { this.title = this.currentSettings.module.getDisplayName(); this.currentSettings.setX(this.getX() + BORDER); @@ -152,6 +153,11 @@ public final class ModuleListComponent extends ResizableHudComponent { this.title = this.originalName; for (Module module : Seppuku.INSTANCE.getModuleManager().getModuleList(this.type)) { RenderUtil.drawRect(this.getX() + BORDER + TEXT_GAP, this.getY() + offsetY + BORDER + TEXT_GAP - this.scroll, this.getX() + BORDER + TEXT_GAP + this.getW() - BORDER - SCROLL_WIDTH - BORDER - 2, this.getY() + offsetY + BORDER + TEXT_GAP + mc.fontRenderer.FONT_HEIGHT - this.scroll, module.isEnabled() ? 0x451b002a : 0x451F1C22); + + if (module.getValueList().size() != 0) { + RenderUtil.drawLine(this.getX() + BORDER + TEXT_GAP + this.getW() - BORDER - SCROLL_WIDTH - BORDER - 4, this.getY() + offsetY + BORDER + TEXT_GAP - this.scroll + 1, this.getX() + BORDER + TEXT_GAP + this.getW() - BORDER - SCROLL_WIDTH - BORDER - 4, this.getY() + offsetY + BORDER + TEXT_GAP + mc.fontRenderer.FONT_HEIGHT - this.scroll - 1, 1f,0x45909090); + } + final boolean insideModule = mouseX >= (this.getX() + BORDER) && mouseX <= (this.getX() + this.getW() - BORDER - SCROLL_WIDTH) && mouseY >= (this.getY() + BORDER + mc.fontRenderer.FONT_HEIGHT + 1 + offsetY - this.scroll - mc.fontRenderer.FONT_HEIGHT + 1) && mouseY <= (this.getY() + BORDER + (mc.fontRenderer.FONT_HEIGHT) + 1 + offsetY - this.scroll); if (insideModule) { RenderUtil.drawGradientRect(this.getX() + BORDER + TEXT_GAP, this.getY() + offsetY + BORDER + TEXT_GAP - this.scroll, this.getX() + BORDER + TEXT_GAP + this.getW() - BORDER - SCROLL_WIDTH - BORDER - 2, this.getY() + offsetY + BORDER + TEXT_GAP + mc.fontRenderer.FONT_HEIGHT - this.scroll, 0x30909090, 0x00101010); @@ -202,6 +208,7 @@ public final class ModuleListComponent extends ResizableHudComponent { } } } + //RenderUtil.end2D(); // figures up a "total height (pixels)" of the inside of the list area (for calculating scroll height) this.totalHeight = BORDER + TEXT_GAP + offsetY + BORDER; diff --git a/src/main/java/me/rigamortis/seppuku/impl/module/render/WallHackModule.java b/src/main/java/me/rigamortis/seppuku/impl/module/render/WallHackModule.java index 19fd64e..c29ef29 100644 --- a/src/main/java/me/rigamortis/seppuku/impl/module/render/WallHackModule.java +++ b/src/main/java/me/rigamortis/seppuku/impl/module/render/WallHackModule.java @@ -1,12 +1,14 @@ package me.rigamortis.seppuku.impl.module.render; import com.google.common.collect.Lists; +import com.google.common.collect.Maps; import com.mojang.realmsclient.gui.ChatFormatting; import me.rigamortis.seppuku.Seppuku; import me.rigamortis.seppuku.api.event.EventStageable; import me.rigamortis.seppuku.api.event.network.EventReceivePacket; import me.rigamortis.seppuku.api.event.render.EventRender2D; import me.rigamortis.seppuku.api.event.render.EventRenderName; +import me.rigamortis.seppuku.api.event.world.EventAddEntity; import me.rigamortis.seppuku.api.friend.Friend; import me.rigamortis.seppuku.api.module.Module; import me.rigamortis.seppuku.api.util.*; @@ -21,6 +23,9 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.*; import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.passive.AbstractHorse; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.passive.EntityTameable; import net.minecraft.entity.passive.IAnimals; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; @@ -39,10 +44,7 @@ import net.minecraft.util.math.Vec3d; import team.stiff.pomelo.impl.annotated.handler.annotation.Listener; import java.text.DecimalFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; +import java.util.*; import java.util.concurrent.CopyOnWriteArrayList; /** @@ -67,6 +69,7 @@ public final class WallHackModule extends Module { public final Value pearls = new Value("Pearls", new String[]{"Pearl"}, "Choose to enable on ender pearls.", true); public final Value armorStand = new Value("ArmorStands", new String[]{"ArmorStand", "ArmourStand", "ArmourStands", "ArmStand"}, "Choose to enable on armor-stands.", true); public final Value footsteps = new Value("FootSteps", new String[]{"FootStep", "Steps"}, "Choose to draw entity footsteps.", false); + public final Value owner = new Value("Owner", new String[]{"Owners", "MobOwner"}, "Choose to draw entity (tame-able or horse) owner name.", false); public final Value nametag = new Value("Nametag", new String[]{"tag", "tags", "names", "name"}, "Draw the entity's name tag.", true); public final Value ping = new Value("Ping", new String[]{"Ms"}, "Draw the entity's ping (only works on players).", true); @@ -87,11 +90,11 @@ public final class WallHackModule extends Module { NONE, BAR, BARTEXT } - private ICamera camera = new Frustum(); + private final ICamera camera = new Frustum(); private final ResourceLocation inventory = new ResourceLocation("textures/gui/container/inventory.png"); //i cba - private List footstepDataList = new CopyOnWriteArrayList<>(); + private final List footstepDataList = new CopyOnWriteArrayList<>(); public WallHackModule() { super("WallHack", new String[]{"ESP"}, "Highlights entities", "NONE", -1, ModuleType.RENDER); @@ -104,8 +107,8 @@ public final class WallHackModule extends Module { 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) { - mc.fontRenderer.drawStringWithShadow("*step*", (float) projection.getX() - mc.fontRenderer.getStringWidth("*step*") / 2, (float) projection.getY(), -1); + if (projection.getType() == GLUProjection.Projection.Type.INSIDE) { + mc.fontRenderer.drawStringWithShadow("*step*", (float) projection.getX() - mc.fontRenderer.getStringWidth("*step*") / 2.0f, (float) projection.getY(), -1); } if (Math.abs(System.currentTimeMillis() - data.getTime()) >= 3000) { @@ -126,8 +129,8 @@ public final class WallHackModule extends Module { } String name = StringUtils.stripControlCodes(getNameForEntity(e)); - String heartsFormatted = null; - String pingFormatted = null; + String heartsFormatted = ""; + String pingFormatted = ""; if (this.nametag.getValue()) { int color = -1; @@ -140,10 +143,10 @@ public final class WallHackModule extends Module { } 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); + RenderUtil.drawRect(bounds[0] + (bounds[2] - bounds[0]) / 2 - mc.fontRenderer.getStringWidth(name) / 2.0f - 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); } - 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, color); + mc.fontRenderer.drawStringWithShadow(name, bounds[0] + (bounds[2] - bounds[0]) / 2 - mc.fontRenderer.getStringWidth(name) / 2.0f, bounds[1] + (bounds[3] - bounds[1]) - mc.fontRenderer.FONT_HEIGHT - 1, color); } if (e instanceof EntityPlayer) { @@ -152,7 +155,7 @@ public final class WallHackModule extends Module { int responseTime = -1; try { responseTime = (int) MathUtil.clamp(mc.player.connection.getPlayerInfo(player.getUniqueID()).getResponseTime(), 0, 300); - } catch (NullPointerException np) { + } catch (NullPointerException ignored) { } pingFormatted = responseTime + "ms"; @@ -205,6 +208,38 @@ public final class WallHackModule extends Module { 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 (e instanceof EntityTameable || e instanceof AbstractHorse) { + if (this.owner.getValue()) { + String ownerName = ""; + + if (e instanceof EntityTameable) { + final EntityTameable tameable = (EntityTameable) e; + if (tameable.isTamed() && tameable.getOwnerId() != null) { + ownerName = tameable.getOwnerId().toString(); + } + } + + if (e instanceof AbstractHorse) { + final AbstractHorse horse = (AbstractHorse) e; + if (horse.isTame() && horse.getOwnerUniqueId() != null) { + ownerName = horse.getOwnerUniqueId().toString(); + } + } + + float startX = -mc.fontRenderer.getStringWidth(ownerName) / 2.0f; + if (this.nametag.getValue()) + startX = (mc.fontRenderer.getStringWidth(name) / 2.0f) + 2.0f; + else if (this.hearts.getValue()) + startX = (mc.fontRenderer.getStringWidth(heartsFormatted) / 2.0f) + 2.0f; + + 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(ownerName), bounds[1] + (bounds[3] - bounds[1]) - 1, 0x75101010); + } + + mc.fontRenderer.drawStringWithShadow(ownerName, bounds[0] + (bounds[2] - bounds[0]) / 2 + startX, bounds[1] + (bounds[3] - bounds[1]) - mc.fontRenderer.FONT_HEIGHT - 1, 0xFFAAAAAA); + } + } + 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()); @@ -214,7 +249,7 @@ public final class WallHackModule extends Module { 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); + mc.fontRenderer.drawStringWithShadow(hp, (bounds[2] - 1 - mc.fontRenderer.getStringWidth(hp) / 2.0f), ((bounds[1] - bounds[3]) + bounds[3] + hpHeight + 0.5f - mc.fontRenderer.FONT_HEIGHT / 2.0f), -1); } } } @@ -314,7 +349,7 @@ public final class WallHackModule extends Module { GlStateManager.enableBlend(); 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); + GlStateManager.translate(bounds[0] + (bounds[2] - bounds[0]) / 2 + x - (16 * stacks.size() / 2.0f), bounds[1] + (bounds[3] - bounds[1]) - mc.fontRenderer.FONT_HEIGHT - 19, 0); if (this.background.getValue()) { RenderUtil.drawRect(0, 0, 16, 16, 0x75101010); } @@ -330,24 +365,23 @@ public final class WallHackModule extends Module { final List stringsToDraw = Lists.newArrayList(); int y = 0; - if (stack.getEnchantmentTagList() != null) { - final NBTTagList tags = stack.getEnchantmentTagList(); - for (int i = 0; i < tags.tagCount(); i++) { - final NBTTagCompound tagCompound = tags.getCompoundTagAt(i); - if (tagCompound != null && Enchantment.getEnchantmentByID(tagCompound.getByte("id")) != null) { - final Enchantment enchantment = Enchantment.getEnchantmentByID(tagCompound.getShort("id")); - final short lvl = tagCompound.getShort("lvl"); - if (enchantment != null) { - String ench = ""; - if (enchantment.isCurse()) { - ench = ChatFormatting.RED + enchantment.getTranslatedName(lvl).substring(11).substring(0, 3) + ChatFormatting.GRAY + lvl; - } else if (ItemUtil.isIllegalEnchant(enchantment, lvl)) { - ench = ChatFormatting.AQUA + enchantment.getTranslatedName(lvl).substring(0, 3) + ChatFormatting.GRAY + lvl; - } else { - ench = enchantment.getTranslatedName(lvl).substring(0, 3) + ChatFormatting.GRAY + lvl; - } - stringsToDraw.add(ench); + stack.getEnchantmentTagList(); + final NBTTagList tags = stack.getEnchantmentTagList(); + for (int i = 0; i < tags.tagCount(); i++) { + final NBTTagCompound tagCompound = tags.getCompoundTagAt(i); + if (Enchantment.getEnchantmentByID(tagCompound.getByte("id")) != null) { + final Enchantment enchantment = Enchantment.getEnchantmentByID(tagCompound.getShort("id")); + final short lvl = tagCompound.getShort("lvl"); + if (enchantment != null) { + String ench = ""; + if (enchantment.isCurse()) { + ench = ChatFormatting.RED + enchantment.getTranslatedName(lvl).substring(11).substring(0, 3) + ChatFormatting.GRAY + lvl; + } else if (ItemUtil.isIllegalEnchant(enchantment, lvl)) { + ench = ChatFormatting.AQUA + enchantment.getTranslatedName(lvl).substring(0, 3) + ChatFormatting.GRAY + lvl; + } else { + ench = enchantment.getTranslatedName(lvl).substring(0, 3) + ChatFormatting.GRAY + lvl; } + stringsToDraw.add(ench); } } } @@ -464,7 +498,7 @@ public final class WallHackModule extends Module { if (this.crystals.getValue() && entity instanceof EntityEnderCrystal) { ret = true; } - if (this.vehicles.getValue() && (entity instanceof EntityBoat || entity instanceof EntityMinecart || entity instanceof EntityMinecartContainer)) { + if (this.vehicles.getValue() && (entity instanceof EntityBoat || entity instanceof EntityMinecart)) { ret = true; } if (this.armorStand.getValue() && entity instanceof EntityArmorStand) { @@ -491,7 +525,7 @@ public final class WallHackModule extends Module { if (entity instanceof IMob) { ret = 0xFFFFAA00; } - if (entity instanceof EntityBoat || entity instanceof EntityMinecart || entity instanceof EntityMinecartContainer) { + if (entity instanceof EntityBoat || entity instanceof EntityMinecart) { ret = 0xFF00FFAA; } if (entity instanceof EntityItem) { @@ -529,10 +563,6 @@ public final class WallHackModule extends Module { final Vec3d pos = MathUtil.interpolateEntity(e, partialTicks); - if (pos == null) { - return null; - } - AxisAlignedBB bb = e.getEntityBoundingBox(); if (e instanceof EntityEnderCrystal) { @@ -551,7 +581,7 @@ public final class WallHackModule extends Module { return null; } - final Vec3d corners[] = { + final Vec3d[] corners = { new Vec3d(bb.minX - bb.maxX + e.width / 2, 0, bb.minZ - bb.maxZ + e.width / 2), new Vec3d(bb.maxX - bb.minX - e.width / 2, 0, bb.minZ - bb.maxZ + e.width / 2), new Vec3d(bb.minX - bb.maxX + e.width / 2, 0, bb.maxZ - bb.minZ - e.width / 2), @@ -566,10 +596,6 @@ public final class WallHackModule extends Module { for (Vec3d vec : corners) { final GLUProjection.Projection projection = GLUProjection.getInstance().project(pos.x + vec.x - Minecraft.getMinecraft().getRenderManager().viewerPosX, pos.y + vec.y - Minecraft.getMinecraft().getRenderManager().viewerPosY, pos.z + vec.z - Minecraft.getMinecraft().getRenderManager().viewerPosZ, GLUProjection.ClampMode.NONE, false); - if (projection == null) { - return null; - } - x = Math.max(x, (float) projection.getX()); y = Math.max(y, (float) projection.getY());