Renames ArraylistComponent to EnabledModsComponent, adds placeholders for many hud components, renamed "THREE_DIMENSIONAL/TWO_DIMENSIONAL" to "THREE_D/TWO_D" in multiple modules

This commit is contained in:
noil 2020-10-12 15:37:10 -04:00
parent cdc8142b03
commit d6eaac9cf4
8 changed files with 112 additions and 96 deletions

View File

@ -1,6 +1,7 @@
package me.rigamortis.seppuku.impl.gui.hud.component;
import me.rigamortis.seppuku.api.gui.hud.component.DraggableHudComponent;
import me.rigamortis.seppuku.impl.gui.hud.GuiHudEditor;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
@ -12,6 +13,8 @@ import net.minecraft.item.ItemStack;
*/
public final class ArmorComponent extends DraggableHudComponent {
private static final int ITEM_SIZE = 18;
public ArmorComponent() {
super("Armor");
}
@ -19,25 +22,35 @@ public final class ArmorComponent extends DraggableHudComponent {
@Override
public void render(int mouseX, int mouseY, float partialTicks) {
super.render(mouseX, mouseY, partialTicks);
// RenderUtil.drawRect(this.getX(), this.getY(), this.getX() + this.getW(), this.getY() + this.getH(), 0x90222222);
final Minecraft mc = Minecraft.getMinecraft();
int space = 0;
final Minecraft mc = Minecraft.getMinecraft();
boolean isInHudEditor = mc.currentScreen instanceof GuiHudEditor;
int itemSpacingWidth = 0;
boolean playerHasArmor = false;
for (int i = 0; i <= 3; i++) {
final ItemStack stack = mc.player.inventoryContainer.getSlot(8 - i).getStack();
if (stack != ItemStack.EMPTY) {
if (!stack.isEmpty()) {
GlStateManager.pushMatrix();
RenderHelper.enableGUIStandardItemLighting();
mc.getRenderItem().renderItemAndEffectIntoGUI(stack, (int)this.getX() + space, (int)this.getY());
mc.getRenderItem().renderItemOverlays(mc.fontRenderer, stack, (int)this.getX() + space, (int)this.getY());
mc.getRenderItem().renderItemAndEffectIntoGUI(stack, (int)this.getX() + itemSpacingWidth, (int)this.getY());
mc.getRenderItem().renderItemOverlays(mc.fontRenderer, stack, (int)this.getX() + itemSpacingWidth, (int)this.getY());
RenderHelper.disableStandardItemLighting();
GlStateManager.popMatrix();
space += 18;
itemSpacingWidth += ITEM_SIZE;
playerHasArmor = true;
}
}
this.setW(space);
if (isInHudEditor) {
if (!playerHasArmor) {
mc.fontRenderer.drawString("(armor)", (int) this.getX(), (int) this.getY(), 0xFFAAAAAA);
}
itemSpacingWidth = ITEM_SIZE * 4; // simulate 4 slots of armor ( for a placeholder in hud editor )
}
this.setW(itemSpacingWidth);
this.setH(16);
}

View File

@ -4,6 +4,8 @@ import com.mojang.realmsclient.gui.ChatFormatting;
import me.rigamortis.seppuku.Seppuku;
import me.rigamortis.seppuku.api.gui.hud.component.DraggableHudComponent;
import me.rigamortis.seppuku.api.module.Module;
import me.rigamortis.seppuku.impl.gui.hud.GuiHudEditor;
import me.rigamortis.seppuku.impl.gui.hud.anchor.AnchorPoint;
import me.rigamortis.seppuku.impl.module.hidden.ArrayListModule;
import net.minecraft.client.Minecraft;
@ -14,13 +16,14 @@ import java.util.List;
import static me.rigamortis.seppuku.impl.module.hidden.ArrayListModule.Mode.*;
/**
* Author Seth
* 7/25/2019 @ 7:24 AM.
* @author seth * 7/25/2019 @ 7:24 AM
* @author noil
*/
public final class ArrayListComponent extends DraggableHudComponent {
public final class EnabledModsComponent extends DraggableHudComponent {
public ArrayListComponent() {
super("ArrayList");
public EnabledModsComponent(AnchorPoint anchorPoint) {
super("EnabledMods");
this.setAnchorPoint(anchorPoint); // by default anchors in the top right corner of the hud
}
@Override
@ -28,6 +31,8 @@ public final class ArrayListComponent extends DraggableHudComponent {
super.render(mouseX, mouseY, partialTicks);
final List<Module> mods = new ArrayList<>();
final Minecraft mc = Minecraft.getMinecraft();
boolean isInHudEditor = mc.currentScreen instanceof GuiHudEditor;
for (Module mod : Seppuku.INSTANCE.getModuleManager().getModuleList()) {
if (mod != null && mod.getType() != Module.ModuleType.HIDDEN && mod.isEnabled() && !mod.isHidden()) {
@ -35,13 +40,12 @@ public final class ArrayListComponent extends DraggableHudComponent {
}
}
Object sorting_mode = Seppuku.INSTANCE.getModuleManager().find(ArrayListModule.class).find("Sorting").getValue();
if (sorting_mode.equals(LENGTH)) {
final Comparator<Module> lengthComparator = (first, second) -> {
final String firstName = first.getDisplayName() + (first.getMetaData() != null ? " " + ChatFormatting.GRAY + "[" + ChatFormatting.WHITE + first.getMetaData().toLowerCase() + ChatFormatting.GRAY + "]" : "");
final String secondName = second.getDisplayName() + (second.getMetaData() != null ? " " + ChatFormatting.GRAY + "[" + ChatFormatting.WHITE + second.getMetaData().toLowerCase() + ChatFormatting.GRAY + "]" : "");
final float dif = Minecraft.getMinecraft().fontRenderer.getStringWidth(secondName) - Minecraft.getMinecraft().fontRenderer.getStringWidth(firstName);
final float dif = mc.fontRenderer.getStringWidth(secondName) - mc.fontRenderer.getStringWidth(firstName);
return dif != 0 ? (int) dif : secondName.compareTo(firstName);
};
mods.sort(lengthComparator);
@ -65,7 +69,7 @@ public final class ArrayListComponent extends DraggableHudComponent {
final String name = mod.getDisplayName() + (mod.getMetaData() != null ? " " + ChatFormatting.GRAY + "[" + ChatFormatting.WHITE + mod.getMetaData().toLowerCase() + ChatFormatting.GRAY + "]" : "");
final float width = Minecraft.getMinecraft().fontRenderer.getStringWidth(name);
final float width = mc.fontRenderer.getStringWidth(name);
if (width >= maxWidth) {
maxWidth = width;
@ -74,7 +78,7 @@ public final class ArrayListComponent extends DraggableHudComponent {
if (this.getAnchorPoint() != null) {
switch (this.getAnchorPoint().getPoint()) {
case TOP_CENTER:
xOffset = (this.getW() - Minecraft.getMinecraft().fontRenderer.getStringWidth(name)) / 2;
xOffset = (this.getW() - mc.fontRenderer.getStringWidth(name)) / 2;
break;
case TOP_LEFT:
case BOTTOM_LEFT:
@ -82,7 +86,7 @@ public final class ArrayListComponent extends DraggableHudComponent {
break;
case TOP_RIGHT:
case BOTTOM_RIGHT:
xOffset = this.getW() - Minecraft.getMinecraft().fontRenderer.getStringWidth(name);
xOffset = this.getW() - mc.fontRenderer.getStringWidth(name);
break;
}
}
@ -92,22 +96,31 @@ public final class ArrayListComponent extends DraggableHudComponent {
case TOP_CENTER:
case TOP_LEFT:
case TOP_RIGHT:
Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(name, this.getX() + xOffset, this.getY() + yOffset, mod.getColor());
yOffset += (Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT + 1);
mc.fontRenderer.drawStringWithShadow(name, this.getX() + xOffset, this.getY() + yOffset, mod.getColor());
yOffset += (mc.fontRenderer.FONT_HEIGHT + 1);
break;
case BOTTOM_LEFT:
case BOTTOM_RIGHT:
Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(name, this.getX() + xOffset, this.getY() + (this.getH() - Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT) + yOffset, mod.getColor());
yOffset -= (Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT + 1);
mc.fontRenderer.drawStringWithShadow(name, this.getX() + xOffset, this.getY() + (this.getH() - mc.fontRenderer.FONT_HEIGHT) + yOffset, mod.getColor());
yOffset -= (mc.fontRenderer.FONT_HEIGHT + 1);
break;
}
} else {
Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(name, this.getX() + xOffset, this.getY() + yOffset, mod.getColor());
yOffset += (Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT + 1);
mc.fontRenderer.drawStringWithShadow(name, this.getX() + xOffset, this.getY() + yOffset, mod.getColor());
yOffset += (mc.fontRenderer.FONT_HEIGHT + 1);
}
}
}
if (isInHudEditor) {
if (maxWidth == 0) { // no mods
final String arraylist = "(enabled mods)";
mc.fontRenderer.drawStringWithShadow(arraylist, this.getX(), this.getY(), 0xFFAAAAAA);
maxWidth = mc.fontRenderer.getStringWidth(arraylist) + 1 /* right side gap */;
yOffset = mc.fontRenderer.FONT_HEIGHT + 1 /* right side gap */;
}
}
this.setW(maxWidth);
this.setH(Math.abs(yOffset));
}

View File

@ -3,6 +3,7 @@ package me.rigamortis.seppuku.impl.gui.hud.component;
import me.rigamortis.seppuku.api.gui.hud.component.DraggableHudComponent;
import me.rigamortis.seppuku.api.util.MathUtil;
import me.rigamortis.seppuku.api.util.RenderUtil;
import me.rigamortis.seppuku.impl.gui.hud.GuiHudEditor;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.DestroyBlockProgress;
@ -14,6 +15,8 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import java.awt.*;
/**
* Author Seth
* 12/2/2019 @ 2:17 PM.
@ -28,13 +31,15 @@ public final class HoleOverlayComponent extends DraggableHudComponent {
public void render(int mouseX, int mouseY, float partialTicks) {
super.render(mouseX, mouseY, partialTicks);
final Minecraft mc = Minecraft.getMinecraft();
boolean isInHudEditor = mc.currentScreen instanceof GuiHudEditor;
this.setW(48);
this.setH(48);
final Minecraft mc = Minecraft.getMinecraft();
float yaw = 0;
final int dir = (MathHelper.floor((double) (mc.player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3);
boolean foundBlock = false;
switch (dir) {
case 1:
@ -49,65 +54,53 @@ public final class HoleOverlayComponent extends DraggableHudComponent {
}
final BlockPos northPos = this.traceToBlock(partialTicks, yaw);
if (northPos != null) {
final Block north = this.getBlock(northPos);
if (north != null && north != Blocks.AIR) {
final int damage = this.getBlockDamage(northPos);
if (damage != 0) {
RenderUtil.drawRect(this.getX() + 16, this.getY(), this.getX() + 32, this.getY() + 16, 0x60ff0000);
}
this.drawBlock(north, this.getX() + 16, this.getY());
final Block north = this.getBlock(northPos);
if (north != null && north != Blocks.AIR) {
final int damage = this.getBlockDamage(northPos);
if (damage != 0) {
int damageColor = (int) MathUtil.map(damage, 0, 8, 0, 255);
RenderUtil.drawRect(this.getX() + 16, this.getY(), this.getX() + 32, this.getY() + 16, new Color(damageColor, 255 - damageColor, 0).getRGB());
}
this.drawBlock(north, this.getX() + 16, this.getY());
foundBlock = true;
}
final BlockPos southPos = this.traceToBlock(partialTicks, yaw - 180.0f);
if (southPos != null) {
final Block south = this.getBlock(southPos);
if (south != null && south != Blocks.AIR) {
final int damage = this.getBlockDamage(southPos);
if (damage != 0) {
RenderUtil.drawRect(this.getX() + 16, this.getY() + 32, this.getX() + 32, this.getY() + 48, 0x60ff0000);
}
this.drawBlock(south, this.getX() + 16, this.getY() + 32);
final Block south = this.getBlock(southPos);
if (south != null && south != Blocks.AIR) {
final int damage = this.getBlockDamage(southPos);
if (damage != 0) {
RenderUtil.drawRect(this.getX() + 16, this.getY() + 32, this.getX() + 32, this.getY() + 48, 0x60ff0000);
}
this.drawBlock(south, this.getX() + 16, this.getY() + 32);
foundBlock = true;
}
final BlockPos eastPos = this.traceToBlock(partialTicks, yaw + 90.0f);
if (eastPos != null) {
final Block east = this.getBlock(eastPos);
if (east != null && east != Blocks.AIR) {
final int damage = this.getBlockDamage(eastPos);
if (damage != 0) {
RenderUtil.drawRect(this.getX() + 32, this.getY() + 16, this.getX() + 48, this.getY() + 32, 0x60ff0000);
}
this.drawBlock(east, this.getX() + 32, this.getY() + 16);
final Block east = this.getBlock(eastPos);
if (east != null && east != Blocks.AIR) {
final int damage = this.getBlockDamage(eastPos);
if (damage != 0) {
RenderUtil.drawRect(this.getX() + 32, this.getY() + 16, this.getX() + 48, this.getY() + 32, 0x60ff0000);
}
this.drawBlock(east, this.getX() + 32, this.getY() + 16);
foundBlock = true;
}
final BlockPos westPos = this.traceToBlock(partialTicks, yaw - 90.0f);
if (westPos != null) {
final Block west = this.getBlock(westPos);
if (west != null && west != Blocks.AIR) {
final int damage = this.getBlockDamage(westPos);
if (damage != 0) {
RenderUtil.drawRect(this.getX(), this.getY() + 16, this.getX() + 16, this.getY() + 32, 0x60ff0000);
}
this.drawBlock(west, this.getX(), this.getY() + 16);
final Block west = this.getBlock(westPos);
if (west != null && west != Blocks.AIR) {
final int damage = this.getBlockDamage(westPos);
if (damage != 0) {
RenderUtil.drawRect(this.getX(), this.getY() + 16, this.getX() + 16, this.getY() + 32, 0x60ff0000);
}
this.drawBlock(west, this.getX(), this.getY() + 16);
foundBlock = true;
}
if (isInHudEditor && !foundBlock) {
mc.fontRenderer.drawStringWithShadow("(hole", this.getX(), this.getY(), 0xFFAAAAAA);
mc.fontRenderer.drawStringWithShadow("overlay)", this.getX(), this.getY() + mc.fontRenderer.FONT_HEIGHT + 1, 0xFFAAAAAA);
}
}

View File

@ -5,6 +5,7 @@ import me.rigamortis.seppuku.api.gui.hud.component.DraggableHudComponent;
import me.rigamortis.seppuku.api.notification.Notification;
import me.rigamortis.seppuku.api.util.RenderUtil;
import me.rigamortis.seppuku.impl.gui.hud.GuiHudEditor;
import me.rigamortis.seppuku.impl.gui.hud.anchor.AnchorPoint;
import net.minecraft.client.Minecraft;
/**
@ -12,8 +13,9 @@ import net.minecraft.client.Minecraft;
*/
public final class NotificationsComponent extends DraggableHudComponent {
public NotificationsComponent() {
public NotificationsComponent(AnchorPoint anchorPoint) {
super("Notifications");
this.setAnchorPoint(anchorPoint); // by default anchors in the top center
this.setVisible(true);
}
@ -23,10 +25,10 @@ public final class NotificationsComponent extends DraggableHudComponent {
if (Minecraft.getMinecraft().currentScreen instanceof GuiHudEditor) {
if (Seppuku.INSTANCE.getNotificationManager().getNotifications().isEmpty()) {
final String placeholder = "Notification Tray";
final String placeholder = "(notifications)";
this.setW(Minecraft.getMinecraft().fontRenderer.getStringWidth(placeholder));
this.setH(Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT);
Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(placeholder, this.getX(), this.getY(), 0xFFFFFFFF);
this.setH(Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT + 1);
Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(placeholder, this.getX(), this.getY(), 0xFFAAAAAA);
return;
}
}

View File

@ -9,10 +9,8 @@ import me.rigamortis.seppuku.impl.gui.hud.GuiHudEditor;
import me.rigamortis.seppuku.impl.gui.hud.anchor.AnchorPoint;
import me.rigamortis.seppuku.impl.gui.hud.component.*;
import me.rigamortis.seppuku.impl.gui.hud.component.module.ModuleListComponent;
import me.rigamortis.seppuku.impl.module.render.HudModule;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiChat;
import net.minecraft.client.gui.GuiIngame;
import net.minecraft.client.gui.ScaledResolution;
import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
@ -49,7 +47,7 @@ public final class HudManager {
this.anchorPoints.add(TOP_CENTER);
this.componentList.add(new WatermarkComponent());
this.componentList.add(new ArrayListComponent());
this.componentList.add(new EnabledModsComponent(TOP_RIGHT)); // creates the enabled mods component & by default anchors in the top right (to aid new users)
this.componentList.add(new TpsComponent());
this.componentList.add(new PotionEffectsComponent());
this.componentList.add(new FpsComponent());
@ -73,6 +71,7 @@ public final class HudManager {
this.componentList.add(new PlayerCountComponent());
this.componentList.add(new OverViewComponent());
this.componentList.add(new RearViewComponent());
this.componentList.add(new NotificationsComponent(TOP_CENTER));
for (Module.ModuleType type : Module.ModuleType.values()) {
if (type.equals(Module.ModuleType.HIDDEN) || type.equals(Module.ModuleType.UI))
@ -82,10 +81,6 @@ public final class HudManager {
this.componentList.add(moduleList);
}
NotificationsComponent notificationsComponent = new NotificationsComponent();
notificationsComponent.setAnchorPoint(TOP_RIGHT);
this.componentList.add(notificationsComponent);
this.loadExternalHudComponents();
// Organize alphabetically

View File

@ -35,10 +35,10 @@ import java.util.concurrent.CopyOnWriteArrayList;
*/
public final class PortalFinderModule extends Module {
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 Value<Mode> mode = new Value<Mode>("Mode", new String[]{"Mode"}, "Rendering mode to use for drawing found portals.", Mode.TWO_D);
private enum Mode {
TWO_DIMENSIONAL, THREE_DIMENSIONAL
TWO_D, THREE_D // TWO_ DIMENSIONAL, THREE_ DIMENSIONAL
}
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);
@ -70,7 +70,7 @@ public final class PortalFinderModule extends Module {
@Listener
public void render2D(EventRender2D event) {
if (this.mode.getValue() == Mode.TWO_DIMENSIONAL) {
if (this.mode.getValue() == Mode.TWO_D) {
final Minecraft mc = Minecraft.getMinecraft();
for (Vec3d portal : this.portals) {
@ -93,7 +93,7 @@ public final class PortalFinderModule extends Module {
@Listener
public void render3D(EventRender3D event) {
if (this.mode.getValue() == Mode.THREE_DIMENSIONAL) {
if (this.mode.getValue() == Mode.THREE_D) {
final Minecraft mc = Minecraft.getMinecraft();
for (Vec3d portal : this.portals) {

View File

@ -22,10 +22,10 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
*/
public final class StorageESPModule extends Module {
public final Value<Mode> mode = new Value<Mode>("Mode", new String[]{"Mode", "M"}, "Rendering mode", Mode.THREE_DIMENSIONAL);
public final Value<Mode> mode = new Value<Mode>("Mode", new String[]{"Mode", "M"}, "Rendering mode", Mode.THREE_D);
private enum Mode {
TWO_DIMENSIONAL, THREE_DIMENSIONAL
TWO_D, THREE_D // TWO_DIMENSIONAL, THREE_DIMENSIONAL
}
public final Value<Boolean> nametag = new Value<Boolean>("Nametag", new String[]{"Nametag", "Tag", "Tags", "Ntag"}, "Renders the name of the drawn storage object.", false);
@ -41,7 +41,7 @@ public final class StorageESPModule extends Module {
public void render2D(EventRender2D event) {
final Minecraft mc = Minecraft.getMinecraft();
if (this.mode.getValue() == Mode.THREE_DIMENSIONAL && !this.nametag.getValue()) // if 3D and names are off, return
if (this.mode.getValue() == Mode.THREE_D && !this.nametag.getValue()) // if 3D and names are off, return
return;
for (TileEntity te : mc.world.loadedTileEntityList) {
@ -51,7 +51,7 @@ 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.getValue() == Mode.TWO_DIMENSIONAL) { // 2D
if (this.mode.getValue() == Mode.TWO_D) { // 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()));
}
@ -72,7 +72,7 @@ public final class StorageESPModule extends Module {
@Listener
public void render3D(EventRender3D event) {
final Minecraft mc = Minecraft.getMinecraft();
if (this.mode.getValue() == Mode.THREE_DIMENSIONAL) {
if (this.mode.getValue() == Mode.THREE_D) {
for (TileEntity te : mc.world.loadedTileEntityList) {
if (te != null) {
if (this.isTileStorage(te)) {

View File

@ -32,10 +32,10 @@ public final class TracersModule extends Module {
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<Mode> mode = new Value<Mode>("Mode", new String[]{"Mode"}, "The rendering mode to use for drawing the tracer-line.", Mode.TWO_DIMENSIONAL);
public final Value<Mode> mode = new Value<Mode>("Mode", new String[]{"Mode"}, "The rendering mode to use for drawing the tracer-line.", Mode.TWO_D);
private enum Mode {
TWO_DIMENSIONAL, THREE_DIMENSIONAL
TWO_D, THREE_D // 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);
@ -51,7 +51,7 @@ public final class TracersModule extends Module {
@Listener
public void render2D(EventRender2D event) {
if (this.mode.getValue() == Mode.TWO_DIMENSIONAL) {
if (this.mode.getValue() == Mode.TWO_D) {
final Minecraft mc = Minecraft.getMinecraft();
for (Entity e : mc.world.loadedEntityList) {
@ -73,7 +73,7 @@ public final class TracersModule extends Module {
@Listener
public void render3D(EventRender3D event) {
if (this.mode.getValue() == Mode.THREE_DIMENSIONAL) {
if (this.mode.getValue() == Mode.THREE_D) {
final Minecraft mc = Minecraft.getMinecraft();
for (Entity e : mc.world.loadedEntityList) {