diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAudio.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAudio.java index f51b12da..a13f2a12 100644 --- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAudio.java +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAudio.java @@ -130,7 +130,7 @@ public class PlatformAudio { public void errorMessage(String parString1, String parString2, int parInt1) { if (!parString2.isEmpty()) { - // stfu pls + // stfu pls //logger.error("Error in class \"{}\"!", parString1); //logger.error(parString2); } diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java index 9cfa548a..11a179f1 100644 --- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java @@ -470,11 +470,11 @@ public class PlatformRuntime { // } - public static void showMojangScreen(){ + public static void showMojangScreen() { // } - public static void removeLoadScreen(){ - // + public static void removeLoadScreen() { + // } } diff --git a/src/main/java/dev/resent/annotation/Module.java b/src/main/java/dev/resent/annotation/Module.java index a94b6042..1cbfdd6a 100644 --- a/src/main/java/dev/resent/annotation/Module.java +++ b/src/main/java/dev/resent/annotation/Module.java @@ -10,7 +10,10 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) public @interface Module { String name() default "No name set"; + String description() default "No description set."; + Category category() default Category.MISC; + boolean hasSetting() default false; } diff --git a/src/main/java/dev/resent/annotation/RenderModule.java b/src/main/java/dev/resent/annotation/RenderModule.java index 17a62b95..0d1a213f 100644 --- a/src/main/java/dev/resent/annotation/RenderModule.java +++ b/src/main/java/dev/resent/annotation/RenderModule.java @@ -10,7 +10,9 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) public @interface RenderModule { String name(); + String description() default "No description set."; + Category category(); int x(); diff --git a/src/main/java/dev/resent/client/ClientInfo.java b/src/main/java/dev/resent/client/ClientInfo.java index f4b21102..fddf63fb 100644 --- a/src/main/java/dev/resent/client/ClientInfo.java +++ b/src/main/java/dev/resent/client/ClientInfo.java @@ -4,22 +4,22 @@ import dev.resent.util.render.Color; public class ClientInfo { - public static final String name = "Resent"; - public static final String version = "3.6"; - public static final String author = "Nitwit"; - public static final String release = Release.STABLE.name; + public static final String name = "Resent"; + public static final String version = "3.6"; + public static final String author = "Nitwit"; + public static final String release = Release.STABLE.name; - public static final int primaryColor = new Color(66, 66, 66).getRGB(); - public static final int secondaryColor = new Color(117, 117, 117).getRGB(); - - public enum Release { - BETA("Beta"), - STABLE("Stable"); - - String name; - Release(String name) { - this.name = name; - } - } - + public static final int primaryColor = new Color(66, 66, 66).getRGB(); + public static final int secondaryColor = new Color(117, 117, 117).getRGB(); + + public enum Release { + BETA("Beta"), + STABLE("Stable"); + + String name; + + Release(String name) { + this.name = name; + } + } } diff --git a/src/main/java/dev/resent/client/Resent.java b/src/main/java/dev/resent/client/Resent.java index c8528f89..3ed9e576 100644 --- a/src/main/java/dev/resent/client/Resent.java +++ b/src/main/java/dev/resent/client/Resent.java @@ -4,7 +4,6 @@ import dev.resent.module.base.ModManager; import dev.resent.sound.SoundManager; public class Resent { - static { INSTANCE = new Resent(); } @@ -18,5 +17,4 @@ public class Resent { Resent.INSTANCE.modManager = new ModManager(); Resent.INSTANCE.soundManager = new SoundManager(); } - } diff --git a/src/main/java/dev/resent/client/SaveUtil.java b/src/main/java/dev/resent/client/SaveUtil.java index 12e4ea43..64afdf91 100644 --- a/src/main/java/dev/resent/client/SaveUtil.java +++ b/src/main/java/dev/resent/client/SaveUtil.java @@ -1,14 +1,13 @@ package dev.resent.client; -import java.io.PrintWriter; - import dev.resent.module.base.RenderMod; import dev.resent.module.base.setting.BooleanSetting; import dev.resent.module.base.setting.ModeSetting; import dev.resent.module.base.setting.NumberSetting; +import java.io.PrintWriter; public class SaveUtil { - + public void save(PrintWriter printwriter) { Resent.INSTANCE.modManager.modules .stream() @@ -29,9 +28,9 @@ public class SaveUtil { if (s instanceof BooleanSetting) { printwriter.println(m.getName() + "_boolsetting_" + s.name + ":" + ((BooleanSetting) s).getValue()); } - if(s instanceof NumberSetting){ - NumberSetting ss = ((NumberSetting)s); - printwriter.println(m.getName() + "_numsetting_" + s.name + ":" + String.valueOf(ss.getValue()).substring(0, (String.valueOf(ss.getValue()).length())-2)); + if (s instanceof NumberSetting) { + NumberSetting ss = ((NumberSetting) s); + printwriter.println(m.getName() + "_numsetting_" + s.name + ":" + String.valueOf(ss.getValue()).substring(0, (String.valueOf(ss.getValue()).length()) - 2)); } }); }); @@ -73,13 +72,12 @@ public class SaveUtil { ((BooleanSetting) se).setValue(astring[1].equals("true")); } } - if(se instanceof NumberSetting){ - if(astring[0].equals(m.getName()+"_numsetting_"+se.name)){ - ((NumberSetting)se).value = Integer.parseInt(astring[1]); + if (se instanceof NumberSetting) { + if (astring[0].equals(m.getName() + "_numsetting_" + se.name)) { + ((NumberSetting) se).value = Integer.parseInt(astring[1]); } } }); }); } - } diff --git a/src/main/java/dev/resent/module/base/Mod.java b/src/main/java/dev/resent/module/base/Mod.java index c622121d..34f542fe 100644 --- a/src/main/java/dev/resent/module/base/Mod.java +++ b/src/main/java/dev/resent/module/base/Mod.java @@ -1,14 +1,13 @@ package dev.resent.module.base; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - import dev.resent.annotation.Module; import dev.resent.module.base.setting.Setting; import dev.resent.util.render.RenderUtils; import dev.resent.visual.ui.Theme; import dev.resent.visual.ui.animation.SimpleAnimation; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; import net.minecraft.client.Minecraft; public abstract class Mod { @@ -19,7 +18,7 @@ public abstract class Mod { private boolean enabled; private boolean hasSetting; private boolean admin; - public SimpleAnimation toggleAnimation = new SimpleAnimation(0); + public SimpleAnimation toggleAnimation = new SimpleAnimation(0); public List settings = new ArrayList<>(); @@ -39,6 +38,7 @@ public abstract class Mod { } public void onEnable() {} + public void onDisable() {} public void toggle() { @@ -80,16 +80,43 @@ public abstract class Mod { } } - public boolean isEnabled() { return enabled; } - public boolean isAdmin() { return admin; } - public boolean doesHaveSetting() { return hasSetting; } - public String getName() { return name; } - public String getDescription() { return description; } - public Category getCategory() { return category; } + public boolean isEnabled() { + return enabled; + } - public void setDescription(String description) { this.description = description; } - public void setName(String name) { this.name = name; } - public void setCategory(Category category) { this.category = category; } - public void setHasSetting(boolean hasSetting) { this.hasSetting = hasSetting; } + public boolean isAdmin() { + return admin; + } + public boolean doesHaveSetting() { + return hasSetting; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public Category getCategory() { + return category; + } + + public void setDescription(String description) { + this.description = description; + } + + public void setName(String name) { + this.name = name; + } + + public void setCategory(Category category) { + this.category = category; + } + + public void setHasSetting(boolean hasSetting) { + this.hasSetting = hasSetting; + } } diff --git a/src/main/java/dev/resent/module/base/ModManager.java b/src/main/java/dev/resent/module/base/ModManager.java index ebc9188e..28969d7f 100644 --- a/src/main/java/dev/resent/module/base/ModManager.java +++ b/src/main/java/dev/resent/module/base/ModManager.java @@ -1,9 +1,5 @@ package dev.resent.module.base; -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; - import dev.resent.module.base.Mod.Category; import dev.resent.module.impl.hud.ArmorHud; import dev.resent.module.impl.hud.BPS; @@ -41,6 +37,9 @@ import dev.resent.module.impl.setting.NoParticles; import dev.resent.module.impl.setting.NoRain; import dev.resent.module.impl.setting.NoSwingDelay; import dev.resent.module.impl.setting.SelfNametag; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; public class ModManager { @@ -79,13 +78,13 @@ public class ModManager { public static ItemPhysics itemPhysics = new ItemPhysics(); public static FPSOptions fpsOptions = new FPSOptions(); public static AdminRay adminRay = new AdminRay(); - public static AdminSpawner adminSpawner =new AdminSpawner(); + public static AdminSpawner adminSpawner = new AdminSpawner(); public static ParticleMultiplier particleMultiplier = new ParticleMultiplier(); public static Hand hand; + //public static Crosshair crosshair = new Crosshair(); public ModManager() { - //Hud //register(crosshair = new Crosshair()); register(hand = new Hand()); @@ -129,10 +128,10 @@ public class ModManager { } public ArrayList modsInCategory(Category c) { - if(c == null) { - return (ArrayList) modules; - } - + if (c == null) { + return (ArrayList) modules; + } + ArrayList inCat = (ArrayList) this.modules.stream().filter(m -> m.getCategory() == c).collect(Collectors.toList()); return inCat; diff --git a/src/main/java/dev/resent/module/base/RenderMod.java b/src/main/java/dev/resent/module/base/RenderMod.java index 44ba2ba4..acfc3a7c 100644 --- a/src/main/java/dev/resent/module/base/RenderMod.java +++ b/src/main/java/dev/resent/module/base/RenderMod.java @@ -54,7 +54,7 @@ public abstract class RenderMod extends Mod { Gui.drawRect(this.x, this.y, this.x + this.getWidth(), this.y + this.getHeight(), hovered ? 0x50FFFFFF : 0x40FFFFFF); RenderUtils.drawRectOutline(this.x, this.y, this.x + this.getWidth(), this.y + this.getHeight(), -1); - mc.fontRendererObj.drawStringWithShadow(getName(), this.x, this.y - 10, new Color(255,255,255).getRGB()); + mc.fontRendererObj.drawStringWithShadow(getName(), this.x, this.y - 10, new Color(255, 255, 255).getRGB()); final boolean mouseOverX = (mouseX >= this.getX() && mouseX <= this.getX() + this.getWidth()); final boolean mouseOverY = (mouseY >= this.getY() && mouseY <= this.getY() + this.getHeight()); diff --git a/src/main/java/dev/resent/module/base/setting/CustomRectSettingDraw.java b/src/main/java/dev/resent/module/base/setting/CustomRectSettingDraw.java index 02cd14b0..611433a1 100644 --- a/src/main/java/dev/resent/module/base/setting/CustomRectSettingDraw.java +++ b/src/main/java/dev/resent/module/base/setting/CustomRectSettingDraw.java @@ -1,9 +1,10 @@ package dev.resent.module.base.setting; -public class CustomRectSettingDraw extends Setting{ - public CustomRectSettingDraw(String name, String description){ +public class CustomRectSettingDraw extends Setting { + + public CustomRectSettingDraw(String name, String description) { super(name, description); } - public void onPress(){ } + public void onPress() {} } diff --git a/src/main/java/dev/resent/module/base/setting/ModeSetting.java b/src/main/java/dev/resent/module/base/setting/ModeSetting.java index d4c31195..91f8b29a 100644 --- a/src/main/java/dev/resent/module/base/setting/ModeSetting.java +++ b/src/main/java/dev/resent/module/base/setting/ModeSetting.java @@ -19,8 +19,7 @@ public final class ModeSetting extends Setting { } public void setValue(final String mode) { - if (modes.contains(mode)) - index = this.modes.indexOf(mode); + if (modes.contains(mode)) index = this.modes.indexOf(mode); } public boolean is(String mode) { @@ -44,4 +43,3 @@ public final class ModeSetting extends Setting { } } } - diff --git a/src/main/java/dev/resent/module/base/setting/NumberSetting.java b/src/main/java/dev/resent/module/base/setting/NumberSetting.java index eed5311f..581d5ef6 100644 --- a/src/main/java/dev/resent/module/base/setting/NumberSetting.java +++ b/src/main/java/dev/resent/module/base/setting/NumberSetting.java @@ -20,7 +20,7 @@ public class NumberSetting extends Setting { this.min = min; this.max = max; } - + public void incr() { if (value + increment >= max) { value = max; @@ -41,7 +41,7 @@ public class NumberSetting extends Setting { return value; } - public float getInitialValue(){ + public float getInitialValue() { return initValue; } diff --git a/src/main/java/dev/resent/module/base/setting/Setting.java b/src/main/java/dev/resent/module/base/setting/Setting.java index 32e1b226..a853ac87 100644 --- a/src/main/java/dev/resent/module/base/setting/Setting.java +++ b/src/main/java/dev/resent/module/base/setting/Setting.java @@ -17,6 +17,6 @@ public class Setting { this.description = description; this.gameSetting = gameSetting; } - - public void draw(int x, int y){ } + + public void draw(int x, int y) {} } diff --git a/src/main/java/dev/resent/module/impl/hud/ArmorHud.java b/src/main/java/dev/resent/module/impl/hud/ArmorHud.java index b67b6f79..bea5d044 100644 --- a/src/main/java/dev/resent/module/impl/hud/ArmorHud.java +++ b/src/main/java/dev/resent/module/impl/hud/ArmorHud.java @@ -2,8 +2,8 @@ package dev.resent.module.impl.hud; import dev.resent.annotation.RenderModule; import dev.resent.module.base.Mod.Category; -import dev.resent.module.base.setting.BooleanSetting; import dev.resent.module.base.RenderMod; +import dev.resent.module.base.setting.BooleanSetting; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.minecraft.client.gui.GuiIngame; import net.minecraft.client.gui.ScaledResolution; diff --git a/src/main/java/dev/resent/module/impl/hud/BPS.java b/src/main/java/dev/resent/module/impl/hud/BPS.java index d60d30e3..a5faaac5 100644 --- a/src/main/java/dev/resent/module/impl/hud/BPS.java +++ b/src/main/java/dev/resent/module/impl/hud/BPS.java @@ -1,27 +1,30 @@ package dev.resent.module.impl.hud; -import java.text.DecimalFormat; - import dev.resent.annotation.RenderModule; import dev.resent.module.base.Mod.Category; import dev.resent.module.base.RenderMod; +import java.text.DecimalFormat; @RenderModule(name = "BPS", category = Category.HUD, x = 4, y = 16, description = "See your current blocks per second") -public class BPS extends RenderMod{ +public class BPS extends RenderMod { - public int getWidth() { return mc.fontRendererObj.getStringWidth(getText()) + 4;} - public int getHeight(){ return 13; } + public int getWidth() { + return mc.fontRendererObj.getStringWidth(getText()) + 4; + } + + public int getHeight() { + return 13; + } public double getBPS() { return mc.thePlayer.getDistance(mc.thePlayer.lastTickPosX, mc.thePlayer.lastTickPosY, mc.thePlayer.lastTickPosZ) * (mc.timer.ticksPerSecond * mc.timer.timerSpeed); } - public String getText(){ + public String getText() { return "[BPS: " + new DecimalFormat("0.##").format(getBPS()) + "]"; } - public void draw(){ - drawString(getText(), x+2, y+2); + public void draw() { + drawString(getText(), x + 2, y + 2); } - } diff --git a/src/main/java/dev/resent/module/impl/hud/CPS.java b/src/main/java/dev/resent/module/impl/hud/CPS.java index 11122d90..b96a1627 100644 --- a/src/main/java/dev/resent/module/impl/hud/CPS.java +++ b/src/main/java/dev/resent/module/impl/hud/CPS.java @@ -1,12 +1,11 @@ package dev.resent.module.impl.hud; -import java.util.ArrayList; -import java.util.List; - import dev.resent.annotation.RenderModule; import dev.resent.module.base.Mod.Category; import dev.resent.module.base.RenderMod; import dev.resent.util.misc.FuncUtils; +import java.util.ArrayList; +import java.util.List; import net.lax1dude.eaglercraft.v1_8.Mouse; @RenderModule(name = "CPS", category = Category.HUD, x = 4, y = 26, description = "See your clicks per second") diff --git a/src/main/java/dev/resent/module/impl/hud/ClickGui.java b/src/main/java/dev/resent/module/impl/hud/ClickGui.java index ac977b31..fa18d528 100644 --- a/src/main/java/dev/resent/module/impl/hud/ClickGui.java +++ b/src/main/java/dev/resent/module/impl/hud/ClickGui.java @@ -8,14 +8,13 @@ import dev.resent.module.base.setting.ModeSetting; import dev.resent.module.base.setting.NumberSetting; @Module(name = "ClickGUI", category = Category.HUD, hasSetting = true, description = "Customize Resent's UI") -public class ClickGui extends Mod{ +public class ClickGui extends Mod { public BooleanSetting scroll = new BooleanSetting("Smooth scroll", "", false); public ModeSetting guiTheme = new ModeSetting("Gui theme", "New", "New", "Classic revised"); public NumberSetting test = new NumberSetting("Test, ignore!", "", 50, 1, 200, 5, 5); - public ClickGui(){ + public ClickGui() { addSetting(scroll, guiTheme); } - } diff --git a/src/main/java/dev/resent/module/impl/hud/Info.java b/src/main/java/dev/resent/module/impl/hud/Info.java index e6d37bac..a2d13a0d 100644 --- a/src/main/java/dev/resent/module/impl/hud/Info.java +++ b/src/main/java/dev/resent/module/impl/hud/Info.java @@ -2,8 +2,8 @@ package dev.resent.module.impl.hud; import dev.resent.annotation.RenderModule; import dev.resent.module.base.Mod.Category; -import dev.resent.module.base.setting.BooleanSetting; import dev.resent.module.base.RenderMod; +import dev.resent.module.base.setting.BooleanSetting; import dev.resent.util.render.Color; import dev.resent.visual.ui.Theme; import net.minecraft.util.BlockPos; @@ -19,18 +19,14 @@ public class Info extends RenderMod { public BooleanSetting direction = new BooleanSetting("Direction", "", true); public static final String[] directionsF = new String[] { "\u00A79S\u00A7r", "\u00A72W\u00A7r", "\u00A74N\u00A7r", "\u00A76E\u00A7r" }; - public int[] getPositions(){ - int[] poses = new int[]{ - (int)mc.thePlayer.posX, - (int)mc.thePlayer.posY, - (int)mc.thePlayer.posZ, - }; + public int[] getPositions() { + int[] poses = new int[] { (int) mc.thePlayer.posX, (int) mc.thePlayer.posY, (int) mc.thePlayer.posZ }; return poses; } public int getWidth() { - return 5 + mc.fontRendererObj.getStringWidth(" X: Biome:" + mc.theWorld.getBiomeGenForCoords(new BlockPos(getPositions()[0], getPositions()[1], getPositions()[2])).biomeName + Math.max(getPositions()[0], Math.max(getPositions()[1], getPositions()[2]))); + return 5 + mc.fontRendererObj.getStringWidth(" X: Biome:" + mc.theWorld.getBiomeGenForCoords(new BlockPos(getPositions()[0], getPositions()[1], getPositions()[2])).biomeName + Math.max(getPositions()[0], Math.max(getPositions()[1], getPositions()[2]))); } public int getHeight() { @@ -46,9 +42,9 @@ public class Info extends RenderMod { drawString(" Y: " + getPositions()[1], this.x + 5, this.y + 24); drawString(" Z: " + getPositions()[2], this.x + 5, this.y + 34); - if (direction.getValue()){ + if (direction.getValue()) { drawString(" Dir: ", this.x + 5 + mc.fontRendererObj.getStringWidth(" X: " + getPositions()[0]), this.y + 14); - mc.fontRendererObj.drawString(directionsF[rot], this.x+5+mc.fontRendererObj.getStringWidth(" X: Dir: " + getPositions()[0]), this.y + 14, -1, Theme.getTextShadow()); + mc.fontRendererObj.drawString(directionsF[rot], this.x + 5 + mc.fontRendererObj.getStringWidth(" X: Dir: " + getPositions()[0]), this.y + 14, -1, Theme.getTextShadow()); } drawString(" Biome: " + mc.theWorld.getBiomeGenForCoords(new BlockPos(getPositions()[0], getPositions()[1], getPositions()[2])).biomeName, this.x + 5, this.y + 44); } diff --git a/src/main/java/dev/resent/module/impl/hud/ItemPhysics.java b/src/main/java/dev/resent/module/impl/hud/ItemPhysics.java index 2c663ae4..40d28788 100644 --- a/src/main/java/dev/resent/module/impl/hud/ItemPhysics.java +++ b/src/main/java/dev/resent/module/impl/hud/ItemPhysics.java @@ -6,11 +6,11 @@ import dev.resent.module.base.Mod.Category; import dev.resent.module.base.setting.NumberSetting; @Module(name = "ItemPhysics", category = Category.MISC, hasSetting = true, description = "Give items physics!") -public class ItemPhysics extends Mod{ +public class ItemPhysics extends Mod { + public static NumberSetting speed = new NumberSetting("Speed", "", 2, 1, 8, 1, 1); - public ItemPhysics(){ + public ItemPhysics() { addSetting(speed); } - } diff --git a/src/main/java/dev/resent/module/impl/hud/KeyStrokes.java b/src/main/java/dev/resent/module/impl/hud/KeyStrokes.java index 06d43380..a573895b 100644 --- a/src/main/java/dev/resent/module/impl/hud/KeyStrokes.java +++ b/src/main/java/dev/resent/module/impl/hud/KeyStrokes.java @@ -1,8 +1,5 @@ package dev.resent.module.impl.hud; -import java.util.ArrayList; -import java.util.List; - import dev.resent.annotation.RenderModule; import dev.resent.module.base.Mod.Category; import dev.resent.module.base.RenderMod; @@ -11,6 +8,8 @@ import dev.resent.module.base.setting.ModeSetting; import dev.resent.util.misc.FuncUtils; import dev.resent.util.render.Color; import dev.resent.util.render.RenderUtils; +import java.util.ArrayList; +import java.util.List; import net.lax1dude.eaglercraft.v1_8.Mouse; import net.minecraft.client.Minecraft; diff --git a/src/main/java/dev/resent/module/impl/hud/ReachDisplay.java b/src/main/java/dev/resent/module/impl/hud/ReachDisplay.java index ee2417b1..672df808 100644 --- a/src/main/java/dev/resent/module/impl/hud/ReachDisplay.java +++ b/src/main/java/dev/resent/module/impl/hud/ReachDisplay.java @@ -3,7 +3,6 @@ package dev.resent.module.impl.hud; import dev.resent.annotation.RenderModule; import dev.resent.module.base.Mod.Category; import dev.resent.module.base.RenderMod; - import java.text.DecimalFormat; import net.minecraft.entity.Entity; import net.minecraft.util.Vec3; diff --git a/src/main/java/dev/resent/module/impl/misc/AdminRay.java b/src/main/java/dev/resent/module/impl/misc/AdminRay.java index 5a1db6ed..bc7b7524 100644 --- a/src/main/java/dev/resent/module/impl/misc/AdminRay.java +++ b/src/main/java/dev/resent/module/impl/misc/AdminRay.java @@ -1,104 +1,98 @@ package dev.resent.module.impl.misc; -import java.util.ArrayList; - import dev.resent.annotation.Module; import dev.resent.module.base.Mod; import dev.resent.module.base.Mod.Category; import dev.resent.module.base.setting.BooleanSetting; +import java.util.ArrayList; import net.lax1dude.eaglercraft.v1_8.ArrayUtils; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.settings.KeyBinding; @Module(name = "Ray", category = Category.MISC, hasSetting = true) -public class AdminRay extends Mod{ +public class AdminRay extends Mod { public static ArrayList rayBlocks = new ArrayList<>(); - public static BooleanSetting iron = new BooleanSetting("Iron", "", false); - public static BooleanSetting diamond = new BooleanSetting("Diamond", "", true); - public static BooleanSetting gold = new BooleanSetting("Gold", "", false); - public static BooleanSetting redstone = new BooleanSetting("Redstone", "", false); - public static BooleanSetting lapis = new BooleanSetting("Lapis", "", false); - public static BooleanSetting quartz = new BooleanSetting("Quartz", "", false); - public static BooleanSetting water = new BooleanSetting("Water", "", false); + public static BooleanSetting iron = new BooleanSetting("Iron", "", false); + public static BooleanSetting diamond = new BooleanSetting("Diamond", "", true); + public static BooleanSetting gold = new BooleanSetting("Gold", "", false); + public static BooleanSetting redstone = new BooleanSetting("Redstone", "", false); + public static BooleanSetting lapis = new BooleanSetting("Lapis", "", false); + public static BooleanSetting quartz = new BooleanSetting("Quartz", "", false); + public static BooleanSetting water = new BooleanSetting("Water", "", false); - public AdminRay(){ - addSetting(iron, diamond, gold, redstone, lapis, quartz, water); - } + public AdminRay() { + addSetting(iron, diamond, gold, redstone, lapis, quartz, water); + } - @Override - public boolean isAdmin(){ - return true; - } + @Override + public boolean isAdmin() { + return true; + } - public static boolean shouldRender(Block block){ + public static boolean shouldRender(Block block) { return rayBlocks.contains(block); } public static void start() { - rayBlocks.clear(); + rayBlocks.clear(); - if(iron.getValue()) - rayBlocks.add(Block.getBlockFromName("iron_ore")); - if(gold.getValue()) - rayBlocks.add(Block.getBlockFromName("gold_ore")); - if(redstone.getValue()){ - rayBlocks.add(Block.getBlockFromName("redstone_ore")); - rayBlocks.add(Block.getBlockById(74)); - } - if(lapis.getValue()) - rayBlocks.add(Block.getBlockFromName("lapis_ore")); - if(diamond.getValue()) - rayBlocks.add(Block.getBlockFromName("diamond_ore")); - if(quartz.getValue()) - rayBlocks.add(Block.getBlockFromName("quartz_ore")); - if(water.getValue()){ - rayBlocks.add(Block.getBlockById(8)); - rayBlocks.add(Block.getBlockById(9)); - } + if (iron.getValue()) rayBlocks.add(Block.getBlockFromName("iron_ore")); + if (gold.getValue()) rayBlocks.add(Block.getBlockFromName("gold_ore")); + if (redstone.getValue()) { + rayBlocks.add(Block.getBlockFromName("redstone_ore")); + rayBlocks.add(Block.getBlockById(74)); + } + if (lapis.getValue()) rayBlocks.add(Block.getBlockFromName("lapis_ore")); + if (diamond.getValue()) rayBlocks.add(Block.getBlockFromName("diamond_ore")); + if (quartz.getValue()) rayBlocks.add(Block.getBlockFromName("quartz_ore")); + if (water.getValue()) { + rayBlocks.add(Block.getBlockById(8)); + rayBlocks.add(Block.getBlockById(9)); + } - rayBlocks.add(Block.getBlockById(10)); - rayBlocks.add(Block.getBlockById(11)); - rayBlocks.add(Block.getBlockFromName("fire")); - rayBlocks.add(Block.getBlockFromName("mob_spawner")); - rayBlocks.add(Block.getBlockFromName("end_portal_frame")); - rayBlocks.add(Block.getBlockFromName("enchanting_table")); - rayBlocks.add(Block.getBlockFromName("bookshelf")); - } + rayBlocks.add(Block.getBlockById(10)); + rayBlocks.add(Block.getBlockById(11)); + rayBlocks.add(Block.getBlockFromName("fire")); + rayBlocks.add(Block.getBlockFromName("mob_spawner")); + rayBlocks.add(Block.getBlockFromName("end_portal_frame")); + rayBlocks.add(Block.getBlockFromName("enchanting_table")); + rayBlocks.add(Block.getBlockFromName("bookshelf")); + } - public static void updateGameSetting(){ - Minecraft mc = Minecraft.getMinecraft(); - mc.gameSettings.keyBindings = - (KeyBinding[]) ArrayUtils.addAll( - new KeyBinding[] { - mc.gameSettings.keyBindAttack, - mc.gameSettings.keyBindUseItem, - mc.gameSettings.keyBindForward, - mc.gameSettings.keyBindLeft, - mc.gameSettings.keyBindBack, - mc.gameSettings.keyBindRight, - mc.gameSettings.keyBindJump, - mc.gameSettings.keyBindSneak, - mc.gameSettings.keyBindSprint, - mc.gameSettings.keyBindDrop, - mc.gameSettings.keyBindInventory, - mc.gameSettings.keyBindChat, - mc.gameSettings.keyBindPlayerList, - mc.gameSettings.keyBindPickBlock, - mc.gameSettings.keyBindCommand, - mc.gameSettings.keyBindScreenshot, - mc.gameSettings.keyBindTogglePerspective, - mc.gameSettings.keyBindSmoothCamera, - mc.gameSettings.keyBindZoomCamera, - mc.gameSettings.keyBindFunction, - mc.gameSettings.keyBindClose, - mc.gameSettings.keyBindClickGui, - mc.gameSettings.keyBindFreelook, - mc.gameSettings.keyBindAdminX - }, - mc.gameSettings.keyBindsHotbar - ); - } + public static void updateGameSetting() { + Minecraft mc = Minecraft.getMinecraft(); + mc.gameSettings.keyBindings = + (KeyBinding[]) ArrayUtils.addAll( + new KeyBinding[] { + mc.gameSettings.keyBindAttack, + mc.gameSettings.keyBindUseItem, + mc.gameSettings.keyBindForward, + mc.gameSettings.keyBindLeft, + mc.gameSettings.keyBindBack, + mc.gameSettings.keyBindRight, + mc.gameSettings.keyBindJump, + mc.gameSettings.keyBindSneak, + mc.gameSettings.keyBindSprint, + mc.gameSettings.keyBindDrop, + mc.gameSettings.keyBindInventory, + mc.gameSettings.keyBindChat, + mc.gameSettings.keyBindPlayerList, + mc.gameSettings.keyBindPickBlock, + mc.gameSettings.keyBindCommand, + mc.gameSettings.keyBindScreenshot, + mc.gameSettings.keyBindTogglePerspective, + mc.gameSettings.keyBindSmoothCamera, + mc.gameSettings.keyBindZoomCamera, + mc.gameSettings.keyBindFunction, + mc.gameSettings.keyBindClose, + mc.gameSettings.keyBindClickGui, + mc.gameSettings.keyBindFreelook, + mc.gameSettings.keyBindAdminX + }, + mc.gameSettings.keyBindsHotbar + ); + } } diff --git a/src/main/java/dev/resent/module/impl/misc/AdminSpawner.java b/src/main/java/dev/resent/module/impl/misc/AdminSpawner.java index 18e3ee77..52025cca 100644 --- a/src/main/java/dev/resent/module/impl/misc/AdminSpawner.java +++ b/src/main/java/dev/resent/module/impl/misc/AdminSpawner.java @@ -11,42 +11,43 @@ import net.minecraft.tileentity.TileEntityMobSpawner; import net.minecraft.util.AxisAlignedBB; @Module(name = "Spawn", category = Category.HUD) - public class AdminSpawner extends Mod { - public void render(){ - for(Object o: mc.theWorld.loadedTileEntityList) { - if(o instanceof TileEntityMobSpawner && this.isEnabled()) { - box(((TileEntityMobSpawner)o)); + public void render() { + for (Object o : mc.theWorld.loadedTileEntityList) { + if (o instanceof TileEntityMobSpawner && this.isEnabled()) { + box(((TileEntityMobSpawner) o)); } } } - public static void box(TileEntityMobSpawner entity){ - GlStateManager.blendFunc(770, 771); - GlStateManager.enableBlend(); - EaglercraftGPU.glLineWidth(4.0F); - GlStateManager.disableTexture2D(); - GlStateManager.disableDepth(); - GlStateManager.depthMask(false); - GlStateManager.color(1F, 0.5F, 0.5F, 0.5F); - Minecraft.getMinecraft().getRenderManager(); - RenderGlobal.func_181561_a( - new AxisAlignedBB( -entity.getPos().getX()-Minecraft.getMinecraft().getRenderManager().renderPosX+0.1, -entity.getPos().getY()-Minecraft.getMinecraft().getRenderManager().renderPosY+0.1, -entity.getPos().getZ()-Minecraft.getMinecraft().getRenderManager().renderPosZ+0.1, -entity.getPos().getX() -Minecraft.getMinecraft().getRenderManager().renderPosX+0.9, -entity.getPos().getY() -Minecraft.getMinecraft().getRenderManager().renderPosY+0.9, -entity.getPos().getZ()-Minecraft.getMinecraft().getRenderManager().renderPosZ+0.9)); - GlStateManager.enableTexture2D(); - GlStateManager.enableDepth(); - GlStateManager.depthMask(true); - GlStateManager.disableBlend(); - } + public static void box(TileEntityMobSpawner entity) { + GlStateManager.blendFunc(770, 771); + GlStateManager.enableBlend(); + EaglercraftGPU.glLineWidth(4.0F); + GlStateManager.disableTexture2D(); + GlStateManager.disableDepth(); + GlStateManager.depthMask(false); + GlStateManager.color(1F, 0.5F, 0.5F, 0.5F); + Minecraft.getMinecraft().getRenderManager(); + RenderGlobal.func_181561_a( + new AxisAlignedBB( + entity.getPos().getX() - Minecraft.getMinecraft().getRenderManager().renderPosX + 0.1, + entity.getPos().getY() - Minecraft.getMinecraft().getRenderManager().renderPosY + 0.1, + entity.getPos().getZ() - Minecraft.getMinecraft().getRenderManager().renderPosZ + 0.1, + entity.getPos().getX() - Minecraft.getMinecraft().getRenderManager().renderPosX + 0.9, + entity.getPos().getY() - Minecraft.getMinecraft().getRenderManager().renderPosY + 0.9, + entity.getPos().getZ() - Minecraft.getMinecraft().getRenderManager().renderPosZ + 0.9 + ) + ); + GlStateManager.enableTexture2D(); + GlStateManager.enableDepth(); + GlStateManager.depthMask(true); + GlStateManager.disableBlend(); + } - @Override - public boolean isAdmin(){ - return true; - } -} \ No newline at end of file + @Override + public boolean isAdmin() { + return true; + } +} diff --git a/src/main/java/dev/resent/module/impl/misc/Cape.java b/src/main/java/dev/resent/module/impl/misc/Cape.java index 1c29e2d8..51f1a5c2 100644 --- a/src/main/java/dev/resent/module/impl/misc/Cape.java +++ b/src/main/java/dev/resent/module/impl/misc/Cape.java @@ -7,15 +7,16 @@ import dev.resent.module.base.setting.CustomRectSettingDraw; import dev.resent.visual.cape.CapeUi; @Module(name = "Cape", category = Category.MISC, hasSetting = true) -public class Cape extends Mod{ - public CustomRectSettingDraw open = new CustomRectSettingDraw("Choose cape", "Select which cape you want to use"){ +public class Cape extends Mod { + + public CustomRectSettingDraw open = new CustomRectSettingDraw("Choose cape", "Select which cape you want to use") { @Override - public void onPress(){ + public void onPress() { mc.displayGuiScreen(new CapeUi()); } }; - public Cape(){ + public Cape() { addSetting(open); } } diff --git a/src/main/java/dev/resent/module/impl/misc/Crosshair.java b/src/main/java/dev/resent/module/impl/misc/Crosshair.java index 4e580a7e..1431b2c8 100644 --- a/src/main/java/dev/resent/module/impl/misc/Crosshair.java +++ b/src/main/java/dev/resent/module/impl/misc/Crosshair.java @@ -7,15 +7,16 @@ import dev.resent.module.base.setting.CustomRectSettingDraw; import dev.resent.visual.crosshair.CrosshairUi; @Module(name = "Crosshair", category = Category.MISC, hasSetting = true) -public class Crosshair extends Mod{ - public CustomRectSettingDraw open = new CustomRectSettingDraw("Choose crosshair", "Select which crosshair you want to use"){ +public class Crosshair extends Mod { + + public CustomRectSettingDraw open = new CustomRectSettingDraw("Choose crosshair", "Select which crosshair you want to use") { @Override - public void onPress(){ + public void onPress() { mc.displayGuiScreen(new CrosshairUi()); } }; - public Crosshair(){ + public Crosshair() { addSetting(open); } } diff --git a/src/main/java/dev/resent/module/impl/misc/FPSOptions.java b/src/main/java/dev/resent/module/impl/misc/FPSOptions.java index d95ddf1a..6d2b3336 100644 --- a/src/main/java/dev/resent/module/impl/misc/FPSOptions.java +++ b/src/main/java/dev/resent/module/impl/misc/FPSOptions.java @@ -11,7 +11,7 @@ import net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums; import net.minecraft.client.settings.GameSettings; @Module(name = "FPS Options", category = Category.MISC, hasSetting = true, description = "Increase FPS") -public class FPSOptions extends Mod{ +public class FPSOptions extends Mod { public BooleanSetting batchRendering = new BooleanSetting("Batch rendering", "", true); public BooleanSetting blockEffects = new BooleanSetting("Remove block effects", "", true); @@ -20,9 +20,9 @@ public class FPSOptions extends Mod{ public BooleanSetting lightUpdates = new BooleanSetting("No light updates", "", true); public BooleanSetting noArmSwing = new BooleanSetting("No limb swing", "", false); public BooleanSetting reducedWater = new BooleanSetting("Reduced water lag", "", true); - public CustomRectSettingDraw minSetting = new CustomRectSettingDraw("Minimal settings", ""){ + public CustomRectSettingDraw minSetting = new CustomRectSettingDraw("Minimal settings", "") { @Override - public void onPress(){ + public void onPress() { GameSettings gameSettings = mc.gameSettings; GlStateManager.enableTexture2D(); @@ -50,10 +50,10 @@ public class FPSOptions extends Mod{ ModManager.noParticles.setEnabled(true); } }; + //public BooleanSetting delay = new BooleanSetting("Chunk delay", "", false); - public FPSOptions(){ + public FPSOptions() { addSetting(batchRendering, blockEffects, limit, lowTick, lightUpdates, noArmSwing, reducedWater, minSetting); } - } diff --git a/src/main/java/dev/resent/module/impl/misc/ParticleMultiplier.java b/src/main/java/dev/resent/module/impl/misc/ParticleMultiplier.java index cb527e2c..ae91e0fc 100644 --- a/src/main/java/dev/resent/module/impl/misc/ParticleMultiplier.java +++ b/src/main/java/dev/resent/module/impl/misc/ParticleMultiplier.java @@ -7,12 +7,13 @@ import dev.resent.module.base.setting.BooleanSetting; import dev.resent.module.base.setting.NumberSetting; @Module(name = "Particles Mod", category = Category.MISC, hasSetting = true) -public class ParticleMultiplier extends Mod{ +public class ParticleMultiplier extends Mod { + public static BooleanSetting alwaysCrit = new BooleanSetting("Always critical", "", false); public static BooleanSetting alwaysSharp = new BooleanSetting("Always sharpness", "", false); public static NumberSetting multiplier = new NumberSetting("Multiplier", "", 1, 1, 50, 1, 1); - public ParticleMultiplier(){ + public ParticleMultiplier() { addSetting(alwaysCrit, alwaysSharp, multiplier); } } diff --git a/src/main/java/dev/resent/module/impl/misc/ReachCircle.java b/src/main/java/dev/resent/module/impl/misc/ReachCircle.java index 752deae3..9d96c26b 100644 --- a/src/main/java/dev/resent/module/impl/misc/ReachCircle.java +++ b/src/main/java/dev/resent/module/impl/misc/ReachCircle.java @@ -14,9 +14,9 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @Module(name = "Reach circle", category = Category.MISC) -public class ReachCircle extends Mod{ +public class ReachCircle extends Mod { - public void uwu(float partialTicks){ + public void uwu(float partialTicks) { GlStateManager.pushMatrix(); mc.entityRenderer.disableLightmap(); GlStateManager.disableTexture2D(); @@ -26,7 +26,7 @@ public class ReachCircle extends Mod{ //PlatformOpenGL._wglEnable(2848); GlStateManager.depthMask(false); - for(Entity entity : mc.theWorld.loadedEntityList){ + for (Entity entity : mc.theWorld.loadedEntityList) { if (((EntityLivingBase) entity).canEntityBeSeen(mc.thePlayer) && !entity.isInvisible() && entity instanceof EntityPlayer) { double posX = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * partialTicks - mc.getRenderManager().viewerPosX; double posY = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * partialTicks - mc.getRenderManager().viewerPosY; @@ -43,15 +43,15 @@ public class ReachCircle extends Mod{ GlStateManager.enableTexture2D(); mc.entityRenderer.enableLightmap(); GlStateManager.popMatrix(); - } - + } + public void circle(double x, double y, double z, double rad) { GlStateManager.pushMatrix(); Color color = new Color(255, 0, 0); Tessellator tessellator = Tessellator.getInstance(); WorldRenderer worldrenderer = tessellator.getWorldRenderer(); - + EaglercraftGPU.glLineWidth(2); setColor(color.getRGB(), (color.getRGB() >> 24 & 255) / 255.0F); worldrenderer.begin(3, DefaultVertexFormats.POSITION); diff --git a/src/main/java/dev/resent/module/impl/misc/Sprint.java b/src/main/java/dev/resent/module/impl/misc/Sprint.java index 25266325..ce4e35ee 100644 --- a/src/main/java/dev/resent/module/impl/misc/Sprint.java +++ b/src/main/java/dev/resent/module/impl/misc/Sprint.java @@ -9,12 +9,11 @@ import net.minecraft.client.settings.KeyBinding; @Module(name = "ToggleSprint", category = Category.MISC) public class Sprint extends Mod { - public static void onUpdate(){ - KeyBinding.setKeyBindState(Minecraft.getMinecraft().gameSettings.keyBindSprint.getKeyCode(), true); + public static void onUpdate() { + KeyBinding.setKeyBindState(Minecraft.getMinecraft().gameSettings.keyBindSprint.getKeyCode(), true); } public void onDisable() { - KeyBinding.setKeyBindState(mc.gameSettings.keyBindSprint.getKeyCode(), false); - } - + KeyBinding.setKeyBindState(mc.gameSettings.keyBindSprint.getKeyCode(), false); + } } diff --git a/src/main/java/dev/resent/module/impl/setting/Hand.java b/src/main/java/dev/resent/module/impl/setting/Hand.java index e56523f5..30134999 100644 --- a/src/main/java/dev/resent/module/impl/setting/Hand.java +++ b/src/main/java/dev/resent/module/impl/setting/Hand.java @@ -4,4 +4,4 @@ import dev.resent.annotation.Module; import dev.resent.module.base.Mod; @Module(name = "Left hand", description = "Render your hand on the left") -public class Hand extends Mod{ } +public class Hand extends Mod {} diff --git a/src/main/java/dev/resent/module/impl/setting/SelfNametag.java b/src/main/java/dev/resent/module/impl/setting/SelfNametag.java index b2fb362e..6753cf08 100644 --- a/src/main/java/dev/resent/module/impl/setting/SelfNametag.java +++ b/src/main/java/dev/resent/module/impl/setting/SelfNametag.java @@ -5,4 +5,4 @@ import dev.resent.module.base.Mod; import dev.resent.module.base.Mod.Category; @Module(name = "Self nametag", category = Category.MISC) -public class SelfNametag extends Mod{ } +public class SelfNametag extends Mod {} diff --git a/src/main/java/dev/resent/sound/SoundManager.java b/src/main/java/dev/resent/sound/SoundManager.java index 3ab9c3e9..e777d942 100644 --- a/src/main/java/dev/resent/sound/SoundManager.java +++ b/src/main/java/dev/resent/sound/SoundManager.java @@ -5,13 +5,11 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.util.Base64; - import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.Clip; import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.UnsupportedAudioFileException; - import net.minecraft.client.Minecraft; import net.minecraft.client.audio.ISound; import net.minecraft.client.audio.PositionedSoundRecord; @@ -22,7 +20,7 @@ public class SoundManager { FileOutputStream fos = null; File temp; - public void playSound(String base64) throws UnsupportedEncodingException{ + public void playSound(String base64) throws UnsupportedEncodingException { byte[] byteArray = Base64.getDecoder().decode(new String(base64).getBytes("UTF-8")); this.playSound(byteArray); } @@ -43,7 +41,6 @@ public class SoundManager { Clip clip = AudioSystem.getClip(); clip.open(audioInputStream); clip.start(); - } catch (IOException ioe) { ioe.printStackTrace(); } catch (UnsupportedAudioFileException e) { @@ -62,7 +59,7 @@ public class SoundManager { } // <3 - public void playDemo(){ + public void playDemo() { ISound sound = PositionedSoundRecord.create(new ResourceLocation("minecraft:music.res"), 1); Minecraft.getMinecraft().getSoundHandler().stopSounds(); Minecraft.getMinecraft().getSoundHandler().playSound(sound); diff --git a/src/main/java/dev/resent/util/misc/FuncUtils.java b/src/main/java/dev/resent/util/misc/FuncUtils.java index f58e1028..0f5762a8 100644 --- a/src/main/java/dev/resent/util/misc/FuncUtils.java +++ b/src/main/java/dev/resent/util/misc/FuncUtils.java @@ -3,7 +3,6 @@ package dev.resent.util.misc; import java.util.Collection; import java.util.Iterator; import java.util.function.Predicate; - import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; public class FuncUtils { @@ -22,14 +21,14 @@ public class FuncUtils { public static boolean isInside(int mouseX, int mouseY, double x, double y, double width, double height) { return (mouseX > x && mouseX < (x + width)) && (mouseY > y && mouseY < (y + height)); - } - + } + public static void setColor(int color) { float f3 = (float) (color >> 24 & 255) / 255.0F; float f = (float) (color >> 16 & 255) / 255.0F; float f1 = (float) (color >> 8 & 255) / 255.0F; float f2 = (float) (color & 255) / 255.0F; - + GlStateManager.color(f, f1, f2, f3); } } diff --git a/src/main/java/dev/resent/util/misc/TimerUtil.java b/src/main/java/dev/resent/util/misc/TimerUtil.java index 17bfbd0b..cc827587 100644 --- a/src/main/java/dev/resent/util/misc/TimerUtil.java +++ b/src/main/java/dev/resent/util/misc/TimerUtil.java @@ -1,14 +1,15 @@ package dev.resent.util.misc; public class TimerUtil { + private static long halfSecond = 500000000; private long lastTime; - private long getDeltaTime(){ - return (System.nanoTime()-lastTime); + private long getDeltaTime() { + return (System.nanoTime() - lastTime); } - private void updateTime(){ + private void updateTime() { this.lastTime = System.nanoTime(); } @@ -20,7 +21,6 @@ public class TimerUtil { if (getDeltaTime() >= halfSecond) { updateTime(); return true; - } - else return false; + } else return false; } } diff --git a/src/main/java/dev/resent/util/physics/RenderItemPhysics.java b/src/main/java/dev/resent/util/physics/RenderItemPhysics.java index efe8e378..457be1d1 100644 --- a/src/main/java/dev/resent/util/physics/RenderItemPhysics.java +++ b/src/main/java/dev/resent/util/physics/RenderItemPhysics.java @@ -18,57 +18,48 @@ public class RenderItemPhysics { ItemStack itemstack = itemIn.getEntityItem(); Item item = itemstack.getItem(); Block block = Block.getBlockFromItem(item); - - if (item == null) - { + + if (item == null) { return 0; - } - else - { + } else { boolean flag = p_177077_9_.isGui3d(); int i = func_177078_a; - - if(ModManager.itemPhysics.isEnabled()) { - if(block != null) { - GlStateManager.translate((float)p_177077_2_, (float)p_177077_4_ + 0.15F, (float)p_177077_6_); - }else { - GlStateManager.translate((float)p_177077_2_, (float)p_177077_4_ + 0.02F, (float)p_177077_6_); + + if (ModManager.itemPhysics.isEnabled()) { + if (block != null) { + GlStateManager.translate((float) p_177077_2_, (float) p_177077_4_ + 0.15F, (float) p_177077_6_); + } else { + GlStateManager.translate((float) p_177077_2_, (float) p_177077_4_ + 0.02F, (float) p_177077_6_); GlStateManager.rotate(-90F, 1F, 0F, 0F); - } - }else { - float f1 = MathHelper.sin(((float)itemIn.getAge() + p_177077_8_) / 10.0F + itemIn.hoverStart) * 0.1F + 0.1F; + } + } else { + float f1 = MathHelper.sin(((float) itemIn.getAge() + p_177077_8_) / 10.0F + itemIn.hoverStart) * 0.1F + 0.1F; float f2 = p_177077_9_.getItemCameraTransforms().getTransform(ItemCameraTransforms.TransformType.GROUND).scale.y; - - GlStateManager.translate((float)p_177077_2_, (float)p_177077_4_ + f1 + 0.25F * f2, (float)p_177077_6_); + + GlStateManager.translate((float) p_177077_2_, (float) p_177077_4_ + f1 + 0.25F * f2, (float) p_177077_6_); } - if(!ModManager.itemPhysics.isEnabled()) { - if (flag || Minecraft.getMinecraft().getRenderManager().options != null) - { - float f3 = (((float)itemIn.getAge() + p_177077_8_) / 20.0F + itemIn.hoverStart) * (180F / (float)Math.PI); + if (!ModManager.itemPhysics.isEnabled()) { + if (flag || Minecraft.getMinecraft().getRenderManager().options != null) { + float f3 = (((float) itemIn.getAge() + p_177077_8_) / 20.0F + itemIn.hoverStart) * (180F / (float) Math.PI); GlStateManager.rotate(f3, 0.0F, 1.0F, 0.0F); } } - if (!flag) - { - float f6 = -0.0F * (float)(i - 1) * 0.5F; - float f4 = -0.0F * (float)(i - 1) * 0.5F; - float f5 = -0.046875F * (float)(i - 1) * 0.5F; + if (!flag) { + float f6 = -0.0F * (float) (i - 1) * 0.5F; + float f4 = -0.0F * (float) (i - 1) * 0.5F; + float f5 = -0.046875F * (float) (i - 1) * 0.5F; GlStateManager.translate(f6, f4, f5); } - if(ModManager.itemPhysics.isEnabled() && !itemIn.onGround) { - float angle = System.currentTimeMillis() % (360 * 20) / (float) (4.5 - ItemPhysics.speed.getValue()/2); - GlStateManager.rotate(angle, 1F, 1F, 1F); + if (ModManager.itemPhysics.isEnabled() && !itemIn.onGround) { + float angle = System.currentTimeMillis() % (360 * 20) / (float) (4.5 - ItemPhysics.speed.getValue() / 2); + GlStateManager.rotate(angle, 1F, 1F, 1F); } - - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); return i; } - } - - + } } diff --git a/src/main/java/dev/resent/util/render/RenderUtils.java b/src/main/java/dev/resent/util/render/RenderUtils.java index 48d9521c..bcfaefe1 100644 --- a/src/main/java/dev/resent/util/render/RenderUtils.java +++ b/src/main/java/dev/resent/util/render/RenderUtils.java @@ -77,21 +77,20 @@ public class RenderUtils { paramYEnd = z; } - double x1 = (double)(paramXStart + radius); - double y1 = (double)(paramYStart + radius); - double x2 = (double)(paramXEnd - radius); - double y2 = (double)(paramYEnd - radius); + double x1 = (double) (paramXStart + radius); + double y1 = (double) (paramYStart + radius); + double x2 = (double) (paramXEnd - radius); + double y2 = (double) (paramYEnd - radius); - if (popPush) - GlStateManager.pushMatrix(); + if (popPush) GlStateManager.pushMatrix(); GlStateManager.enableBlend(); GlStateManager.enableTexture2D(); GlStateManager.blendFunc(RealOpenGLEnums.GL_SRC_ALPHA, RealOpenGLEnums.GL_ONE_MINUS_SRC_ALPHA); EaglercraftGPU.glLineWidth(1); //glEnable(GL_LINE_SMOOTH); - GlStateManager.color(red, green, blue, alpha); - + GlStateManager.color(red, green, blue, alpha); + Tessellator tessellator = Tessellator.getInstance(); WorldRenderer worldrenderer = tessellator.getWorldRenderer(); @@ -99,24 +98,19 @@ public class RenderUtils { worldrenderer.begin(RealOpenGLEnums.GL_LINE_SMOOTH, DefaultVertexFormats.POSITION_TEX); double degree = Math.PI / 180; - for (double i = 0; i <= 90; i += 1) - glVertex2d(x2 + Math.sin(i * degree) * radius, y2 + Math.cos(i * degree) * radius); - for (double i = 90; i <= 180; i += 1) - glVertex2d(x2 + Math.sin(i * degree) * radius, y1 + Math.cos(i * degree) * radius); - for (double i = 180; i <= 270; i += 1) - glVertex2d(x1 + Math.sin(i * degree) * radius, y1 + Math.cos(i * degree) * radius); - for (double i = 270; i <= 360; i += 1) - glVertex2d(x1 + Math.sin(i * degree) * radius, y2 + Math.cos(i * degree) * radius); + for (double i = 0; i <= 90; i += 1) glVertex2d(x2 + Math.sin(i * degree) * radius, y2 + Math.cos(i * degree) * radius); + for (double i = 90; i <= 180; i += 1) glVertex2d(x2 + Math.sin(i * degree) * radius, y1 + Math.cos(i * degree) * radius); + for (double i = 180; i <= 270; i += 1) glVertex2d(x1 + Math.sin(i * degree) * radius, y1 + Math.cos(i * degree) * radius); + for (double i = 270; i <= 360; i += 1) glVertex2d(x1 + Math.sin(i * degree) * radius, y2 + Math.cos(i * degree) * radius); EaglercraftGPU.glEndList(); GlStateManager.enableTexture2D(); GlStateManager.disableBlend(); //glDisable(GL_LINE_SMOOTH); - if (popPush) - GlStateManager.popMatrix(); + if (popPush) GlStateManager.popMatrix(); } - public static void glVertex2d(double idk, double idk2){ + public static void glVertex2d(double idk, double idk2) { Tessellator tessellator = Tessellator.getInstance(); WorldRenderer worldrenderer = tessellator.getWorldRenderer(); worldrenderer.pos(idk, idk2, 0); @@ -134,7 +128,6 @@ public class RenderUtils { Gui.drawRect((int) paramInt1, (int) paramInt2, (int) paramInt3, (int) paramInt4, color); } } - public static void drawRoundedRect(final float paramFloat1, final float paramFloat2, final float paramFloat3, final float paramFloat4, final float paramFloat5) { final int i = 18; diff --git a/src/main/java/dev/resent/util/render/RoundedUtil.java b/src/main/java/dev/resent/util/render/RoundedUtil.java index 2456ea88..df6c30fe 100644 --- a/src/main/java/dev/resent/util/render/RoundedUtil.java +++ b/src/main/java/dev/resent/util/render/RoundedUtil.java @@ -10,7 +10,7 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats; public class RoundedUtil { - final static Minecraft mc = Minecraft.getMinecraft(); + static final Minecraft mc = Minecraft.getMinecraft(); public static void drawSmoothRoundedRect(float x, float y, float x1, float y1, float radius, int color) { Tessellator tessellator = Tessellator.getInstance(); @@ -29,24 +29,16 @@ public class RoundedUtil { GlStateManager.color(red, green, blue, alpha); worldrenderer.begin(RealOpenGLEnums.GL_POLYGON, DefaultVertexFormats.POSITION_TEX); int i; - for (i = 0; i <= 90; i += 3) - glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y + radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D); - for (i = 90; i <= 180; i += 3) - glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D); - for (i = 0; i <= 90; i += 3) - glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius); - for (i = 90; i <= 180; i += 3) - glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y + radius + Math.cos(i * Math.PI / 180.0D) * radius); + for (i = 0; i <= 90; i += 3) glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y + radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D); + for (i = 90; i <= 180; i += 3) glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D); + for (i = 0; i <= 90; i += 3) glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius); + for (i = 90; i <= 180; i += 3) glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y + radius + Math.cos(i * Math.PI / 180.0D) * radius); tessellator.draw(); worldrenderer.begin(RealOpenGLEnums.GL_LINE_LOOP, DefaultVertexFormats.POSITION_TEX); - for (i = 0; i <= 90; i += 3) - glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y + radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D); - for (i = 90; i <= 180; i += 3) - glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D); - for (i = 0; i <= 90; i += 3) - glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius); - for (i = 90; i <= 180; i += 3) - glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y + radius + Math.cos(i * Math.PI / 180.0D) * radius); + for (i = 0; i <= 90; i += 3) glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y + radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D); + for (i = 90; i <= 180; i += 3) glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D); + for (i = 0; i <= 90; i += 3) glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius); + for (i = 90; i <= 180; i += 3) glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y + radius + Math.cos(i * Math.PI / 180.0D) * radius); tessellator.draw(); GlStateManager.enableTexture2D(); GlStateManager.disableBlend(); @@ -54,10 +46,11 @@ public class RoundedUtil { GlStateManager.scale(2.0D, 2.0D, 2.0D); EaglercraftGPU.glLineWidth(1); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - } + } + public static void drawRoundedRect(float x, float y, float x1, float y1, float radius, int color) { - Tessellator tessellator = Tessellator.getInstance(); - WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); GlStateManager.scale(0.5D, 0.5D, 0.5D); x *= 2.0D; y *= 2.0D; @@ -73,14 +66,10 @@ public class RoundedUtil { GlStateManager.color(red, green, blue, alpha); worldrenderer.begin(RealOpenGLEnums.GL_POLYGON, DefaultVertexFormats.POSITION_TEX); int i; - for (i = 0; i <= 90; i += 3) - glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y + radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D); - for (i = 90; i <= 180; i += 3) - glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D); - for (i = 0; i <= 90; i += 3) - glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius); - for (i = 90; i <= 180; i += 3) - glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y + radius + Math.cos(i * Math.PI / 180.0D) * radius); + for (i = 0; i <= 90; i += 3) glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y + radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D); + for (i = 90; i <= 180; i += 3) glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D); + for (i = 0; i <= 90; i += 3) glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius); + for (i = 90; i <= 180; i += 3) glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y + radius + Math.cos(i * Math.PI / 180.0D) * radius); tessellator.draw(); GlStateManager.enableTexture2D(); GlStateManager.disableBlend(); @@ -88,9 +77,9 @@ public class RoundedUtil { GlStateManager.scale(2.0D, 2.0D, 2.0D); GlStateManager.enableBlend(); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - } + } - public static void glVertex2d(double idk, double idk2){ + public static void glVertex2d(double idk, double idk2) { Tessellator tessellator = Tessellator.getInstance(); WorldRenderer worldrenderer = tessellator.getWorldRenderer(); worldrenderer.pos(idk, idk2, 0); diff --git a/src/main/java/dev/resent/visual/cape/CapeManager.java b/src/main/java/dev/resent/visual/cape/CapeManager.java index 3ef6a389..e53e4598 100644 --- a/src/main/java/dev/resent/visual/cape/CapeManager.java +++ b/src/main/java/dev/resent/visual/cape/CapeManager.java @@ -10,16 +10,16 @@ import net.minecraft.util.ResourceLocation; public class CapeManager { public static ResourceLocation capeLocation; - - public static void displayChooser(){ + + public static void displayChooser() { EagRuntime.displayFileChooser("image/png", "png"); } - public static ResourceLocation getCapeLocation(){ + public static ResourceLocation getCapeLocation() { return capeLocation; } - public static void free(){ + public static void free() { Minecraft.getMinecraft().getTextureManager().deleteTexture(capeLocation); capeLocation = null; } @@ -28,33 +28,32 @@ public class CapeManager { EagRuntime.setStorage("cape", texture); } - public static byte[] read(){ - if(EagRuntime.getStorage("cape") != null){ + public static byte[] read() { + if (EagRuntime.getStorage("cape") != null) { return EagRuntime.getStorage("cape"); } return null; } - public static void forceLoad(byte[] texture){ - try{ + public static void forceLoad(byte[] texture) { + try { ImageData loadedCape = ImageData.loadImageFile(texture); - if(loadedCape != null){ + if (loadedCape != null) { CapeManager.capeLocation = Minecraft.getMinecraft().getTextureManager().getDynamicTextureLocation("uploadedcape", new DynamicTexture(loadedCape)); Minecraft.getMinecraft().displayGuiScreen(null); //Minecraft.getMinecraft().getTextureManager().bindTexture(CapeManager.capeLocation); } - }catch(Exception e){ + } catch (Exception e) { System.out.println(e); } } - public static boolean shouldRender(AbstractClientPlayer player){ - if(player == Minecraft.getMinecraft().thePlayer){ + public static boolean shouldRender(AbstractClientPlayer player) { + if (player == Minecraft.getMinecraft().thePlayer) { return true; } - + return false; } - } diff --git a/src/main/java/dev/resent/visual/cape/CapeUi.java b/src/main/java/dev/resent/visual/cape/CapeUi.java index 70811f0d..9cb3b085 100644 --- a/src/main/java/dev/resent/visual/cape/CapeUi.java +++ b/src/main/java/dev/resent/visual/cape/CapeUi.java @@ -25,14 +25,14 @@ public class CapeUi extends GuiScreen { super.drawScreen(mx, my, par3); } - public void updateScreen(){ + public void updateScreen() { if (EagRuntime.fileChooserHasResult()) { CapeManager.free(); FileChooserResult result = EagRuntime.getFileChooserResult(); if (result != null) { ImageData loadedCape = ImageData.loadImageFile(result.fileData); - if(loadedCape != null){ - for(int i = 0; 1 > i; i++){ + if (loadedCape != null) { + for (int i = 0; 1 > i; i++) { CapeManager.write(result.fileData); } CapeManager.capeLocation = Minecraft.getMinecraft().getTextureManager().getDynamicTextureLocation("uploadedcape", new DynamicTexture(loadedCape)); @@ -48,7 +48,7 @@ public class CapeUi extends GuiScreen { protected void actionPerformed(GuiButton par1GuiButton) { if (par1GuiButton.id == 200) { mc.displayGuiScreen(null); - }else if(par1GuiButton.id == 1){ + } else if (par1GuiButton.id == 1) { CapeManager.displayChooser(); } } diff --git a/src/main/java/dev/resent/visual/crosshair/CrosshairManager.java b/src/main/java/dev/resent/visual/crosshair/CrosshairManager.java index 7de39263..5f20e6e8 100644 --- a/src/main/java/dev/resent/visual/crosshair/CrosshairManager.java +++ b/src/main/java/dev/resent/visual/crosshair/CrosshairManager.java @@ -10,16 +10,16 @@ import net.minecraft.util.ResourceLocation; public class CrosshairManager { public static ResourceLocation crosshairLocation; - - public static void displayChooser(){ + + public static void displayChooser() { EagRuntime.displayFileChooser("image/png", "png"); } - public static ResourceLocation getCrosshairLocation(){ + public static ResourceLocation getCrosshairLocation() { return crosshairLocation; } - public static void free(){ + public static void free() { Minecraft.getMinecraft().getTextureManager().deleteTexture(crosshairLocation); crosshairLocation = null; } @@ -28,33 +28,32 @@ public class CrosshairManager { EagRuntime.setStorage("crosshair", texture); } - public static byte[] read(){ - if(EagRuntime.getStorage("crosshair") != null){ + public static byte[] read() { + if (EagRuntime.getStorage("crosshair") != null) { return EagRuntime.getStorage("crosshair"); } return null; } - public static void forceLoad(byte[] texture){ - try{ + public static void forceLoad(byte[] texture) { + try { ImageData loadedCrosshair = ImageData.loadImageFile(texture); - if(loadedCrosshair != null){ + if (loadedCrosshair != null) { CrosshairManager.crosshairLocation = Minecraft.getMinecraft().getTextureManager().getDynamicTextureLocation("uploadedcrosshair", new DynamicTexture(loadedCrosshair)); Minecraft.getMinecraft().displayGuiScreen(null); //Minecraft.getMinecraft().getTextureManager().bindTexture(CrosshairManager.crosshairLocation); } - }catch(Exception e){ + } catch (Exception e) { System.out.println(e); } } - public static boolean shouldRender(AbstractClientPlayer player){ - if(player == Minecraft.getMinecraft().thePlayer){ + public static boolean shouldRender(AbstractClientPlayer player) { + if (player == Minecraft.getMinecraft().thePlayer) { return true; } - + return false; } - } diff --git a/src/main/java/dev/resent/visual/crosshair/CrosshairUi.java b/src/main/java/dev/resent/visual/crosshair/CrosshairUi.java index cf1effa7..a210d370 100644 --- a/src/main/java/dev/resent/visual/crosshair/CrosshairUi.java +++ b/src/main/java/dev/resent/visual/crosshair/CrosshairUi.java @@ -25,14 +25,14 @@ public class CrosshairUi extends GuiScreen { super.drawScreen(mx, my, par3); } - public void updateScreen(){ + public void updateScreen() { if (EagRuntime.fileChooserHasResult()) { CrosshairManager.free(); FileChooserResult result = EagRuntime.getFileChooserResult(); if (result != null) { ImageData loadedCrosshair = ImageData.loadImageFile(result.fileData); - if(loadedCrosshair != null){ - for(int i = 0; 1 > i; i++){ + if (loadedCrosshair != null) { + for (int i = 0; 1 > i; i++) { CrosshairManager.write(result.fileData); } CrosshairManager.crosshairLocation = Minecraft.getMinecraft().getTextureManager().getDynamicTextureLocation("uploadedcrosshair", new DynamicTexture(loadedCrosshair)); @@ -48,7 +48,7 @@ public class CrosshairUi extends GuiScreen { protected void actionPerformed(GuiButton par1GuiButton) { if (par1GuiButton.id == 200) { mc.displayGuiScreen(null); - }else if(par1GuiButton.id == 1){ + } else if (par1GuiButton.id == 1) { CrosshairManager.displayChooser(); } } diff --git a/src/main/java/dev/resent/visual/ui/PreVideo.java b/src/main/java/dev/resent/visual/ui/PreVideo.java index 8aa027c4..cfef8c3c 100644 --- a/src/main/java/dev/resent/visual/ui/PreVideo.java +++ b/src/main/java/dev/resent/visual/ui/PreVideo.java @@ -6,32 +6,29 @@ import net.minecraft.client.gui.GuiOptions; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiVideoSettings; -public class PreVideo extends GuiScreen{ - - public GuiScreen uwu; - - public PreVideo(GuiScreen from) { - uwu = from; - } +public class PreVideo extends GuiScreen { - @Override - protected void mouseClicked(int parInt1, int parInt2, int parInt3) { - if(isMouseInside(parInt1, parInt2, width/2-50, height/2+40, width/2+50, height/2+70)) { - this.mc.displayGuiScreen(new GuiOptions(uwu, mc.gameSettings)); - }else { - this.mc.displayGuiScreen(new GuiVideoSettings(this, mc.gameSettings)); - } - } + public GuiScreen uwu; - @Override - public void drawScreen(int i, int j, float var3) { - this.drawDefaultBackground(); - drawCenteredString(mc.fontRendererObj, "Don't use Auto gui scale! Resent looks best with normal or large gui scales.", width/2, height/2, -1); - drawCenteredString(mc.fontRendererObj, "Press anywhere to continue. Or, go", width/2, height/2+19, -1); - RenderUtils.drawRoundedRect(width/2-50, height/2+40, width/2+50, height/2+70, 4, isMouseInside(i, j, width/2-50, height/2+40, width/2+50, height/2+70) ? new Color(40, 40, 40).getRGB() : new Color(21, 21, 21).getRGB()); - drawCenteredString(mc.fontRendererObj, "Back", width/2, height/2+51, -1); - } - - + public PreVideo(GuiScreen from) { + uwu = from; + } + @Override + protected void mouseClicked(int parInt1, int parInt2, int parInt3) { + if (isMouseInside(parInt1, parInt2, width / 2 - 50, height / 2 + 40, width / 2 + 50, height / 2 + 70)) { + this.mc.displayGuiScreen(new GuiOptions(uwu, mc.gameSettings)); + } else { + this.mc.displayGuiScreen(new GuiVideoSettings(this, mc.gameSettings)); + } + } + + @Override + public void drawScreen(int i, int j, float var3) { + this.drawDefaultBackground(); + drawCenteredString(mc.fontRendererObj, "Don't use Auto gui scale! Resent looks best with normal or large gui scales.", width / 2, height / 2, -1); + drawCenteredString(mc.fontRendererObj, "Press anywhere to continue. Or, go", width / 2, height / 2 + 19, -1); + RenderUtils.drawRoundedRect(width / 2 - 50, height / 2 + 40, width / 2 + 50, height / 2 + 70, 4, isMouseInside(i, j, width / 2 - 50, height / 2 + 40, width / 2 + 50, height / 2 + 70) ? new Color(40, 40, 40).getRGB() : new Color(21, 21, 21).getRGB()); + drawCenteredString(mc.fontRendererObj, "Back", width / 2, height / 2 + 51, -1); + } } diff --git a/src/main/java/dev/resent/visual/ui/Theme.java b/src/main/java/dev/resent/visual/ui/Theme.java index 5f8ef5b5..8be3b67b 100644 --- a/src/main/java/dev/resent/visual/ui/Theme.java +++ b/src/main/java/dev/resent/visual/ui/Theme.java @@ -35,8 +35,6 @@ public class Theme { return new DecelerateAnimation(ms, endpoint); case "Smooth step": return new SmoothStepAnimation(ms, endpoint); - case "None": - return null; } return null; diff --git a/src/main/java/dev/resent/visual/ui/animation/Animation.java b/src/main/java/dev/resent/visual/ui/animation/Animation.java index a3d90148..89ad4541 100644 --- a/src/main/java/dev/resent/visual/ui/animation/Animation.java +++ b/src/main/java/dev/resent/visual/ui/animation/Animation.java @@ -56,8 +56,7 @@ public abstract class Animation { } public double getValue() { - if(HUD.animationTheme.getValue().equals("None")) - return 0; + if (HUD.animationTheme.getValue().equals("None")) return 0; if (direction == Direction.FORWARDS) { if (isDone()) return endPoint; return (getEquation(timer.getTime()) * endPoint); diff --git a/src/main/java/dev/resent/visual/ui/animation/SimpleAnimation.java b/src/main/java/dev/resent/visual/ui/animation/SimpleAnimation.java index 8afaff9c..abc7cec2 100644 --- a/src/main/java/dev/resent/visual/ui/animation/SimpleAnimation.java +++ b/src/main/java/dev/resent/visual/ui/animation/SimpleAnimation.java @@ -37,8 +37,8 @@ public class SimpleAnimation { public void setValue(float value) { this.value = value; } - + public boolean isDone() { - return lastValue >= value-1; + return lastValue >= value - 1; } } diff --git a/src/main/java/dev/resent/visual/ui/clickgui/ClickGUI.java b/src/main/java/dev/resent/visual/ui/clickgui/ClickGUI.java index e302468a..e06154cf 100644 --- a/src/main/java/dev/resent/visual/ui/clickgui/ClickGUI.java +++ b/src/main/java/dev/resent/visual/ui/clickgui/ClickGUI.java @@ -1,8 +1,5 @@ package dev.resent.visual.ui.clickgui; -import java.io.IOException; -import java.util.Comparator; - import dev.resent.client.ClientInfo; import dev.resent.client.Resent; import dev.resent.module.base.Mod; @@ -19,6 +16,8 @@ import dev.resent.util.render.RenderUtils; import dev.resent.visual.ui.Theme; import dev.resent.visual.ui.animation.Animation; import dev.resent.visual.ui.animation.Direction; +import java.io.IOException; +import java.util.Comparator; import net.lax1dude.eaglercraft.v1_8.Keyboard; import net.lax1dude.eaglercraft.v1_8.Mouse; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; @@ -52,81 +51,78 @@ public class ClickGUI extends GuiScreen { offset = MathHelper.clamp_int(MathHelper.clamp_int(offset, 0, getListMaxScroll()), 0, getListMaxScroll()); int xo = 0; int off = 0; - - if(isMouseInside(mouseX, mouseY, x, height+14, x+20, height+25)) { - selectedCategory = null; - }else if(isMouseInside(mouseX, mouseY, x+24, height+14, x+46, height+25)) { - selectedCategory = Category.HUD; - }else if(isMouseInside(mouseX, mouseY, x+50, height+14, x+74, height+25)) { - selectedCategory = Category.MISC; + + if (isMouseInside(mouseX, mouseY, x, height + 14, x + 20, height + 25)) { + selectedCategory = null; + } else if (isMouseInside(mouseX, mouseY, x + 24, height + 14, x + 46, height + 25)) { + selectedCategory = Category.HUD; + } else if (isMouseInside(mouseX, mouseY, x + 50, height + 14, x + 74, height + 25)) { + selectedCategory = Category.MISC; } - + if (isMouseInside(mouseX, mouseY, sr.getScaledWidth() / 2 - fr.getStringWidth("Edit Layout") / 2 - 5, sr.getScaledHeight() - y - 9, sr.getScaledWidth() / 2 - fr.getStringWidth("Edit Layout") / 2 + 5 + fr.getStringWidth("Edit Layout"), sr.getScaledHeight() - y + 5) && mouseButton == 0) { mc.displayGuiScreen(new HUDConfigScreen(this)); this.openedMod = null; } Resent.INSTANCE.modManager.modsInCategory(selectedCategory).sort(Comparator.comparingInt(m -> fr.getStringWidth(m.getName()))); - for (Mod m : Resent.INSTANCE.modManager.modsInCategory(selectedCategory) ) { - if(!m.isAdmin() || EntityRenderer.test){ - int fh = 9; + for (Mod m : Resent.INSTANCE.modManager.modsInCategory(selectedCategory)) { + if (!m.isAdmin() || EntityRenderer.test) { + int fh = 9; - if (isMouseInside(mouseX, mouseY, this.x + 90 + xo - 1 + 10, height - 2 - fh * -(off) + 51 - 1 - offset, this.x + 90 + xo - 1 + 21, height + 30 - fh * (-off) + 30 - 1 + 2 - 1 - offset) && m.doesHaveSetting() && openedMod == null) { - // Open settings - this.openedMod = m; - } else if (isMouseInside(mouseX, mouseY, x - 9 + 2, height + 27 + 9 + 2, x - 9 + 6 + fr.getStringWidth("<"), height + 33 + 9 + 2 + fr.getStringWidth("<")) && mouseButton == 0) { - // Close settings - this.openedMod = null; - } else if (isMouseInside(mouseX, mouseY, width + 15, height - 10, width + 25, height + 7)) { - // Close ui - mc.displayGuiScreen(null); - this.openedMod = null; - }else if(isMouseInside(mouseX, mouseY, this.x+48+xo, height-2-fh*-(off)+70-1-offset, this.x+80+xo, height+30-fh*-off+30+2-offset+17) && ModManager.clickGui.guiTheme.getValue() == "New" && openedMod == null){ - //toggle new - if(m.getName() != "ClickGUI") - m.toggle(); - } else if (isMouseInside(mouseX, mouseY, this.x + 10 + xo - 2 + 10, height - 2 - fh * -(off) + 50 - 2 - offset, this.x + 90 + xo + 22, height + 30 - fh * (-off) + 30 + 2 - offset) && mouseButton == 0 && openedMod == null && ModManager.clickGui.guiTheme.getValue() == "Classic revised") { - //toggle classic - if(m.getName() != "ClickGUI") - m.toggle(); - } - if (xo > width / 2) { - xo = 0; - off += 5; - } else { - xo += 100; - } + if (isMouseInside(mouseX, mouseY, this.x + 90 + xo - 1 + 10, height - 2 - fh * -(off) + 51 - 1 - offset, this.x + 90 + xo - 1 + 21, height + 30 - fh * (-off) + 30 - 1 + 2 - 1 - offset) && m.doesHaveSetting() && openedMod == null) { + // Open settings + this.openedMod = m; + } else if (isMouseInside(mouseX, mouseY, x - 9 + 2, height + 27 + 9 + 2, x - 9 + 6 + fr.getStringWidth("<"), height + 33 + 9 + 2 + fr.getStringWidth("<")) && mouseButton == 0) { + // Close settings + this.openedMod = null; + } else if (isMouseInside(mouseX, mouseY, width + 15, height - 10, width + 25, height + 7)) { + // Close ui + mc.displayGuiScreen(null); + this.openedMod = null; + } else if (isMouseInside(mouseX, mouseY, this.x + 48 + xo, height - 2 - fh * -(off) + 70 - 1 - offset, this.x + 80 + xo, height + 30 - fh * -off + 30 + 2 - offset + 17) && ModManager.clickGui.guiTheme.getValue() == "New" && openedMod == null) { + //toggle new + if (m.getName() != "ClickGUI") m.toggle(); + } else if (isMouseInside(mouseX, mouseY, this.x + 10 + xo - 2 + 10, height - 2 - fh * -(off) + 50 - 2 - offset, this.x + 90 + xo + 22, height + 30 - fh * (-off) + 30 + 2 - offset) && mouseButton == 0 && openedMod == null && ModManager.clickGui.guiTheme.getValue() == "Classic revised") { + //toggle classic + if (m.getName() != "ClickGUI") m.toggle(); + } + if (xo > width / 2) { + xo = 0; + off += 5; + } else { + xo += 100; + } } } if (openedMod != null) { int var = 0; for (Setting s : this.openedMod.settings) { - - if(s instanceof NumberSetting) { - if(isMouseInside(mouseX, mouseY, width-150+sliderOffset, height+41+var, width-141+sliderOffset, height+50+var)) { - draggingNumber = true; + if (s instanceof NumberSetting) { + if (isMouseInside(mouseX, mouseY, width - 150 + sliderOffset, height + 41 + var, width - 141 + sliderOffset, height + 50 + var)) { + draggingNumber = true; } } if (s instanceof BooleanSetting) { if (isMouseInside(mouseX, mouseY, this.x + 11, height - 9 + 50 + var, this.x + 19, height - 9 + 50 + 9 + var - 1) && mouseButton == 0) { - ((BooleanSetting)s).toggle(); + ((BooleanSetting) s).toggle(); } } if (s instanceof ModeSetting) { - if(isMouseInside(mouseX, mouseY, this.x+360, height+40+var, this.x+370, height+50+var) && mouseButton == 0) { - ((ModeSetting)s).cycle(false); + if (isMouseInside(mouseX, mouseY, this.x + 360, height + 40 + var, this.x + 370, height + 50 + var) && mouseButton == 0) { + ((ModeSetting) s).cycle(false); } - if(isMouseInside(mouseX, mouseY, this.x+458, height+40+var, this.x+470, height+50+var) && mouseButton == 0) { - ((ModeSetting)s).cycle(true); + if (isMouseInside(mouseX, mouseY, this.x + 458, height + 40 + var, this.x + 470, height + 50 + var) && mouseButton == 0) { + ((ModeSetting) s).cycle(true); } } - if(s instanceof CustomRectSettingDraw){ - if(isMouseInside(mouseX, mouseY, x+21, height+41+var, x+27+fr.getStringWidth(s.name), height+var+53)){ - ((CustomRectSettingDraw)s).onPress(); + if (s instanceof CustomRectSettingDraw) { + if (isMouseInside(mouseX, mouseY, x + 21, height + 41 + var, x + 27 + fr.getStringWidth(s.name), height + var + 53)) { + ((CustomRectSettingDraw) s).onPress(); } } @@ -148,11 +144,11 @@ public class ClickGUI extends GuiScreen { int off = 0; if (close) { - if(introAnimation == null) { - mc.displayGuiScreen(null); - return; - } - + if (introAnimation == null) { + mc.displayGuiScreen(null); + return; + } + introAnimation.setDirection(Direction.BACKWARDS); if (introAnimation.isDone(Direction.BACKWARDS)) { mc.displayGuiScreen(null); @@ -164,9 +160,9 @@ public class ClickGUI extends GuiScreen { // background drawRect(x - 10, y + 20, width + 35, height - 10, new Color(35, 39, 42, 200).getRGB()); fr.drawString(ClientInfo.name + " Client " + ClientInfo.version, x + 8, height - 2, -1); - + //RenderUtils.drawRectOutline(sr.getScaledWidth() / 2 - fr.getStringWidth("Edit Layout") / 2 - 5, sr.getScaledHeight() - y - 9, sr.getScaledWidth() / 2 - fr.getStringWidth("Edit Layout") / 2 + 5 + fr.getStringWidth("Edit Layout"), sr.getScaledHeight() - y + 5, -1); - drawRect( + drawRect( sr.getScaledWidth() / 2 - fr.getStringWidth("Edit Layout") / 2 - 4, sr.getScaledHeight() - y - 9 + 1, sr.getScaledWidth() / 2 - fr.getStringWidth("Edit Layout") / 2 + 5 + fr.getStringWidth("Edit Layout") - 1, @@ -178,43 +174,43 @@ public class ClickGUI extends GuiScreen { // close fr.drawString("X", width + 18, height - 2, -1); - + //categories - drawRect(x+0.8d, height+14, x+20, height+25, isMouseInside(mouseX, mouseY, x, height+14, x+20, height+25) ? new Color(150, 150, 150, 65).getRGB() : new Color(211, 211, 211, 65).getRGB()); - drawRect(x+23d, height+14, x+47, height+25, isMouseInside(mouseX, mouseY, x+24, height+14, x+46, height+25) ? new Color(150, 150, 150, 65).getRGB() : new Color(211, 211, 211, 65).getRGB()); - drawRect(x+50, height+14, x+75, height+25, isMouseInside(mouseX, mouseY, x+50, height+14, x+74, height+25) ? new Color(150, 150, 150, 65).getRGB() : new Color(211, 211, 211, 65).getRGB()); - fr.drawStringWithShadow("All", x+5f, height+16, -1); - fr.drawStringWithShadow("Hud", x+26.5f, height+16, -1); - fr.drawStringWithShadow("Misc", x+53, height+16, -1); - + drawRect(x + 0.8d, height + 14, x + 20, height + 25, isMouseInside(mouseX, mouseY, x, height + 14, x + 20, height + 25) ? new Color(150, 150, 150, 65).getRGB() : new Color(211, 211, 211, 65).getRGB()); + drawRect(x + 23d, height + 14, x + 47, height + 25, isMouseInside(mouseX, mouseY, x + 24, height + 14, x + 46, height + 25) ? new Color(150, 150, 150, 65).getRGB() : new Color(211, 211, 211, 65).getRGB()); + drawRect(x + 50, height + 14, x + 75, height + 25, isMouseInside(mouseX, mouseY, x + 50, height + 14, x + 74, height + 25) ? new Color(150, 150, 150, 65).getRGB() : new Color(211, 211, 211, 65).getRGB()); + fr.drawStringWithShadow("All", x + 5f, height + 16, -1); + fr.drawStringWithShadow("Hud", x + 26.5f, height + 16, -1); + fr.drawStringWithShadow("Misc", x + 53, height + 16, -1); + //white line drawRect(x - 8, height + 29, width + 33, height + 30, -1); GlUtils.stopScale(); - + Resent.INSTANCE.modManager.modsInCategory(selectedCategory).sort(Comparator.comparingInt(m -> fr.getStringWidth(m.getName()))); for (Mod m : Resent.INSTANCE.modManager.modsInCategory(selectedCategory)) { if (this.openedMod == null && !m.isAdmin() || this.openedMod == null && EntityRenderer.test) { int fh = 9; - if (height - 2 - fh * -(off) + 50 - 2 - offset > height + 29 && height + 40 - fh * (-off) + 30 +15 - offset < y + 20 && (introAnimation != null ? introAnimation.isDone() : true)) { + if (height - 2 - fh * -(off) + 50 - 2 - offset > height + 29 && height + 40 - fh * (-off) + 30 + 15 - offset < y + 20 && (introAnimation != null ? introAnimation.isDone() : true)) { // Enabled outline - - m.toggleAnimation.setAnimation(m.isEnabled() ? 20 : 0, 7); - if(ModManager.clickGui.guiTheme.getValue() == "New"){ - RenderUtils.drawRoundedRect(this.x+48+xo, height-2-fh*-(off)+70-1-offset, this.x+80+xo, height+30-fh*-off+30+2-offset+17, 6, new Color(97, 97, 97).getRGB(), true); - RenderUtils.drawRoundedRect(this.x+48+xo, height-2-fh*-(off)+70-1-offset, this.x+60+xo+m.toggleAnimation.getValue(), height+30-fh*-off+30+2-offset+17, 6, Color.green.getRGB(), true); - RenderUtils.drawRoundedRect(this.x+48+xo+m.toggleAnimation.getValue(), height-2-fh*-(off)+70-1-offset, this.x+60+xo+m.toggleAnimation.getValue(), height+30-fh*-off+30+2-offset+17, 6, -1, true); - }else if(ModManager.clickGui.guiTheme.getValue() == "Classic revised"){ + + m.toggleAnimation.setAnimation(m.isEnabled() ? 20 : 0, 7); + if (ModManager.clickGui.guiTheme.getValue() == "New") { + RenderUtils.drawRoundedRect(this.x + 48 + xo, height - 2 - fh * -(off) + 70 - 1 - offset, this.x + 80 + xo, height + 30 - fh * -off + 30 + 2 - offset + 17, 6, new Color(97, 97, 97).getRGB(), true); + RenderUtils.drawRoundedRect(this.x + 48 + xo, height - 2 - fh * -(off) + 70 - 1 - offset, this.x + 60 + xo + m.toggleAnimation.getValue(), height + 30 - fh * -off + 30 + 2 - offset + 17, 6, Color.green.getRGB(), true); + RenderUtils.drawRoundedRect(this.x + 48 + xo + m.toggleAnimation.getValue(), height - 2 - fh * -(off) + 70 - 1 - offset, this.x + 60 + xo + m.toggleAnimation.getValue(), height + 30 - fh * -off + 30 + 2 - offset + 17, 6, -1, true); + } else if (ModManager.clickGui.guiTheme.getValue() == "Classic revised") { RenderUtils.drawRoundedRect(this.x + 10 + xo - 2 + 10, height - 2 - fh * -(off) + 50 - 2 - offset, this.x + 90 + xo + 22, height + 30 - fh * (-off) + 30 + 2 - offset, 4, m.isEnabled() ? Color.GREEN.getRGB() : Color.RED.getRGB(), true); } - if(ModManager.clickGui.guiTheme.getValue().equals("New")) { - drawRect( - this.x + 10 + xo - 1 + 10, - height - 2 - fh * -(off) + 50 - 1 - offset, - this.x + 90 + xo - 1 + 22, - height + 85 - fh * (-off) - offset, - /*isMouseInside(mouseX, mouseY, this.x + 10 + xo - 1 + 10, height - 2 - fh * -(off) + 50 - 1 - offset, this.x + 90 + xo - 1 + 22, height + 30 - fh * (-off) + 30 - 1 + 2 - offset) ? new Color(105, 105, 105, 65).getRGB() :*/ new Color(211, 211, 211, 65).getRGB() - ); + if (ModManager.clickGui.guiTheme.getValue().equals("New")) { + drawRect( + this.x + 10 + xo - 1 + 10, + height - 2 - fh * -(off) + 50 - 1 - offset, + this.x + 90 + xo - 1 + 22, + height + 85 - fh * (-off) - offset, + /*isMouseInside(mouseX, mouseY, this.x + 10 + xo - 1 + 10, height - 2 - fh * -(off) + 50 - 1 - offset, this.x + 90 + xo - 1 + 22, height + 30 - fh * (-off) + 30 - 1 + 2 - offset) ? new Color(105, 105, 105, 65).getRGB() :*/new Color(211, 211, 211, 65).getRGB() + ); } if (m.doesHaveSetting()) { @@ -232,56 +228,55 @@ public class ClickGUI extends GuiScreen { fr.drawStringWithShadow(ClientInfo.name + " - " + openedMod.getName(), sr.getScaledWidth() / 2 - (fr.getStringWidth("Resent - " + openedMod.getName()) / 2), height + 29 - 9 - 2, -1); for (Setting s : openedMod.settings) { - if(s instanceof CustomRectSettingDraw){ - drawRect(x+21, height+41+var, x+27+fr.getStringWidth(s.name), height+var+53, isMouseInside(mouseX, mouseY, x+21, height+39+var, x+26+fr.getStringWidth(s.name), height+var+51) ? new Color(150, 150, 150).getRGB() : new Color(211, 211, 211).getRGB()); + if (s instanceof CustomRectSettingDraw) { + drawRect(x + 21, height + 41 + var, x + 27 + fr.getStringWidth(s.name), height + var + 53, isMouseInside(mouseX, mouseY, x + 21, height + 39 + var, x + 26 + fr.getStringWidth(s.name), height + var + 51) ? new Color(150, 150, 150).getRGB() : new Color(211, 211, 211).getRGB()); //RenderUtils.drawRectOutline(x+21, height+41+var, x+27+fr.getStringWidth(s.name), height+var+53, -1); - fr.drawStringWithShadow(s.name, this.x + 24, height +43 + var, -1); + fr.drawStringWithShadow(s.name, this.x + 24, height + 43 + var, -1); var += 3; } - - if(s instanceof NumberSetting) { - NumberSetting ss = ((NumberSetting)s); - fr.drawStringWithShadow(s.name + ": sof " + sliderOffset + ", val: " + ((NumberSetting)s).getValue(), this.x+24, height+41+var, -1); - drawRect(width-150, height+43+var, width-45, height+47+var, -1); - RenderUtils.drawRoundedRect(width-150+sliderOffset, height+40+var, width-140+sliderOffset, height+50+var, 4, Color.RED.getRGB()); - if(settingDrag) { - sliderOffset = mouseX-(width-150); - ss.setValue(sliderOffset*(ss.max/100)); - }else { - sliderOffset = (int) ((ss.getValue() * 100)/ss.max); + if (s instanceof NumberSetting) { + NumberSetting ss = ((NumberSetting) s); + fr.drawStringWithShadow(s.name + ": sof " + sliderOffset + ", val: " + ((NumberSetting) s).getValue(), this.x + 24, height + 41 + var, -1); + drawRect(width - 150, height + 43 + var, width - 45, height + 47 + var, -1); + RenderUtils.drawRoundedRect(width - 150 + sliderOffset, height + 40 + var, width - 140 + sliderOffset, height + 50 + var, 4, Color.RED.getRGB()); + + if (settingDrag) { + sliderOffset = mouseX - (width - 150); + ss.setValue(sliderOffset * (ss.max / 100)); + } else { + sliderOffset = (int) ((ss.getValue() * 100) / ss.max); } - - if(sliderOffset < 0) { + + if (sliderOffset < 0) { settingDrag = false; sliderOffset = 0; - }else if(draggingNumber){ + } else if (draggingNumber) { settingDrag = true; } - if(sliderOffset > 100){ + if (sliderOffset > 100) { settingDrag = false; sliderOffset = 100; - }else if(draggingNumber){ + } else if (draggingNumber) { settingDrag = true; } - } if (s instanceof BooleanSetting) { drawRect(this.x + 11, height - 9 + 50 + var, this.x + 19, height - 9 + 50 + 9 + var - 1, isMouseInside(mouseX, mouseY, this.x + 11, height - 9 + 50 + var, this.x + 19, height - 9 + 50 + 9 + var - 1) ? new Color(211, 211, 211, 65).getRGB() : new Color(105, 105, 105, 65).getRGB()); fr.drawStringWithShadow(s.name, this.x + 18 + 6, height - fr.FONT_HEIGHT + 50 + var, -1); - if (((BooleanSetting)s).getValue()) { + if (((BooleanSetting) s).getValue()) { mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/check.png")); Gui.drawModalRectWithCustomSizedTexture(this.x + 9, height + 39 + var, 0, 0, 12, 12, 12, 12); } } if (s instanceof ModeSetting) { fr.drawStringWithShadow(s.name, this.x + 18 + 6, height - 9 + 50 + var, -1); - fr.drawStringWithShadow(((ModeSetting)s).getValue(), width-100-fr.getStringWidth(((ModeSetting)s).getValue())/2, height+41+var, -1); - fr.drawStringWithShadow(EnumChatFormatting.RED + "<", width - 150, height-9+50+var, -1); + fr.drawStringWithShadow(((ModeSetting) s).getValue(), width - 100 - fr.getStringWidth(((ModeSetting) s).getValue()) / 2, height + 41 + var, -1); + fr.drawStringWithShadow(EnumChatFormatting.RED + "<", width - 150, height - 9 + 50 + var, -1); //RenderUtils.drawRectOutline(this.x+370, height+39+var, this.x+360, height+50+var, -1); - fr.drawStringWithShadow(EnumChatFormatting.RED + ">", this.x+463, height-9+50+var, -1); + fr.drawStringWithShadow(EnumChatFormatting.RED + ">", this.x + 463, height - 9 + 50 + var, -1); //RenderUtils.drawRectOutline(this.x+458, height+40+var, this.x+470, height+50+var, -1); } @@ -289,25 +284,21 @@ public class ClickGUI extends GuiScreen { } } - if(!m.isAdmin() || EntityRenderer.test){ - if (xo > width / 2) { - xo = 0; - off += 5; - } else { - xo += 100; + if (!m.isAdmin() || EntityRenderer.test) { + if (xo > width / 2) { + xo = 0; + off += 5; + } else { + xo += 100; + } } } - } } public boolean doesGuiPauseGame() { return false; } - public boolean isMouseInside(double mouseX, double mouseY, double x, double y, double width, double height) { - return (mouseX >= x && mouseX <= width) && (mouseY >= y && mouseY <= height); - } - public void onGuiClosed() { Keyboard.enableRepeatEvents(true); ModManager.clickGui.setEnabled(false); @@ -321,7 +312,7 @@ public class ClickGUI extends GuiScreen { } @Override - public void mouseReleased(int mouseX, int mouseY, int mouseButton){ + public void mouseReleased(int mouseX, int mouseY, int mouseButton) { draggingNumber = false; settingDrag = false; } @@ -341,20 +332,19 @@ public class ClickGUI extends GuiScreen { for (int i = 0; i < 20; i++) { offset = MathHelper.clamp_int(offset + 1, 0, getListMaxScroll()); try { - if(ModManager.clickGui.scroll.getValue()) - Thread.sleep(1); + if (ModManager.clickGui.scroll.getValue()) Thread.sleep(1); } catch (InterruptedException e) { e.printStackTrace(); } } - }).start(); + }) + .start(); } else if (wheel > 0) { new Thread(() -> { for (int i = 0; i < 20; i++) { offset = MathHelper.clamp_int(offset - 1, 0, getListMaxScroll()); try { - if(ModManager.clickGui.scroll.getValue()) - Thread.sleep(1); + if (ModManager.clickGui.scroll.getValue()) Thread.sleep(1); } catch (InterruptedException e) { e.printStackTrace(); } diff --git a/src/main/java/dev/resent/visual/ui/clickgui/HUDConfigScreen.java b/src/main/java/dev/resent/visual/ui/clickgui/HUDConfigScreen.java index 959f0361..aaf23a6b 100644 --- a/src/main/java/dev/resent/visual/ui/clickgui/HUDConfigScreen.java +++ b/src/main/java/dev/resent/visual/ui/clickgui/HUDConfigScreen.java @@ -7,13 +7,12 @@ import net.minecraft.client.gui.GuiScreen; public class HUDConfigScreen extends GuiScreen { - private GuiScreen parentGuiScreen; - - public HUDConfigScreen(GuiScreen parentScreen) { - parentGuiScreen = parentScreen; - } - - + private GuiScreen parentGuiScreen; + + public HUDConfigScreen(GuiScreen parentScreen) { + parentGuiScreen = parentScreen; + } + public void initGui() { this.buttonList.add(new GuiButton(200, width / 2 - 100, height - 30, "Back")); } @@ -24,7 +23,7 @@ public class HUDConfigScreen extends GuiScreen { public void drawScreen(int mx, int my, float par3) { this.drawDefaultBackground(); - Resent.INSTANCE.modManager.modules.stream().filter(m -> m.isEnabled() && m instanceof RenderMod).forEach(rm -> ((RenderMod)rm).renderLayout(mx, my)); + Resent.INSTANCE.modManager.modules.stream().filter(m -> m.isEnabled() && m instanceof RenderMod).forEach(rm -> ((RenderMod) rm).renderLayout(mx, my)); super.drawScreen(mx, my, par3); } diff --git a/src/main/java/dev/resent/visual/ui/clickgui/PreGUI.java b/src/main/java/dev/resent/visual/ui/clickgui/PreGUI.java index 457a4879..580f1adc 100644 --- a/src/main/java/dev/resent/visual/ui/clickgui/PreGUI.java +++ b/src/main/java/dev/resent/visual/ui/clickgui/PreGUI.java @@ -17,18 +17,17 @@ public class PreGUI extends GuiScreen { @Override public void drawScreen(int i, int j, float var3) { - - opacityAnimation.setAnimation(100, 5); - slideAnimation.setAnimation(200, 7); - - boolean isInside = isMouseInside(i, j, GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 20, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 50); - boolean isInside2 = isMouseInside(i, j, GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 55, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 85); + opacityAnimation.setAnimation(100, 5); + slideAnimation.setAnimation(200, 7); + + boolean isInside = isMouseInside(i, j, GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 20, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 50); + boolean isInside2 = isMouseInside(i, j, GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 55, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 85); mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/logo.png")); - Gui.drawModalRectWithCustomSizedTexture(GuiScreen.width / 2 - 20, GuiScreen.height / 2 - 250 + (int)slideAnimation.getValue(), 0, 0, 60, 60, 60, 60); - Gui.drawRect(GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 20, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 50, isInside ? 0x90FFFFFF : new Color(230, 230, 230, (int)opacityAnimation.getValue()).getRGB()); - Gui.drawRect(GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 55, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 85, isInside2 ? 0x90FFFFFF : new Color(230, 230, 230, (int)opacityAnimation.getValue()).getRGB()); + Gui.drawModalRectWithCustomSizedTexture(GuiScreen.width / 2 - 20, GuiScreen.height / 2 - 250 + (int) slideAnimation.getValue(), 0, 0, 60, 60, 60, 60); + Gui.drawRect(GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 20, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 50, isInside ? 0x90FFFFFF : new Color(230, 230, 230, (int) opacityAnimation.getValue()).getRGB()); + Gui.drawRect(GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 55, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 85, isInside2 ? 0x90FFFFFF : new Color(230, 230, 230, (int) opacityAnimation.getValue()).getRGB()); //RenderUtils.drawRectOutline(GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 20, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 50, 0x080FFFFFF); - if(opacityAnimation.isDone()) { + if (opacityAnimation.isDone()) { mc.fontRendererObj.drawStringWithShadow("Mods", GuiScreen.width / 2 - 2, GuiScreen.height / 2 + 35 - 9 / 2, -1); mc.fontRendererObj.drawStringWithShadow("Edit Layout", GuiScreen.width / 2 - 17, GuiScreen.height / 2 + 70 - 9 / 2, -1); } @@ -59,7 +58,4 @@ public class PreGUI extends GuiScreen { super.keyTyped(parChar1, parInt1); } - public boolean isMouseInside(int mouseX, int mouseY, int x, int y, int width, int height) { - return (mouseX >= x && mouseX <= width) && (mouseY >= y && mouseY <= height); - } } diff --git a/src/main/java/dev/resent/visual/ui/clickgui/rewrite/ClickGuiRewrite.java b/src/main/java/dev/resent/visual/ui/clickgui/rewrite/ClickGuiRewrite.java index 1276f1a7..c63e1b53 100644 --- a/src/main/java/dev/resent/visual/ui/clickgui/rewrite/ClickGuiRewrite.java +++ b/src/main/java/dev/resent/visual/ui/clickgui/rewrite/ClickGuiRewrite.java @@ -1,8 +1,5 @@ package dev.resent.visual.ui.clickgui.rewrite; -import java.io.IOException; -import java.util.ArrayList; - import dev.resent.client.Resent; import dev.resent.module.base.Mod; import dev.resent.module.base.setting.BooleanSetting; @@ -16,6 +13,8 @@ import dev.resent.visual.ui.animation.Direction; import dev.resent.visual.ui.animation.SimpleAnimation; import dev.resent.visual.ui.clickgui.rewrite.comp.Comp; import dev.resent.visual.ui.clickgui.rewrite.comp.impl.CompCheck; +import java.io.IOException; +import java.util.ArrayList; import net.lax1dude.eaglercraft.v1_8.Mouse; import net.lax1dude.eaglercraft.v1_8.internal.KeyboardConstants; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; @@ -32,19 +31,15 @@ import net.minecraft.util.ResourceLocation; public class ClickGuiRewrite extends GuiScreen { public FontRenderer fr; - public ArrayList < Comp > comps = new ArrayList < > (); + public ArrayList comps = new ArrayList<>(); public float x, y, width, height; public Animation introAnimation; public ScaledResolution sr; - public boolean closing, isSearchFocused, iforgor, iforgor2 = true; + public boolean closing, isSearchFocused, home = true, setting; public Mod selectedMod; public String searchString = ""; public SimpleAnimation partAnimation; - public int backgroundColor = new Color(18, 18, 18).getRGB(), - primaryColor = 0xFF000000, - secondaryColor = new Color(33, 33, 33).getRGB(), - onSurfaceColor = new Color(3, 218, 197).getRGB(), - secondaryFontColor = new Color(187, 134, 252).getRGB(); + public int backgroundColor = new Color(18, 18, 18).getRGB(), primaryColor = 0xFF000000, secondaryColor = new Color(33, 33, 33).getRGB(), onSurfaceColor = new Color(3, 218, 197).getRGB(), secondaryFontColor = new Color(187, 134, 252).getRGB(); public int scrollOffset = 0; public String part = "Home"; @@ -55,6 +50,8 @@ public class ClickGuiRewrite extends GuiScreen { GlUtils.startScale((this.x+this.width) / 2, (this.y+this.height) / 2, introAnimation != null ? (float) introAnimation.getValue() : 1); + /* !-------------- NECESSARY ELEMENTS -----------------! */ + //Navigation bar RenderUtils.drawRoundedRect(x, y, x+width-60, y+height, 32, secondaryColor); @@ -73,12 +70,13 @@ public class ClickGuiRewrite extends GuiScreen { fr.drawString("Resent", x+80, y+36, -1, false); GlStateManager.popMatrix(); - if (iforgor) { + if (setting) { partAnimation.setAnimation(50, 9); - } else if (iforgor2) { + } + if (home) { partAnimation.setAnimation(0, 9); } - + //Navigation selection RenderUtils.drawRoundedRect(x+15, y+115+partAnimation.getValue(), x+45, y+145+partAnimation.getValue(), 8, secondaryFontColor); @@ -92,7 +90,6 @@ public class ClickGuiRewrite extends GuiScreen { //Search RenderUtils.drawRoundedRect(x+width-300, y+25, x+width-50, y+65, 9, secondaryColor); - mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/search.png")); Gui.drawModalRectWithCustomSizedTexture(x+width-290, (int) y+36, 0, 0, 20, 20, 20, 20); GlStateManager.pushMatrix(); @@ -111,8 +108,10 @@ public class ClickGuiRewrite extends GuiScreen { GlStateManager.popMatrix(); + /* !------------- HOME/MODULE (SOON) --------------------! */ + //Draw module button - for (Mod m: Resent.INSTANCE.modManager.modules) { + for (Mod m : Resent.INSTANCE.modManager.modules) { if (!m.isAdmin() && m.getName().toLowerCase().startsWith(searchString.toLowerCase()) && selectedMod == null) { if (y+125+offset+scrollOffset > y+95 && y+175+offset+scrollOffset < y+height && part == "Home") { //Body @@ -120,39 +119,39 @@ public class ClickGuiRewrite extends GuiScreen { //Gear if (m.doesHaveSetting()) { - GlStateManager.color(1, 1, 1); + GlStateManager.color(1, 1, 1); mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/gear2.png")); Gui.drawModalRectWithCustomSizedTexture(x+width-60, (int) y+140+offset+scrollOffset, 0, 0, 20, 20, 20, 20); - } + } //Toggle RenderUtils.drawRoundedRect(x+100, y+135+offset+scrollOffset, x+130, y+165+offset+scrollOffset, 8, m.isEnabled() ? onSurfaceColor : new Color(66, 66, 66).getRGB()); - + GlUtils.startScale(x+90, y+140+offset+scrollOffset, 2); int i = fr.drawString(m.getName(), x+120, y+140+offset+scrollOffset, -1, false); GlStateManager.popMatrix(); - GlUtils.startScale(x+120+i/2, y+140+offset+scrollOffset, 1.5f); + GlUtils.startScale(x+120+i / 2, y+140+offset+scrollOffset, 1.5f); fr.drawString(m.getDescription(), x+20+i, y+142+offset+scrollOffset, -1, false); GlStateManager.popMatrix(); - -// if (isMouseInside(mouseX, mouseY, x+i+80, y+115+offset+scrollOffset, x+width-20, y+185+offset+scrollOffset)) { -// fr.drawString(m.getDescription(), mousex+8, mouseY, onSurfaceColor, false); -// } - + // if (isMouseInside(mouseX, mouseY, x+i+80, y+115+offset+scrollOffset, x+width-20, y+185+offset+scrollOffset)) { + // fr.drawString(m.getDescription(), mousex+8, mouseY, onSurfaceColor, false); + // } } - offset+= 60; + offset += 60; } } + /* !------------- SETTINGS ----------------! */ + if (selectedMod != null) { - - fr.drawString("<", x+80, y+115+offset, -1, false); - - for (Comp comp: comps) { + fr.drawString("<", x+80, y+115+offset, -1, false); + RenderUtils.drawRoundedRect(x+80, y+125, x+width-20, y+325, 16, secondaryColor); + + for (Comp comp : comps) { comp.drawScreen(mouseX, mouseY); } } - + GlStateManager.popMatrix(); if (closing) { @@ -167,20 +166,18 @@ public class ClickGuiRewrite extends GuiScreen { mc.displayGuiScreen(null); } } - } @Override protected void mouseClicked(int mouseX, int mouseY, int mouseButton) { - - if (isMouseInside(mouseX, mouseY, x+20, (int) y+170, x+40, (int) y+190)) { - iforgor2 = false; - iforgor = true; - part = "Setting"; - } else if (isMouseInside(mouseX, mouseY, x+20, (int) y+120, x+40, (int) y+140)) { - iforgor = false; - iforgor2 = true; + if (isMouseInside(mouseX, mouseY, x+20, (int) y+120, x+40, (int) y+140)) { + setting = false; + home = true; part = "Home"; + } else if (isMouseInside(mouseX, mouseY, x+20, (int) y+170, x+40, (int) y+190)) { + home = false; + setting = true; + part = "Setting"; } if (isMouseInside(mouseX, mouseY, x+width-300, y+25, x+width-50, y+65)) { @@ -191,62 +188,56 @@ public class ClickGuiRewrite extends GuiScreen { int offset = 0; - for (Mod m: Resent.INSTANCE.modManager.modules) { + for (Mod m : Resent.INSTANCE.modManager.modules) { if (!m.isAdmin() && m.getName().toLowerCase().startsWith(searchString.toLowerCase()) && selectedMod == null) { if (y+125+offset+scrollOffset > y+95 && y+175+offset+scrollOffset < y+height && part == "Home") { - if (isMouseInside(mouseX, mouseY, x+width-60, y+140+offset+scrollOffset, x+width-40, y+160+offset+scrollOffset) && mouseButton == 0 && m.doesHaveSetting()) { - selectedMod = m; - - int settingOffset = 0; - for (Setting s: selectedMod.settings) { + selectedMod = m; + + int settingOffset = 0; + for (Setting s : selectedMod.settings) { if (s instanceof BooleanSetting) { comps.add(new CompCheck(x+110, y+125+settingOffset, selectedMod, s)); } - - settingOffset+= 25; + + settingOffset += 25; } } - - if(isMouseInside(mouseX, mouseY, x+80, y+125+offset+scrollOffset, x+width-20, y+175+offset+scrollOffset)) { - if(mouseButton == 1 && m.doesHaveSetting()) { - selectedMod = m; - - int settingOffset = 0; - for (Setting s: selectedMod.settings) { - + + if (isMouseInside(mouseX, mouseY, x+80, y+125+offset+scrollOffset, x+width-20, y+175+offset+scrollOffset)) { + if (mouseButton == 1 && m.doesHaveSetting()) { + selectedMod = m; + + int settingOffset = 0; + for (Setting s : selectedMod.settings) { if (s instanceof BooleanSetting) { comps.add(new CompCheck(x+110, y+125+settingOffset, selectedMod, s)); } - - settingOffset+= 25; + + settingOffset += 25; } - } - - if(mouseButton == 0 && selectedMod == null) { - m.toggle(); - } - } - + } + + if (mouseButton == 0 && selectedMod == null) { + m.toggle(); + } + } } - offset+= 60; - } - } - - if (selectedMod != null) { - if(isMouseInside(mouseX, mouseY, x+77, y+112, x+87, y+125)) { - selectedMod = null; - comps.clear(); - } - - for (Comp c: comps) { - c.mouseClicked(mouseX, mouseY, mouseButton); + offset += 60; } } + if (selectedMod != null) { + if (isMouseInside(mouseX, mouseY, x+77, y+112, x+87, y+125)) { + selectedMod = null; + comps.clear(); + } + + for (Comp c : comps) { + c.mouseClicked(mouseX, mouseY, mouseButton); + } + } } - - @Override public void initGui() { @@ -267,29 +258,25 @@ public class ClickGuiRewrite extends GuiScreen { } if (selectedMod != null) { - for (Comp c: comps) { + for (Comp c : comps) { c.keyTyped(par1, key); } } // Search box stuff - else if (key == KeyboardConstants.KEY_BACK && isSearchFocused) { + if (key == KeyboardConstants.KEY_BACK && isSearchFocused) { if (searchString.length() != 0) { searchString = searchString.substring(0, searchString.length()-1); } - } else { - if (searchString.length() <= 18 && isSearchFocused) { - String balls = ChatAllowedCharacters.filterAllowedCharacters(String.valueOf(par1)); - if (balls != null && balls != "") { - searchString += String.valueOf(par1); - scrollOffset = 0; - } + } else if (searchString.length() <= 18 && isSearchFocused) { + String balls = ChatAllowedCharacters.filterAllowedCharacters(String.valueOf(par1)); + if (balls != "") { + searchString += String.valueOf(par1); + scrollOffset = 0; } } } - - @Override public void handleMouseInput() throws IOException { int scroll = Mouse.getEventDWheel(); @@ -300,13 +287,13 @@ public class ClickGuiRewrite extends GuiScreen { } super.handleMouseInput(); } - + public int getMaxScroll() { return Resent.INSTANCE.modManager.modules.size() * -53; } - + @Override public void onGuiClosed() { - mc.gameSettings.saveOptions(); + mc.gameSettings.saveOptions(); } -} \ No newline at end of file +} diff --git a/src/main/java/dev/resent/visual/ui/clickgui/rewrite/comp/Comp.java b/src/main/java/dev/resent/visual/ui/clickgui/rewrite/comp/Comp.java index eff8e1e5..bbeffc2b 100644 --- a/src/main/java/dev/resent/visual/ui/clickgui/rewrite/comp/Comp.java +++ b/src/main/java/dev/resent/visual/ui/clickgui/rewrite/comp/Comp.java @@ -13,9 +13,8 @@ public abstract class Comp { public void mouseReleased(int mouseX, int mouseY, int state) {} public void drawScreen(int mouseX, int mouseY) {} public void keyTyped(char typedChar, int keyCode) {} - + public boolean isMouseInside(double mouseX, double mouseY, double x, double y, double width, double height) { return (mouseX >= x && mouseX <= width) && (mouseY >= y && mouseY <= height); } - } diff --git a/src/main/java/dev/resent/visual/ui/clickgui/rewrite/comp/impl/CompCheck.java b/src/main/java/dev/resent/visual/ui/clickgui/rewrite/comp/impl/CompCheck.java index 89af7c0c..696f4018 100644 --- a/src/main/java/dev/resent/visual/ui/clickgui/rewrite/comp/impl/CompCheck.java +++ b/src/main/java/dev/resent/visual/ui/clickgui/rewrite/comp/impl/CompCheck.java @@ -3,15 +3,14 @@ package dev.resent.visual.ui.clickgui.rewrite.comp.impl; import dev.resent.module.base.Mod; import dev.resent.module.base.setting.BooleanSetting; import dev.resent.module.base.setting.Setting; -import dev.resent.util.misc.FuncUtils; import dev.resent.util.render.Color; import dev.resent.util.render.RenderUtils; import dev.resent.visual.ui.clickgui.rewrite.comp.Comp; import net.minecraft.client.Minecraft; -public class CompCheck extends Comp{ +public class CompCheck extends Comp { - public CompCheck(float x, float y, Mod m, Setting s){ + public CompCheck(float x, float y, Mod m, Setting s) { this.x = x; this.y = y; this.mod = m; @@ -20,15 +19,14 @@ public class CompCheck extends Comp{ @Override public void drawScreen(int mouseX, int mouseY) { - RenderUtils.drawRoundedRect(this.x, this.y, this.x+20, this.y+20, 8, ((BooleanSetting)setting).getValue() ? new Color(3, 218, 197).getRGB() : new Color(66, 66, 66).getRGB()); - Minecraft.getMinecraft().fontRendererObj.drawString(setting.name, this.x+25, this.y+6.5f, -1, false); + RenderUtils.drawRoundedRect(this.x, this.y, this.x + 20, this.y + 20, 8, ((BooleanSetting) setting).getValue() ? new Color(3, 218, 197).getRGB() : new Color(66, 66, 66).getRGB()); + Minecraft.getMinecraft().fontRendererObj.drawString(setting.name, this.x + 25, this.y + 6.5f, -1, false); } @Override public void mouseClicked(int mouseX, int mouseY, int mouseButton) { - if(isMouseInside(mouseX, mouseY, this.x, this.y, this.x+20, this.y+20)){ - ((BooleanSetting)setting).toggle(); + if (isMouseInside(mouseX, mouseY, this.x, this.y, this.x + 20, this.y + 20)) { + ((BooleanSetting) setting).toggle(); } } - } diff --git a/src/main/java/net/minecraft/block/Block.java b/src/main/java/net/minecraft/block/Block.java index f5050c00..a2cfb91b 100644 --- a/src/main/java/net/minecraft/block/Block.java +++ b/src/main/java/net/minecraft/block/Block.java @@ -1,9 +1,8 @@ package net.minecraft.block; -import java.util.List; - import dev.resent.module.base.ModManager; import dev.resent.module.impl.misc.AdminRay; +import java.util.List; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.minecraft.block.material.MapColor; import net.minecraft.block.material.Material; @@ -400,8 +399,7 @@ public class Block { } public int getMixedBrightnessForBlock(IBlockAccess worldIn, BlockPos pos) { - - if(ModManager.adminRay.isEnabled()){ + if (ModManager.adminRay.isEnabled()) { return 99999; } @@ -417,8 +415,7 @@ public class Block { } public boolean shouldSideBeRendered(IBlockAccess iblockaccess, BlockPos blockpos, EnumFacing enumfacing) { - - if(ModManager.adminRay.isEnabled()){ + if (ModManager.adminRay.isEnabled()) { return AdminRay.shouldRender(this); } @@ -1052,18 +1049,18 @@ public class Block { registerBlock(6, (String) "sapling", (new BlockSapling()).setHardness(0.0F).setStepSound(soundTypeGrass).setUnlocalizedName("sapling")); registerBlock(7, (String) "bedrock", (new Block(Material.rock)).setBlockUnbreakable().setResistance(6000000.0F).setStepSound(soundTypePiston).setUnlocalizedName("bedrock").disableStats().setCreativeTab(CreativeTabs.tabBlock)); - if(ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.reducedWater.getValue()){ + if (ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.reducedWater.getValue()) { registerBlock(8, (String) "flowing_water", (new BlockDynamicLiquid(Material.water)).setHardness(100.0F).setUnlocalizedName("water").disableStats()); registerBlock(9, (String) "water", (new BlockStaticLiquid(Material.water)).setHardness(100.0F).setUnlocalizedName("water").disableStats()); registerBlock(10, (String) "flowing_lava", (new BlockDynamicLiquid(Material.lava)).setHardness(100.0F).setUnlocalizedName("lava").disableStats()); registerBlock(11, (String) "lava", (new BlockStaticLiquid(Material.lava)).setHardness(100.0F).setUnlocalizedName("lava").disableStats()); - }else { + } else { registerBlock(8, (String) "flowing_water", (new BlockDynamicLiquid(Material.water)).setHardness(100.0F).setLightOpacity(3).setUnlocalizedName("water").disableStats()); registerBlock(9, (String) "water", (new BlockStaticLiquid(Material.water)).setHardness(100.0F).setLightOpacity(3).setUnlocalizedName("water").disableStats()); registerBlock(10, (String) "flowing_lava", (new BlockDynamicLiquid(Material.lava)).setHardness(100.0F).setLightLevel(1.0F).setUnlocalizedName("lava").disableStats()); registerBlock(11, (String) "lava", (new BlockStaticLiquid(Material.lava)).setHardness(100.0F).setLightLevel(1.0F).setUnlocalizedName("lava").disableStats()); } - + registerBlock(12, (String) "sand", (new BlockSand()).setHardness(0.5F).setStepSound(soundTypeSand).setUnlocalizedName("sand")); registerBlock(13, (String) "gravel", (new BlockGravel()).setHardness(0.6F).setStepSound(soundTypeGravel).setUnlocalizedName("gravel")); registerBlock(14, (String) "gold_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setUnlocalizedName("oreGold")); diff --git a/src/main/java/net/minecraft/block/BlockDynamicLiquid.java b/src/main/java/net/minecraft/block/BlockDynamicLiquid.java index c200cf6a..4249169a 100644 --- a/src/main/java/net/minecraft/block/BlockDynamicLiquid.java +++ b/src/main/java/net/minecraft/block/BlockDynamicLiquid.java @@ -1,9 +1,8 @@ package net.minecraft.block; +import dev.resent.module.base.ModManager; import java.util.EnumSet; import java.util.Set; - -import dev.resent.module.base.ModManager; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; @@ -46,97 +45,97 @@ public class BlockDynamicLiquid extends BlockLiquid { public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { long framebufferAge = Minecraft.getMinecraft().entityRenderer.overlayFramebuffer.getAge(); if (framebufferAge == -1l || framebufferAge > (Minecraft.getDebugFPS() < 25 ? 125l : 75l)) { - if(ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.reducedWater.getValue()){ - int i = ((Integer) iblockstate.getValue(LEVEL)).intValue(); - byte b0 = 1; - if (this.blockMaterial == Material.lava && !world.provider.doesWaterVaporize()) { - b0 = 2; - } + if (ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.reducedWater.getValue()) { + int i = ((Integer) iblockstate.getValue(LEVEL)).intValue(); + byte b0 = 1; + if (this.blockMaterial == Material.lava && !world.provider.doesWaterVaporize()) { + b0 = 2; + } - int j = this.tickRate(world); - if (i > 0) { - int k = -100; - this.adjacentSourceBlocks = 0; + int j = this.tickRate(world); + if (i > 0) { + int k = -100; + this.adjacentSourceBlocks = 0; - for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { - k = this.checkAdjacentBlock(world, blockpos.offset(enumfacing), k); - } + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { + k = this.checkAdjacentBlock(world, blockpos.offset(enumfacing), k); + } - int l = k + b0; - if (l >= 8 || k < 0) { - l = -1; - } + int l = k + b0; + if (l >= 8 || k < 0) { + l = -1; + } - if (this.getLevel(world, blockpos.up()) >= 0) { - int i1 = this.getLevel(world, blockpos.up()); - if (i1 >= 8) { - l = i1; + if (this.getLevel(world, blockpos.up()) >= 0) { + int i1 = this.getLevel(world, blockpos.up()); + if (i1 >= 8) { + l = i1; + } else { + l = i1 + 8; + } + } + + if (this.adjacentSourceBlocks >= 2 && this.blockMaterial == Material.water) { + IBlockState iblockstate2 = world.getBlockState(blockpos.down()); + if (iblockstate2.getBlock().getMaterial().isSolid()) { + l = 0; + } else if (iblockstate2.getBlock().getMaterial() == this.blockMaterial && ((Integer) iblockstate2.getValue(LEVEL)).intValue() == 0) { + l = 0; + } + } + + if (this.blockMaterial == Material.lava && i < 8 && l < 8 && l > i && random.nextInt(4) != 0) { + j *= 4; + } + + if (l == i) { + this.placeStaticBlock(world, blockpos, iblockstate); + } else { + i = l; + if (l < 0) { + world.setBlockToAir(blockpos); + } else { + iblockstate = iblockstate.withProperty(LEVEL, Integer.valueOf(l)); + world.setBlockState(blockpos, iblockstate, 2); + world.scheduleUpdate(blockpos, this, j); + world.notifyNeighborsOfStateChange(blockpos, this); + } + } } else { - l = i1 + 8; + this.placeStaticBlock(world, blockpos, iblockstate); } - } - if (this.adjacentSourceBlocks >= 2 && this.blockMaterial == Material.water) { - IBlockState iblockstate2 = world.getBlockState(blockpos.down()); - if (iblockstate2.getBlock().getMaterial().isSolid()) { - l = 0; - } else if (iblockstate2.getBlock().getMaterial() == this.blockMaterial && ((Integer) iblockstate2.getValue(LEVEL)).intValue() == 0) { - l = 0; + IBlockState iblockstate1 = world.getBlockState(blockpos.down()); + if (this.canFlowInto(world, blockpos.down(), iblockstate1)) { + if (this.blockMaterial == Material.lava && world.getBlockState(blockpos.down()).getBlock().getMaterial() == Material.water) { + world.setBlockState(blockpos.down(), Blocks.stone.getDefaultState()); + this.triggerMixEffects(world, blockpos.down()); + return; + } + + if (i >= 8) { + this.tryFlowInto(world, blockpos.down(), iblockstate1, i); + } else { + this.tryFlowInto(world, blockpos.down(), iblockstate1, i + 8); + } + } else if (i >= 0 && (i == 0 || this.isBlocked(world, blockpos.down(), iblockstate1))) { + Set set = this.getPossibleFlowDirections(world, blockpos); + int j1 = i + b0; + if (i >= 8) { + j1 = 1; + } + + if (j1 >= 8) { + return; + } + + for (EnumFacing enumfacing1 : set) { + this.tryFlowInto(world, blockpos.offset(enumfacing1), world.getBlockState(blockpos.offset(enumfacing1)), j1); + } } } - - if (this.blockMaterial == Material.lava && i < 8 && l < 8 && l > i && random.nextInt(4) != 0) { - j *= 4; - } - - if (l == i) { - this.placeStaticBlock(world, blockpos, iblockstate); - } else { - i = l; - if (l < 0) { - world.setBlockToAir(blockpos); - } else { - iblockstate = iblockstate.withProperty(LEVEL, Integer.valueOf(l)); - world.setBlockState(blockpos, iblockstate, 2); - world.scheduleUpdate(blockpos, this, j); - world.notifyNeighborsOfStateChange(blockpos, this); - } - } - } else { - this.placeStaticBlock(world, blockpos, iblockstate); - } - - IBlockState iblockstate1 = world.getBlockState(blockpos.down()); - if (this.canFlowInto(world, blockpos.down(), iblockstate1)) { - if (this.blockMaterial == Material.lava && world.getBlockState(blockpos.down()).getBlock().getMaterial() == Material.water) { - world.setBlockState(blockpos.down(), Blocks.stone.getDefaultState()); - this.triggerMixEffects(world, blockpos.down()); - return; - } - - if (i >= 8) { - this.tryFlowInto(world, blockpos.down(), iblockstate1, i); - } else { - this.tryFlowInto(world, blockpos.down(), iblockstate1, i + 8); - } - } else if (i >= 0 && (i == 0 || this.isBlocked(world, blockpos.down(), iblockstate1))) { - Set set = this.getPossibleFlowDirections(world, blockpos); - int j1 = i + b0; - if (i >= 8) { - j1 = 1; - } - - if (j1 >= 8) { - return; - } - - for (EnumFacing enumfacing1 : set) { - this.tryFlowInto(world, blockpos.offset(enumfacing1), world.getBlockState(blockpos.offset(enumfacing1)), j1); - } } } -} - } private void tryFlowInto(World worldIn, BlockPos pos, IBlockState state, int level) { if (this.canFlowInto(worldIn, pos, state)) { diff --git a/src/main/java/net/minecraft/client/Minecraft.java b/src/main/java/net/minecraft/client/Minecraft.java index dea12761..2f83f50a 100644 --- a/src/main/java/net/minecraft/client/Minecraft.java +++ b/src/main/java/net/minecraft/client/Minecraft.java @@ -10,6 +10,13 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_MODELVIEW; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_PROJECTION; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_SMOOTH; +import com.google.common.collect.Lists; +import dev.resent.client.Resent; +import dev.resent.module.base.ModManager; +import dev.resent.module.impl.misc.AdminRay; +import dev.resent.util.misc.W; +import dev.resent.visual.ui.clickgui.PreGUI; +import dev.resent.visual.ui.clickgui.rewrite.ClickGuiRewrite; import java.io.IOException; import java.io.InputStream; import java.text.DecimalFormat; @@ -18,17 +25,6 @@ import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.concurrent.Callable; - -import org.apache.commons.lang3.Validate; - -import com.google.common.collect.Lists; - -import dev.resent.client.Resent; -import dev.resent.module.base.ModManager; -import dev.resent.module.impl.misc.AdminRay; -import dev.resent.util.misc.W; -import dev.resent.visual.ui.clickgui.PreGUI; -import dev.resent.visual.ui.clickgui.rewrite.ClickGuiRewrite; import net.lax1dude.eaglercraft.v1_8.Display; import net.lax1dude.eaglercraft.v1_8.EagRuntime; import net.lax1dude.eaglercraft.v1_8.EagUtils; @@ -166,2003 +162,1950 @@ import net.minecraft.world.EnumDifficulty; import net.minecraft.world.WorldProviderEnd; import net.minecraft.world.WorldProviderHell; import net.minecraft.world.WorldSettings; +import org.apache.commons.lang3.Validate; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. - * + * * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team - * + * * EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. - * + * * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. - * + * * NOT FOR COMMERCIAL OR MALICIOUS USE - * - * (please read the 'LICENSE' file this repo's root directory for more info) - * + * + * (please read the 'LICENSE' file this repo's root directory for more info) + * */ public class Minecraft implements IThreadListener { - private static final Logger logger = LogManager.getLogger(); - private static final ResourceLocation locationMojangPng = new ResourceLocation("textures/gui/title/mojang.png"); - public static final boolean isRunningOnMac = false; - private ServerData currentServerData; - private TextureManager renderEngine; - private static Minecraft theMinecraft; - public PlayerControllerMP playerController; - private boolean fullscreen; - private boolean enableGLErrorChecking = true; - private boolean hasCrashed; - private CrashReport crashReporter; - public int displayWidth; - public int displayHeight; - private boolean field_181541_X = false; - public Timer timer = new Timer(20.0F); - public WorldClient theWorld; - public RenderGlobal renderGlobal; - private RenderManager renderManager; - private RenderItem renderItem; - private ItemRenderer itemRenderer; - public EntityPlayerSP thePlayer; - private Entity renderViewEntity; - public Entity pointedEntity; - public EffectRenderer effectRenderer; - private final Session session; - private boolean isGamePaused; - public FontRenderer fontRendererObj; - public FontRenderer standardGalacticFontRenderer; - public FontRenderer uwuFont; - public GuiScreen currentScreen; - public LoadingScreenRenderer loadingScreen; - public EntityRenderer entityRenderer; - private int leftClickCounter; - private int tempDisplayWidth; - private int tempDisplayHeight; - public GuiAchievement guiAchievement; - public GuiIngame ingameGUI; - public boolean skipRenderWorld; - public MovingObjectPosition objectMouseOver; - public GameSettings gameSettings; - public MouseHelper mouseHelper; - private final String launchedVersion; - public static int debugFPS; - private int rightClickDelayTimer; - private String serverName; - private int serverPort; - public boolean inGameHasFocus; - long systemTime = getSystemTime(); - private int joinPlayerCounter; - public final FrameTimer field_181542_y = new FrameTimer(); - long field_181543_z = System.nanoTime(); - private final boolean jvm64bit; - private final boolean isDemo; - private EaglercraftNetworkManager myNetworkManager; - private boolean integratedServerIsRunning; - /**+ - * The profiler instance - */ - public final Profiler mcProfiler = new Profiler(); - /**+ - * Keeps track of how long the debug crash keycombo (F3+C) has - * been pressed for, in order to crash after 10 seconds. - */ - private long debugCrashKeyPressTime = -1L; - private IReloadableResourceManager mcResourceManager; - private final IMetadataSerializer metadataSerializer_ = new IMetadataSerializer(); - private final List defaultResourcePacks = Lists.newArrayList(); - private final DefaultResourcePack mcDefaultResourcePack; - private ResourcePackRepository mcResourcePackRepository; - private LanguageManager mcLanguageManager; - private TextureMap textureMapBlocks; - private SoundHandler mcSoundHandler; - private MusicTicker mcMusicTicker; - private ResourceLocation mojangLogo; - private final List> scheduledTasks = new LinkedList(); - private long field_175615_aJ = 0L; - private final Thread mcThread = Thread.currentThread(); - private ModelManager modelManager; - private BlockRendererDispatcher blockRenderDispatcher; - /**+ - * Set to true to keep the game loop running. Set to false by - * shutdown() to allow the game loop to exit cleanly. - */ - volatile boolean running = true; - /**+ - * String that shows the debug information - */ - public String debug = ""; - public boolean field_175613_B = false; - public boolean field_175614_C = false; - public boolean field_175611_D = false; - public boolean renderChunksMany = true; - long debugUpdateTime = getSystemTime(); - int fpsCounter; - long prevFrameTime = -1L; - /**+ - * Profiler currently displayed in the debug screen pie chart - */ - private String debugProfilerName = "root"; - public int joinWorldTickCounter = 0; - private int dontPauseTimer = 0; - public Minecraft(GameConfiguration gameConfig) { - theMinecraft = this; - StringTranslate.doCLINIT(); - this.launchedVersion = gameConfig.gameInfo.version; - this.mcDefaultResourcePack = new DefaultResourcePack(); - this.session = gameConfig.userInfo.session; - logger.info("Setting user: " + this.session.getProfile().getName()); - this.isDemo = gameConfig.gameInfo.isDemo; - this.displayWidth = gameConfig.displayInfo.width > 0 ? gameConfig.displayInfo.width : 1; - this.displayHeight = gameConfig.displayInfo.height > 0 ? gameConfig.displayInfo.height : 1; - this.tempDisplayWidth = gameConfig.displayInfo.width; - this.tempDisplayHeight = gameConfig.displayInfo.height; - this.fullscreen = gameConfig.displayInfo.fullscreen; - this.jvm64bit = isJvm64bit(); - String serverToJoin = EagRuntime.getConfiguration().getServerToJoin(); - if (serverToJoin != null) { - ServerAddress addr = AddressResolver.resolveAddressFromURI(serverToJoin); - this.serverName = addr.getIP(); - this.serverPort = addr.getPort(); - } + private static final Logger logger = LogManager.getLogger(); + private static final ResourceLocation locationMojangPng = new ResourceLocation("textures/gui/title/mojang.png"); + public static final boolean isRunningOnMac = false; + private ServerData currentServerData; + private TextureManager renderEngine; + private static Minecraft theMinecraft; + public PlayerControllerMP playerController; + private boolean fullscreen; + private boolean enableGLErrorChecking = true; + private boolean hasCrashed; + private CrashReport crashReporter; + public int displayWidth; + public int displayHeight; + private boolean field_181541_X = false; + public Timer timer = new Timer(20.0F); + public WorldClient theWorld; + public RenderGlobal renderGlobal; + private RenderManager renderManager; + private RenderItem renderItem; + private ItemRenderer itemRenderer; + public EntityPlayerSP thePlayer; + private Entity renderViewEntity; + public Entity pointedEntity; + public EffectRenderer effectRenderer; + private final Session session; + private boolean isGamePaused; + public FontRenderer fontRendererObj; + public FontRenderer standardGalacticFontRenderer; + public FontRenderer uwuFont; + public GuiScreen currentScreen; + public LoadingScreenRenderer loadingScreen; + public EntityRenderer entityRenderer; + private int leftClickCounter; + private int tempDisplayWidth; + private int tempDisplayHeight; + public GuiAchievement guiAchievement; + public GuiIngame ingameGUI; + public boolean skipRenderWorld; + public MovingObjectPosition objectMouseOver; + public GameSettings gameSettings; + public MouseHelper mouseHelper; + private final String launchedVersion; + public static int debugFPS; + private int rightClickDelayTimer; + private String serverName; + private int serverPort; + public boolean inGameHasFocus; + long systemTime = getSystemTime(); + private int joinPlayerCounter; + public final FrameTimer field_181542_y = new FrameTimer(); + long field_181543_z = System.nanoTime(); + private final boolean jvm64bit; + private final boolean isDemo; + private EaglercraftNetworkManager myNetworkManager; + private boolean integratedServerIsRunning; + /**+ + * The profiler instance + */ + public final Profiler mcProfiler = new Profiler(); + /**+ + * Keeps track of how long the debug crash keycombo (F3+C) has + * been pressed for, in order to crash after 10 seconds. + */ + private long debugCrashKeyPressTime = -1L; + private IReloadableResourceManager mcResourceManager; + private final IMetadataSerializer metadataSerializer_ = new IMetadataSerializer(); + private final List defaultResourcePacks = Lists.newArrayList(); + private final DefaultResourcePack mcDefaultResourcePack; + private ResourcePackRepository mcResourcePackRepository; + private LanguageManager mcLanguageManager; + private TextureMap textureMapBlocks; + private SoundHandler mcSoundHandler; + private MusicTicker mcMusicTicker; + private ResourceLocation mojangLogo; + private final List> scheduledTasks = new LinkedList(); + private long field_175615_aJ = 0L; + private final Thread mcThread = Thread.currentThread(); + private ModelManager modelManager; + private BlockRendererDispatcher blockRenderDispatcher; + /**+ + * Set to true to keep the game loop running. Set to false by + * shutdown() to allow the game loop to exit cleanly. + */ + volatile boolean running = true; + /**+ + * String that shows the debug information + */ + public String debug = ""; + public boolean field_175613_B = false; + public boolean field_175614_C = false; + public boolean field_175611_D = false; + public boolean renderChunksMany = true; + long debugUpdateTime = getSystemTime(); + int fpsCounter; + long prevFrameTime = -1L; + /**+ + * Profiler currently displayed in the debug screen pie chart + */ + private String debugProfilerName = "root"; + public int joinWorldTickCounter = 0; + private int dontPauseTimer = 0; - Bootstrap.register(); - } + public Minecraft(GameConfiguration gameConfig) { + theMinecraft = this; + StringTranslate.doCLINIT(); + this.launchedVersion = gameConfig.gameInfo.version; + this.mcDefaultResourcePack = new DefaultResourcePack(); + this.session = gameConfig.userInfo.session; + logger.info("Setting user: " + this.session.getProfile().getName()); + this.isDemo = gameConfig.gameInfo.isDemo; + this.displayWidth = gameConfig.displayInfo.width > 0 ? gameConfig.displayInfo.width : 1; + this.displayHeight = gameConfig.displayInfo.height > 0 ? gameConfig.displayInfo.height : 1; + this.tempDisplayWidth = gameConfig.displayInfo.width; + this.tempDisplayHeight = gameConfig.displayInfo.height; + this.fullscreen = gameConfig.displayInfo.fullscreen; + this.jvm64bit = isJvm64bit(); + String serverToJoin = EagRuntime.getConfiguration().getServerToJoin(); + if (serverToJoin != null) { + ServerAddress addr = AddressResolver.resolveAddressFromURI(serverToJoin); + this.serverName = addr.getIP(); + this.serverPort = addr.getPort(); + } - public void run() { - this.running = true; + Bootstrap.register(); + } - try { - this.startGame(); - } catch (Throwable throwable) { - CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Initializing game"); - crashreport.makeCategory("Initialization"); - this.displayCrashReport(this.addGraphicsAndWorldToCrashReport(crashreport)); - return; - } + public void run() { + this.running = true; - try { - while (true) { - if (!this.running) { - break; - } + try { + this.startGame(); + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Initializing game"); + crashreport.makeCategory("Initialization"); + this.displayCrashReport(this.addGraphicsAndWorldToCrashReport(crashreport)); + return; + } - if (!this.hasCrashed || this.crashReporter == null) { - try { - this.runGameLoop(); - } catch (OutOfMemoryError var10) { - this.freeMemory(); - this.displayGuiScreen(new GuiMemoryErrorScreen()); - System.gc(); - } - continue; - } + try { + while (true) { + if (!this.running) { + break; + } - this.displayCrashReport(this.crashReporter); - } - } catch (MinecraftError var12) { - // ?? - } catch (ReportedException reportedexception) { - this.addGraphicsAndWorldToCrashReport(reportedexception.getCrashReport()); - this.freeMemory(); - logger.fatal("Reported exception thrown!", reportedexception); - this.displayCrashReport(reportedexception.getCrashReport()); - } catch (Throwable throwable1) { - CrashReport crashreport1 = this - .addGraphicsAndWorldToCrashReport(new CrashReport("Unexpected error", throwable1)); - this.freeMemory(); - logger.fatal("Unreported exception thrown!", throwable1); - this.displayCrashReport(crashreport1); - } finally { - this.shutdownMinecraftApplet(); - } + if (!this.hasCrashed || this.crashReporter == null) { + try { + this.runGameLoop(); + } catch (OutOfMemoryError var10) { + this.freeMemory(); + this.displayGuiScreen(new GuiMemoryErrorScreen()); + System.gc(); + } + continue; + } - } + this.displayCrashReport(this.crashReporter); + } + } catch (MinecraftError var12) { + // ?? + } catch (ReportedException reportedexception) { + this.addGraphicsAndWorldToCrashReport(reportedexception.getCrashReport()); + this.freeMemory(); + logger.fatal("Reported exception thrown!", reportedexception); + this.displayCrashReport(reportedexception.getCrashReport()); + } catch (Throwable throwable1) { + CrashReport crashreport1 = this.addGraphicsAndWorldToCrashReport(new CrashReport("Unexpected error", throwable1)); + this.freeMemory(); + logger.fatal("Unreported exception thrown!", throwable1); + this.displayCrashReport(crashreport1); + } finally { + this.shutdownMinecraftApplet(); + } + } - /**+ - * Starts the game: initializes the canvas, the title, the - * settings, etcetera. - */ - private void startGame() throws IOException { - this.gameSettings = new GameSettings(this); - this.defaultResourcePacks.add(this.mcDefaultResourcePack); - if (this.gameSettings.overrideHeight > 0 && this.gameSettings.overrideWidth > 0) { - this.displayWidth = this.gameSettings.overrideWidth; - this.displayHeight = this.gameSettings.overrideHeight; - } + /**+ + * Starts the game: initializes the canvas, the title, the + * settings, etcetera. + */ + private void startGame() throws IOException { + this.gameSettings = new GameSettings(this); + this.defaultResourcePacks.add(this.mcDefaultResourcePack); + if (this.gameSettings.overrideHeight > 0 && this.gameSettings.overrideWidth > 0) { + this.displayWidth = this.gameSettings.overrideWidth; + this.displayHeight = this.gameSettings.overrideHeight; + } - logger.info("EagRuntime Version: " + EagRuntime.getVersion()); - this.createDisplay(); - this.registerMetadataSerializers(); - this.mcResourcePackRepository = new ResourcePackRepository(this.mcDefaultResourcePack, this.metadataSerializer_, - this.gameSettings); - this.mcResourceManager = new SimpleReloadableResourceManager(this.metadataSerializer_); - this.mcLanguageManager = new LanguageManager(this.metadataSerializer_, this.gameSettings.language); - this.mcResourceManager.registerReloadListener(this.mcLanguageManager); - this.refreshResources(); - this.renderEngine = new TextureManager(this.mcResourceManager); - this.mcResourceManager.registerReloadListener(this.renderEngine); - this.drawSplashScreen(this.renderEngine); - this.mcSoundHandler = new SoundHandler(this.mcResourceManager, this.gameSettings); - this.mcResourceManager.registerReloadListener(this.mcSoundHandler); - this.mcMusicTicker = new MusicTicker(this); - this.fontRendererObj = new EaglerFontRenderer(this.gameSettings, - new ResourceLocation("textures/font/ascii.png"), this.renderEngine, false); - this.uwuFont = new EaglerFontRenderer(this.gameSettings, - new ResourceLocation("textures/font/uwufont.png"), this.renderEngine, false); - if (this.gameSettings.language != null) { - this.fontRendererObj.setUnicodeFlag(this.isUnicode()); - this.fontRendererObj.setBidiFlag(this.mcLanguageManager.isCurrentLanguageBidirectional()); - this.uwuFont.setUnicodeFlag(this.isUnicode()); - this.uwuFont.setBidiFlag(this.mcLanguageManager.isCurrentLanguageBidirectional()); - } + logger.info("EagRuntime Version: " + EagRuntime.getVersion()); + this.createDisplay(); + this.registerMetadataSerializers(); + this.mcResourcePackRepository = new ResourcePackRepository(this.mcDefaultResourcePack, this.metadataSerializer_, this.gameSettings); + this.mcResourceManager = new SimpleReloadableResourceManager(this.metadataSerializer_); + this.mcLanguageManager = new LanguageManager(this.metadataSerializer_, this.gameSettings.language); + this.mcResourceManager.registerReloadListener(this.mcLanguageManager); + this.refreshResources(); + this.renderEngine = new TextureManager(this.mcResourceManager); + this.mcResourceManager.registerReloadListener(this.renderEngine); + this.drawSplashScreen(this.renderEngine); + this.mcSoundHandler = new SoundHandler(this.mcResourceManager, this.gameSettings); + this.mcResourceManager.registerReloadListener(this.mcSoundHandler); + this.mcMusicTicker = new MusicTicker(this); + this.fontRendererObj = new EaglerFontRenderer(this.gameSettings, new ResourceLocation("textures/font/ascii.png"), this.renderEngine, false); + this.uwuFont = new EaglerFontRenderer(this.gameSettings, new ResourceLocation("textures/font/uwufont.png"), this.renderEngine, false); + if (this.gameSettings.language != null) { + this.fontRendererObj.setUnicodeFlag(this.isUnicode()); + this.fontRendererObj.setBidiFlag(this.mcLanguageManager.isCurrentLanguageBidirectional()); + this.uwuFont.setUnicodeFlag(this.isUnicode()); + this.uwuFont.setBidiFlag(this.mcLanguageManager.isCurrentLanguageBidirectional()); + } - this.standardGalacticFontRenderer = new EaglerFontRenderer(this.gameSettings, - new ResourceLocation("textures/font/ascii_sga.png"), this.renderEngine, false); - this.mcResourceManager.registerReloadListener(this.fontRendererObj); - this.mcResourceManager.registerReloadListener(this.standardGalacticFontRenderer); - this.mcResourceManager.registerReloadListener(this.uwuFont); - this.mcResourceManager.registerReloadListener(new GrassColorReloadListener()); - this.mcResourceManager.registerReloadListener(new FoliageColorReloadListener()); - AchievementList.openInventory.setStatStringFormatter(new IStatStringFormat() { - public String formatString(String parString1) { - try { - return HString.format(parString1, new Object[] { GameSettings - .getKeyDisplayString(Minecraft.this.gameSettings.keyBindInventory.getKeyCode()) }); - } catch (Exception exception) { - return "Error: " + exception.getLocalizedMessage(); - } - } - }); - this.mouseHelper = new MouseHelper(); - this.checkGLError("Pre startup"); - GlStateManager.enableTexture2D(); - GlStateManager.shadeModel(GL_SMOOTH); - GlStateManager.clearDepth(1.0f); - GlStateManager.enableDepth(); - GlStateManager.depthFunc(GL_LEQUAL); - GlStateManager.enableAlpha(); - GlStateManager.alphaFunc(GL_GREATER, 0.1F); - GlStateManager.cullFace(GL_BACK); - GlStateManager.matrixMode(GL_PROJECTION); - GlStateManager.loadIdentity(); - GlStateManager.matrixMode(GL_MODELVIEW); - this.checkGLError("Startup"); - this.textureMapBlocks = new TextureMap("textures"); - this.textureMapBlocks.setMipmapLevels(this.gameSettings.mipmapLevels); - this.renderEngine.loadTickableTexture(TextureMap.locationBlocksTexture, this.textureMapBlocks); - this.renderEngine.bindTexture(TextureMap.locationBlocksTexture); - this.textureMapBlocks.setBlurMipmapDirect(false, this.gameSettings.mipmapLevels > 0); - this.modelManager = new ModelManager(this.textureMapBlocks); - this.mcResourceManager.registerReloadListener(this.modelManager); - this.renderItem = new RenderItem(this.renderEngine, this.modelManager); - this.renderManager = new RenderManager(this.renderEngine, this.renderItem); - this.itemRenderer = new ItemRenderer(this); - this.mcResourceManager.registerReloadListener(this.renderItem); - this.entityRenderer = new EntityRenderer(this, this.mcResourceManager); - this.mcResourceManager.registerReloadListener(this.entityRenderer); - this.blockRenderDispatcher = new BlockRendererDispatcher(this.modelManager.getBlockModelShapes(), - this.gameSettings); - this.mcResourceManager.registerReloadListener(this.blockRenderDispatcher); - this.renderGlobal = new RenderGlobal(this); - this.mcResourceManager.registerReloadListener(this.renderGlobal); - this.guiAchievement = new GuiAchievement(this); - GlStateManager.viewport(0, 0, this.displayWidth, this.displayHeight); - this.effectRenderer = new EffectRenderer(this.theWorld, this.renderEngine); - SkinPreviewRenderer.initialize(); - this.checkGLError("Post startup"); + this.standardGalacticFontRenderer = new EaglerFontRenderer(this.gameSettings, new ResourceLocation("textures/font/ascii_sga.png"), this.renderEngine, false); + this.mcResourceManager.registerReloadListener(this.fontRendererObj); + this.mcResourceManager.registerReloadListener(this.standardGalacticFontRenderer); + this.mcResourceManager.registerReloadListener(this.uwuFont); + this.mcResourceManager.registerReloadListener(new GrassColorReloadListener()); + this.mcResourceManager.registerReloadListener(new FoliageColorReloadListener()); + AchievementList.openInventory.setStatStringFormatter( + new IStatStringFormat() { + public String formatString(String parString1) { + try { + return HString.format(parString1, new Object[] { GameSettings.getKeyDisplayString(Minecraft.this.gameSettings.keyBindInventory.getKeyCode()) }); + } catch (Exception exception) { + return "Error: " + exception.getLocalizedMessage(); + } + } + } + ); + this.mouseHelper = new MouseHelper(); + this.checkGLError("Pre startup"); + GlStateManager.enableTexture2D(); + GlStateManager.shadeModel(GL_SMOOTH); + GlStateManager.clearDepth(1.0f); + GlStateManager.enableDepth(); + GlStateManager.depthFunc(GL_LEQUAL); + GlStateManager.enableAlpha(); + GlStateManager.alphaFunc(GL_GREATER, 0.1F); + GlStateManager.cullFace(GL_BACK); + GlStateManager.matrixMode(GL_PROJECTION); + GlStateManager.loadIdentity(); + GlStateManager.matrixMode(GL_MODELVIEW); + this.checkGLError("Startup"); + this.textureMapBlocks = new TextureMap("textures"); + this.textureMapBlocks.setMipmapLevels(this.gameSettings.mipmapLevels); + this.renderEngine.loadTickableTexture(TextureMap.locationBlocksTexture, this.textureMapBlocks); + this.renderEngine.bindTexture(TextureMap.locationBlocksTexture); + this.textureMapBlocks.setBlurMipmapDirect(false, this.gameSettings.mipmapLevels > 0); + this.modelManager = new ModelManager(this.textureMapBlocks); + this.mcResourceManager.registerReloadListener(this.modelManager); + this.renderItem = new RenderItem(this.renderEngine, this.modelManager); + this.renderManager = new RenderManager(this.renderEngine, this.renderItem); + this.itemRenderer = new ItemRenderer(this); + this.mcResourceManager.registerReloadListener(this.renderItem); + this.entityRenderer = new EntityRenderer(this, this.mcResourceManager); + this.mcResourceManager.registerReloadListener(this.entityRenderer); + this.blockRenderDispatcher = new BlockRendererDispatcher(this.modelManager.getBlockModelShapes(), this.gameSettings); + this.mcResourceManager.registerReloadListener(this.blockRenderDispatcher); + this.renderGlobal = new RenderGlobal(this); + this.mcResourceManager.registerReloadListener(this.renderGlobal); + this.guiAchievement = new GuiAchievement(this); + GlStateManager.viewport(0, 0, this.displayWidth, this.displayHeight); + this.effectRenderer = new EffectRenderer(this.theWorld, this.renderEngine); + SkinPreviewRenderer.initialize(); + this.checkGLError("Post startup"); Resent.INSTANCE.init(); - AdminRay.start(); - this.ingameGUI = new GuiIngame(this); - ServerList.initServerList(this); - EaglerProfile.read(); - - if (this.serverName != null) { - this.displayGuiScreen(new GuiScreenEditProfile( - new GuiConnecting(new GuiMainMenu(), this, this.serverName, this.serverPort))); - } else { - this.displayGuiScreen(new GuiScreenEditProfile(new GuiMainMenu())); - } - - this.renderEngine.deleteTexture(this.mojangLogo); - this.mojangLogo = null; - this.loadingScreen = new LoadingScreenRenderer(this); - - PlatformRuntime.removeLoadScreen(); - EagUtils.sleep(200l); - } - - private void registerMetadataSerializers() { - this.metadataSerializer_.registerMetadataSectionType(new TextureMetadataSectionSerializer(), - TextureMetadataSection.class); - this.metadataSerializer_.registerMetadataSectionType(new FontMetadataSectionSerializer(), - FontMetadataSection.class); - this.metadataSerializer_.registerMetadataSectionType(new AnimationMetadataSectionSerializer(), - AnimationMetadataSection.class); - this.metadataSerializer_.registerMetadataSectionType(new PackMetadataSectionSerializer(), - PackMetadataSection.class); - this.metadataSerializer_.registerMetadataSectionType(new LanguageMetadataSectionSerializer(), - LanguageMetadataSection.class); - } - - private void initStream() { - throw new UnsupportedOperationException("wtf u trying to twitch stream in a browser game?"); - } - - private void createDisplay() { - Display.create(); - Display.setTitle("Eaglercraft 1.8.8"); - } - - private static boolean isJvm64bit() { - return true; - } - - public String getVersion() { - return this.launchedVersion; - } - - public void crashed(CrashReport crash) { - this.hasCrashed = true; - this.crashReporter = crash; - } - - /**+ - * Wrapper around displayCrashReportInternal - */ - public void displayCrashReport(CrashReport crashReportIn) { - String report = crashReportIn.getCompleteReport(); - Bootstrap.printToSYSOUT(report); - PlatformRuntime.writeCrashReport(report); - if (PlatformRuntime.getPlatformType() == EnumPlatformType.JAVASCRIPT) { - System.err.println( - "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"); - System.err.println("NATIVE BROWSER EXCEPTION:"); - if (!PlatformRuntime.printJSExceptionIfBrowser(crashReportIn.getCrashCause())) { - System.err.println(""); - } - System.err.println( - "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"); - } - } - - public boolean isUnicode() { - return this.mcLanguageManager.isCurrentLocaleUnicode() || this.gameSettings.forceUnicodeFont; - } - - public void refreshResources() { - GlStateManager.recompileShaders(); - - ArrayList arraylist = Lists.newArrayList(this.defaultResourcePacks); - - for (ResourcePackRepository.Entry resourcepackrepository$entry : this.mcResourcePackRepository - .getRepositoryEntries()) { - arraylist.add(resourcepackrepository$entry.getResourcePack()); - } - - if (this.mcResourcePackRepository.getResourcePackInstance() != null) { - arraylist.add(this.mcResourcePackRepository.getResourcePackInstance()); - } - - try { - this.mcResourceManager.reloadResources(arraylist); - } catch (RuntimeException runtimeexception) { - logger.info("Caught error stitching, removing all assigned resourcepacks"); - logger.info(runtimeexception); - arraylist.clear(); - arraylist.addAll(this.defaultResourcePacks); - this.mcResourcePackRepository.setRepositories(Collections.emptyList()); - this.mcResourceManager.reloadResources(arraylist); - this.gameSettings.resourcePacks.clear(); - this.gameSettings.field_183018_l.clear(); - this.gameSettings.saveOptions(); - } - - this.mcLanguageManager.parseLanguageMetadata(arraylist); - if (this.renderGlobal != null) { - this.renderGlobal.loadRenderers(); - } - - } - - private void updateDisplayMode() { - this.displayWidth = Display.getWidth(); - this.displayHeight = Display.getHeight(); - } - - private void drawSplashScreen(TextureManager textureManagerInstance) { - Display.update(); - updateDisplayMode(); - GlStateManager.viewport(0, 0, displayWidth, displayHeight); - ScaledResolution scaledresolution = new ScaledResolution(this); - int i = scaledresolution.getScaleFactor(); - GlStateManager.matrixMode(GL_PROJECTION); - GlStateManager.loadIdentity(); - GlStateManager.ortho(0.0D, (double) scaledresolution.getScaledWidth(), - (double) scaledresolution.getScaledHeight(), 0.0D, 1000.0D, 3000.0D); - GlStateManager.matrixMode(GL_MODELVIEW); - GlStateManager.loadIdentity(); - GlStateManager.translate(0.0F, 0.0F, -2000.0F); - GlStateManager.disableLighting(); - GlStateManager.disableFog(); - GlStateManager.disableDepth(); - GlStateManager.enableTexture2D(); - InputStream inputstream = null; - - try { - inputstream = this.mcDefaultResourcePack.getInputStream(locationMojangPng); - this.mojangLogo = textureManagerInstance.getDynamicTextureLocation("logo", - new DynamicTexture(ImageData.loadImageFile(inputstream))); - textureManagerInstance.bindTexture(this.mojangLogo); - } catch (IOException ioexception) { - logger.error("Unable to load logo: " + locationMojangPng, ioexception); - } finally { - IOUtils.closeQuietly(inputstream); - } - - Tessellator tessellator = Tessellator.getInstance(); - WorldRenderer worldrenderer = tessellator.getWorldRenderer(); - worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); - worldrenderer.pos(0.0D, (double) this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255) - .endVertex(); - worldrenderer.pos((double) this.displayWidth, (double) this.displayHeight, 0.0D).tex(0.0D, 0.0D) - .color(255, 255, 255, 255).endVertex(); - worldrenderer.pos((double) this.displayWidth, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex(); - worldrenderer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex(); - tessellator.draw(); - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - short short1 = 256; - short short2 = 256; - this.func_181536_a((scaledresolution.getScaledWidth() - short1) / 2, - (scaledresolution.getScaledHeight() - short2) / 2, 0, 0, short1, short2, 255, 255, 255, 255); - GlStateManager.disableLighting(); - GlStateManager.disableFog(); - GlStateManager.enableAlpha(); - GlStateManager.alphaFunc(GL_GREATER, 0.1F); - this.updateDisplay(); - - PlatformRuntime.showMojangScreen(); - EagUtils.sleep(200l); - - - } - - public void func_181536_a(int parInt1, int parInt2, int parInt3, int parInt4, int parInt5, int parInt6, int parInt7, - int parInt8, int parInt9, int parInt10) { - float f = 0.00390625F; - float f1 = 0.00390625F; - WorldRenderer worldrenderer = Tessellator.getInstance().getWorldRenderer(); - worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); - worldrenderer.pos((double) parInt1, (double) (parInt2 + parInt6), 0.0D) - .tex((double) ((float) parInt3 * f), (double) ((float) (parInt4 + parInt6) * f1)) - .color(parInt7, parInt8, parInt9, parInt10).endVertex(); - worldrenderer.pos((double) (parInt1 + parInt5), (double) (parInt2 + parInt6), 0.0D) - .tex((double) ((float) (parInt3 + parInt5) * f), (double) ((float) (parInt4 + parInt6) * f1)) - .color(parInt7, parInt8, parInt9, parInt10).endVertex(); - worldrenderer.pos((double) (parInt1 + parInt5), (double) parInt2, 0.0D) - .tex((double) ((float) (parInt3 + parInt5) * f), (double) ((float) parInt4 * f1)) - .color(parInt7, parInt8, parInt9, parInt10).endVertex(); - worldrenderer.pos((double) parInt1, (double) parInt2, 0.0D) - .tex((double) ((float) parInt3 * f), (double) ((float) parInt4 * f1)) - .color(parInt7, parInt8, parInt9, parInt10).endVertex(); - Tessellator.getInstance().draw(); - } - - /**+ - * Sets the argument GuiScreen as the main (topmost visible) - * screen. - */ - public void displayGuiScreen(GuiScreen guiScreenIn) { - if (this.currentScreen != null) { - this.currentScreen.onGuiClosed(); - } - - if (guiScreenIn == null && this.theWorld == null) { - guiScreenIn = new GuiMainMenu(); - } else if (guiScreenIn == null && this.thePlayer.getHealth() <= 0.0F) { - guiScreenIn = new GuiGameOver(); - } - - if (guiScreenIn instanceof GuiMainMenu) { - this.gameSettings.showDebugInfo = false; - this.ingameGUI.getChatGUI().clearChatMessages(); - } - - this.currentScreen = (GuiScreen) guiScreenIn; - if (guiScreenIn != null) { - this.setIngameNotInFocus(); - ScaledResolution scaledresolution = new ScaledResolution(this); - int i = scaledresolution.getScaledWidth(); - int j = scaledresolution.getScaledHeight(); - ((GuiScreen) guiScreenIn).setWorldAndResolution(this, i, j); - this.skipRenderWorld = false; - } else { - this.mcSoundHandler.resumeSounds(); - this.setIngameFocus(); - } - - } - - /**+ - * Checks for an OpenGL error. If there is one, prints the error - * ID and error string. - */ - public void checkGLError(String message) { - if (this.enableGLErrorChecking) { - int i = EaglercraftGPU.glGetError(); - if (i != 0) { - String s = EaglercraftGPU.gluErrorString(i); - logger.error("########## GL ERROR ##########"); - logger.error("@ " + message); - logger.error(i + ": " + s); - } - - } - } - - /**+ - * Shuts down the minecraft applet by stopping the resource - * downloads, and clearing up GL stuff; called when the - * application (or web page) is exited. - */ - public void shutdownMinecraftApplet() { - try { - logger.info("Stopping!"); - - try { - this.loadWorld((WorldClient) null); - } catch (Throwable var5) { - ; - } - - this.mcSoundHandler.unloadSounds(); - } finally { - EagRuntime.destroy(); - if (!this.hasCrashed) { - EagRuntime.exit(); - } - - } - } - - /**+ - * Called repeatedly from run() - */ - private void runGameLoop() throws IOException { - long i = System.nanoTime(); - this.mcProfiler.startSection("root"); - if (Display.isCloseRequested()) { - this.shutdown(); - } - - if (this.isGamePaused && this.theWorld != null) { - float f = this.timer.renderPartialTicks; - this.timer.updateTimer(); - this.timer.renderPartialTicks = f; - } else { - this.timer.updateTimer(); - } - - this.mcProfiler.startSection("scheduledExecutables"); - synchronized (this.scheduledTasks) { - while (!this.scheduledTasks.isEmpty()) { - Util.func_181617_a((FutureTask) this.scheduledTasks.remove(0), logger); - } - } - - this.mcProfiler.endSection(); - long l = System.nanoTime(); - this.mcProfiler.startSection("tick"); - - for (int j = 0; j < this.timer.elapsedTicks; ++j) { - this.runTick(); - } - - this.mcProfiler.endStartSection("preRenderErrors"); - long i1 = System.nanoTime() - l; - this.checkGLError("Pre render"); - this.mcProfiler.endStartSection("sound"); - this.mcSoundHandler.setListener(this.thePlayer, this.timer.renderPartialTicks); - this.mcProfiler.endSection(); - this.mcProfiler.startSection("render"); - - if (!Display.contextLost()) { - GlStateManager.clearColor(0.0f, 0.0f, 0.0f, 1.0f); - GlStateManager.pushMatrix(); - GlStateManager.clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - this.mcProfiler.startSection("display"); - GlStateManager.enableTexture2D(); - if (this.thePlayer != null && this.thePlayer.isEntityInsideOpaqueBlock()) { - this.gameSettings.thirdPersonView = 0; - } - - this.mcProfiler.endSection(); - if (!this.skipRenderWorld) { - this.mcProfiler.endStartSection("gameRenderer"); - this.entityRenderer.func_181560_a(this.timer.renderPartialTicks, i); - this.mcProfiler.endSection(); - } - - this.mcProfiler.endSection(); - if (this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart - && !this.gameSettings.hideGUI) { - if (!this.mcProfiler.profilingEnabled) { - this.mcProfiler.clearProfiling(); - } - - this.mcProfiler.profilingEnabled = true; - this.displayDebugInfo(i1); - } else { - this.mcProfiler.profilingEnabled = false; - this.prevFrameTime = System.nanoTime(); - } - - this.guiAchievement.updateAchievementWindow(); - GlStateManager.popMatrix(); - } - - this.mcProfiler.startSection("root"); - this.updateDisplay(); - this.checkGLError("Post render"); - - ++this.fpsCounter; - this.isGamePaused = false; - long k = System.nanoTime(); - this.field_181542_y.func_181747_a(k - this.field_181543_z); - this.field_181543_z = k; - - while (getSystemTime() >= this.debugUpdateTime + 1000L) { - debugFPS = this.fpsCounter; - this.debug = HString.format("%d fps (%d chunk update%s) T: %s%s%s%s", - new Object[] { Integer.valueOf(debugFPS), Integer.valueOf(RenderChunk.renderChunksUpdated), - RenderChunk.renderChunksUpdated != 1 ? "s" : "", - (float) this.gameSettings.limitFramerate == GameSettings.Options.FRAMERATE_LIMIT - .getValueMax() ? "inf" : Integer.valueOf(this.gameSettings.limitFramerate), - this.gameSettings.enableVsync ? " vsync" : "", - this.gameSettings.fancyGraphics ? "" : " fast", this.gameSettings.clouds == 0 ? "" - : (this.gameSettings.clouds == 1 ? " fast-clouds" : " fancy-clouds") }); - RenderChunk.renderChunksUpdated = 0; - this.debugUpdateTime += 1000L; - this.fpsCounter = 0; - } - - if (this.isFramerateLimitBelowMax()) { - this.mcProfiler.startSection("fpslimit_wait"); - Display.sync(this.getLimitFramerate()); - this.mcProfiler.endSection(); - } - - this.mcProfiler.endSection(); - } - - public void updateDisplay() { - this.mcProfiler.startSection("display_update"); - Display.update(); - this.mcProfiler.endSection(); - this.checkWindowResize(); - } - - protected void checkWindowResize() { - if (!this.fullscreen && Display.wasResized()) { - int i = this.displayWidth; - int j = this.displayHeight; - this.displayWidth = Display.getWidth(); - this.displayHeight = Display.getHeight(); - if (this.displayWidth != i || this.displayHeight != j) { - if (this.displayWidth <= 0) { - this.displayWidth = 1; - } - - if (this.displayHeight <= 0) { - this.displayHeight = 1; - } - - this.resize(this.displayWidth, this.displayHeight); - } - } - - } - - public int getLimitFramerate() { - return this.theWorld == null && this.currentScreen != null ? 30 : this.gameSettings.limitFramerate; - } - - public boolean isFramerateLimitBelowMax() { - return (float) this.getLimitFramerate() < GameSettings.Options.FRAMERATE_LIMIT.getValueMax(); - } - - public void freeMemory() { - try { - System.gc(); - this.loadWorld((WorldClient) null); - } catch (Throwable var2) { - ; - } - - System.gc(); - } - - /**+ - * Update debugProfilerName in response to number keys in debug - * screen - */ - private void updateDebugProfilerName(int keyCount) { - List list = this.mcProfiler.getProfilingData(this.debugProfilerName); - if (list != null && !list.isEmpty()) { - Profiler.Result profiler$result = (Profiler.Result) list.remove(0); - if (keyCount == 0) { - if (profiler$result.field_76331_c.length() > 0) { - int i = this.debugProfilerName.lastIndexOf("."); - if (i >= 0) { - this.debugProfilerName = this.debugProfilerName.substring(0, i); - } - } - } else { - --keyCount; - if (keyCount < list.size() - && !((Profiler.Result) list.get(keyCount)).field_76331_c.equals("unspecified")) { - if (this.debugProfilerName.length() > 0) { - this.debugProfilerName = this.debugProfilerName + "."; - } - - this.debugProfilerName = this.debugProfilerName - + ((Profiler.Result) list.get(keyCount)).field_76331_c; - } - } - - } - } - - /**+ - * Parameter appears to be unused - */ - private void displayDebugInfo(long elapsedTicksTime) { - if (this.mcProfiler.profilingEnabled) { - List list = this.mcProfiler.getProfilingData(this.debugProfilerName); - Profiler.Result profiler$result = (Profiler.Result) list.remove(0); - GlStateManager.clear(GL_DEPTH_BUFFER_BIT); - GlStateManager.matrixMode(GL_PROJECTION); - GlStateManager.enableColorMaterial(); - GlStateManager.loadIdentity(); - GlStateManager.ortho(0.0D, (double) this.displayWidth, (double) this.displayHeight, 0.0D, 1000.0D, 3000.0D); - GlStateManager.matrixMode(GL_MODELVIEW); - GlStateManager.loadIdentity(); - GlStateManager.translate(0.0F, 0.0F, -2000.0F); - EaglercraftGPU.glLineWidth(1.0F); - GlStateManager.disableTexture2D(); - Tessellator tessellator = Tessellator.getInstance(); - WorldRenderer worldrenderer = tessellator.getWorldRenderer(); - short short1 = 160; - int i = this.displayWidth - short1 - 10; - int j = this.displayHeight - short1 * 2; - GlStateManager.enableBlend(); - worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); - worldrenderer.pos((double) ((float) i - (float) short1 * 1.1F), - (double) ((float) j - (float) short1 * 0.6F - 16.0F), 0.0D).color(0, 0, 0, 100).endVertex(); - worldrenderer.pos((double) ((float) i - (float) short1 * 1.1F), (double) (j + short1 * 2), 0.0D) - .color(0, 0, 0, 100).endVertex(); - worldrenderer.pos((double) ((float) i + (float) short1 * 1.1F), (double) (j + short1 * 2), 0.0D) - .color(0, 0, 0, 100).endVertex(); - worldrenderer.pos((double) ((float) i + (float) short1 * 1.1F), - (double) ((float) j - (float) short1 * 0.6F - 16.0F), 0.0D).color(0, 0, 0, 100).endVertex(); - tessellator.draw(); - GlStateManager.disableBlend(); - double d0 = 0.0D; - - for (int k = 0; k < list.size(); ++k) { - Profiler.Result profiler$result1 = (Profiler.Result) list.get(k); - int l = MathHelper.floor_double(profiler$result1.field_76332_a / 4.0D) + 1; - worldrenderer.begin(6, DefaultVertexFormats.POSITION_COLOR); - int i1 = profiler$result1.func_76329_a(); - int j1 = i1 >> 16 & 255; - int k1 = i1 >> 8 & 255; - int l1 = i1 & 255; - worldrenderer.pos((double) i, (double) j, 0.0D).color(j1, k1, l1, 255).endVertex(); - - for (int i2 = l; i2 >= 0; --i2) { - float f = (float) ((d0 + profiler$result1.field_76332_a * (double) i2 / (double) l) - * 3.141 * 2.0D / 100.0D); - float f1 = MathHelper.sin(f) * (float) short1; - float f2 = MathHelper.cos(f) * (float) short1 * 0.5F; - worldrenderer.pos((double) ((float) i + f1), (double) ((float) j - f2), 0.0D).color(j1, k1, l1, 255) - .endVertex(); - } - - tessellator.draw(); - worldrenderer.begin(5, DefaultVertexFormats.POSITION_COLOR); - - for (int l2 = l; l2 >= 0; --l2) { - float f3 = (float) ((d0 + profiler$result1.field_76332_a * (double) l2 / (double) l) - * 3.141 * 2.0D / 100.0D); - float f4 = MathHelper.sin(f3) * (float) short1; - float f5 = MathHelper.cos(f3) * (float) short1 * 0.5F; - worldrenderer.pos((double) ((float) i + f4), (double) ((float) j - f5), 0.0D) - .color(j1 >> 1, k1 >> 1, l1 >> 1, 255).endVertex(); - worldrenderer.pos((double) ((float) i + f4), (double) ((float) j - f5 + 10.0F), 0.0D) - .color(j1 >> 1, k1 >> 1, l1 >> 1, 255).endVertex(); - } - - tessellator.draw(); - d0 += profiler$result1.field_76332_a; - } - - DecimalFormat decimalformat = new DecimalFormat("##0.00"); - GlStateManager.enableTexture2D(); - String s = ""; - if (!profiler$result.field_76331_c.equals("unspecified")) { - s = s + "[0] "; - } - - if (profiler$result.field_76331_c.length() == 0) { - s = s + "ROOT "; - } else { - s = s + profiler$result.field_76331_c + " "; - } - - int k2 = 16777215; - this.fontRendererObj.drawStringWithShadow(s, (float) (i - short1), (float) (j - short1 / 2 - 16), k2); - this.fontRendererObj.drawStringWithShadow(s = decimalformat.format(profiler$result.field_76330_b) + "%", - (float) (i + short1 - this.fontRendererObj.getStringWidth(s)), (float) (j - short1 / 2 - 16), k2); - - for (int j2 = 0; j2 < list.size(); ++j2) { - Profiler.Result profiler$result2 = (Profiler.Result) list.get(j2); - String s1 = ""; - if (profiler$result2.field_76331_c.equals("unspecified")) { - s1 = s1 + "[?] "; - } else { - s1 = s1 + "[" + (j2 + 1) + "] "; - } - - s1 = s1 + profiler$result2.field_76331_c; - this.fontRendererObj.drawStringWithShadow(s1, (float) (i - short1), - (float) (j + short1 / 2 + j2 * 8 + 20), profiler$result2.func_76329_a()); - this.fontRendererObj.drawStringWithShadow( - s1 = decimalformat.format(profiler$result2.field_76332_a) + "%", - (float) (i + short1 - 50 - this.fontRendererObj.getStringWidth(s1)), - (float) (j + short1 / 2 + j2 * 8 + 20), profiler$result2.func_76329_a()); - this.fontRendererObj.drawStringWithShadow( - s1 = decimalformat.format(profiler$result2.field_76330_b) + "%", - (float) (i + short1 - this.fontRendererObj.getStringWidth(s1)), - (float) (j + short1 / 2 + j2 * 8 + 20), profiler$result2.func_76329_a()); - } - - } - } - - /**+ - * Called when the window is closing. Sets 'running' to false - * which allows the game loop to exit cleanly. - */ - public void shutdown() { - this.running = false; - } - - /**+ - * Will set the focus to ingame if the Minecraft window is the - * active with focus. Also clears any GUI screen currently - * displayed - */ - public void setIngameFocus() { - if (Display.isActive()) { - if (!this.inGameHasFocus) { - this.inGameHasFocus = true; - this.mouseHelper.grabMouseCursor(); - this.displayGuiScreen((GuiScreen) null); - this.leftClickCounter = 10000; - } - } - } - - /**+ - * Resets the player keystate, disables the ingame focus, and - * ungrabs the mouse cursor. - */ - public void setIngameNotInFocus() { - if (this.inGameHasFocus) { - KeyBinding.unPressAllKeys(); - this.inGameHasFocus = false; - this.mouseHelper.ungrabMouseCursor(); - } - } - - /**+ - * Displays the ingame menu - */ - public void displayInGameMenu() { - if (this.currentScreen == null) { - this.displayGuiScreen(new GuiIngameMenu()); - } - } - - private void sendClickBlockToController(boolean leftClick) { - if (!leftClick) { - this.leftClickCounter = 0; - } - - if (this.leftClickCounter <= 0 && !this.thePlayer.isUsingItem()) { - if (leftClick && this.objectMouseOver != null - && this.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { - BlockPos blockpos = this.objectMouseOver.getBlockPos(); - if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air - && this.playerController.onPlayerDamageBlock(blockpos, this.objectMouseOver.sideHit)) { - this.effectRenderer.addBlockHitEffects(blockpos, this.objectMouseOver.sideHit); - this.thePlayer.swingItem(); - } - - } else { - this.playerController.resetBlockRemoving(); - } - } - } - - private void clickMouse() { - if (this.leftClickCounter <= 0) { - this.thePlayer.swingItem(); - if (this.objectMouseOver == null) { - logger.error("Null returned as \'hitResult\', this shouldn\'t happen!"); - if (this.playerController.isNotCreative()) { - this.leftClickCounter = 10; - } - - } else { - switch (this.objectMouseOver.typeOfHit) { - case ENTITY: - this.playerController.attackEntity(this.thePlayer, this.objectMouseOver.entityHit); - break; - case BLOCK: - BlockPos blockpos = this.objectMouseOver.getBlockPos(); - if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air) { - this.playerController.clickBlock(blockpos, this.objectMouseOver.sideHit); - break; - } - case MISS: - default: - if (this.playerController.isNotCreative()) { - this.leftClickCounter = 10; - } - } - - } - } - } - - /**+ - * Called when user clicked he's mouse right button (place) - */ - private void rightClickMouse() { - if (!this.playerController.func_181040_m()) { - this.rightClickDelayTimer = 4; - boolean flag = true; - ItemStack itemstack = this.thePlayer.inventory.getCurrentItem(); - if (this.objectMouseOver == null) { - logger.warn("Null returned as \'hitResult\', this shouldn\'t happen!"); - } else { - switch (this.objectMouseOver.typeOfHit) { - case ENTITY: - if (this.playerController.func_178894_a(this.thePlayer, this.objectMouseOver.entityHit, - this.objectMouseOver)) { - flag = false; - } else if (this.playerController.interactWithEntitySendPacket(this.thePlayer, - this.objectMouseOver.entityHit)) { - flag = false; - } - break; - case BLOCK: - BlockPos blockpos = this.objectMouseOver.getBlockPos(); - if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air) { - int i = itemstack != null ? itemstack.stackSize : 0; - if (this.playerController.onPlayerRightClick(this.thePlayer, this.theWorld, itemstack, blockpos, - this.objectMouseOver.sideHit, this.objectMouseOver.hitVec)) { - flag = false; - this.thePlayer.swingItem(); - } - - if (itemstack == null) { - return; - } - - if (itemstack.stackSize == 0) { - this.thePlayer.inventory.mainInventory[this.thePlayer.inventory.currentItem] = null; - } else if (itemstack.stackSize != i || this.playerController.isInCreativeMode()) { - this.entityRenderer.itemRenderer.resetEquippedProgress(); - } - } - } - } - - if (flag) { - ItemStack itemstack1 = this.thePlayer.inventory.getCurrentItem(); - if (itemstack1 != null - && this.playerController.sendUseItem(this.thePlayer, this.theWorld, itemstack1)) { - this.entityRenderer.itemRenderer.resetEquippedProgress2(); - } - } - - } - } - - /**+ - * Toggles fullscreen mode. - */ - public void toggleFullscreen() { - Display.toggleFullscreen(); - } - - /**+ - * Called to resize the current screen. - */ - private void resize(int width, int height) { - this.displayWidth = Math.max(1, width); - this.displayHeight = Math.max(1, height); - if (this.currentScreen != null) { - ScaledResolution scaledresolution = new ScaledResolution(this); - this.currentScreen.onResize(this, scaledresolution.getScaledWidth(), scaledresolution.getScaledHeight()); - } - - this.loadingScreen = new LoadingScreenRenderer(this); - } - - public MusicTicker func_181535_r() { - return this.mcMusicTicker; - } - - /**+ - * Runs the current tick. - */ - public void runTick() throws IOException { - if (this.rightClickDelayTimer > 0) { - --this.rightClickDelayTimer; - } - - RateLimitTracker.tick(); - - this.mcProfiler.startSection("gui"); - if (!this.isGamePaused) { - this.ingameGUI.updateTick(); - } - - this.mcProfiler.endSection(); - this.entityRenderer.getMouseOver(1.0F); - this.mcProfiler.startSection("gameMode"); - if (!this.isGamePaused && this.theWorld != null) { - this.playerController.updateController(); - } - - this.mcProfiler.endStartSection("textures"); - if (!this.isGamePaused) { - this.renderEngine.tick(); - } - - if (this.currentScreen == null && this.thePlayer != null) { - if (this.thePlayer.getHealth() <= 0.0F) { - this.displayGuiScreen((GuiScreen) null); - } else if (this.thePlayer.isPlayerSleeping() && this.theWorld != null) { - this.displayGuiScreen(new GuiSleepMP()); - } - if (this.currentScreen == null && this.dontPauseTimer <= 0) { - if (!Mouse.isMouseGrabbed()) { - this.setIngameNotInFocus(); - this.displayInGameMenu(); - } - } - } else if (this.currentScreen != null && this.currentScreen instanceof GuiSleepMP - && !this.thePlayer.isPlayerSleeping()) { - this.displayGuiScreen((GuiScreen) null); - } - - if (this.currentScreen != null) { - this.leftClickCounter = 10000; - this.dontPauseTimer = 6; - } else { - if (this.dontPauseTimer > 0) { - --this.dontPauseTimer; - } - } - - if (this.currentScreen != null) { - try { - this.currentScreen.handleInput(); - } catch (Throwable throwable1) { - CrashReport crashreport = CrashReport.makeCrashReport(throwable1, "Updating screen events"); - CrashReportCategory crashreportcategory = crashreport.makeCategory("Affected screen"); - crashreportcategory.addCrashSectionCallable("Screen name", new Callable() { - public String call() throws Exception { - return Minecraft.this.currentScreen.getClass().getName(); - } - }); - throw new ReportedException(crashreport); - } - - if (this.currentScreen != null) { - try { - this.currentScreen.updateScreen(); - } catch (Throwable throwable) { - CrashReport crashreport1 = CrashReport.makeCrashReport(throwable, "Ticking screen"); - CrashReportCategory crashreportcategory1 = crashreport1.makeCategory("Affected screen"); - crashreportcategory1.addCrashSectionCallable("Screen name", new Callable() { - public String call() throws Exception { - return Minecraft.this.currentScreen.getClass().getName(); - } - }); - throw new ReportedException(crashreport1); - } - } - } - - if (this.currentScreen == null || this.currentScreen.allowUserInput) { - this.mcProfiler.endStartSection("mouse"); - - while (Mouse.next()) { - int i = Mouse.getEventButton(); - KeyBinding.setKeyBindState(i - 100, Mouse.getEventButtonState()); - if (Mouse.getEventButtonState()) { - if (this.thePlayer.isSpectator() && i == 2) { - this.ingameGUI.getSpectatorGui().func_175261_b(); - } else { - KeyBinding.onTick(i - 100); - } - } - - long i1 = getSystemTime() - this.systemTime; - if (i1 <= 200L) { - int j = Mouse.getEventDWheel(); - if (j != 0) { - if (this.thePlayer.isSpectator()) { - j = j < 0 ? -1 : 1; - if (this.ingameGUI.getSpectatorGui().func_175262_a()) { - this.ingameGUI.getSpectatorGui().func_175259_b(-j); - } else { - float f = MathHelper.clamp_float( - this.thePlayer.capabilities.getFlySpeed() + (float) j * 0.005F, 0.0F, 0.2F); - this.thePlayer.capabilities.setFlySpeed(f); - } - } else { - this.thePlayer.inventory.changeCurrentItem(j); - } - } - - if (this.currentScreen == null) { - if ((!this.inGameHasFocus || !Mouse.isActuallyGrabbed()) && Mouse.getEventButtonState()) { - this.inGameHasFocus = false; - this.setIngameFocus(); - } - } else if (this.currentScreen != null) { - this.currentScreen.handleMouseInput(); - } - } - } - - if (this.leftClickCounter > 0) { - --this.leftClickCounter; - } - - this.mcProfiler.endStartSection("keyboard"); - - while (Keyboard.next()) { - int k = Keyboard.getEventKey() == 0 ? Keyboard.getEventCharacter() + 256 : Keyboard.getEventKey(); - if (k == 0x1D && (areKeysLocked() || isFullScreen())) { - KeyBinding.setKeyBindState(gameSettings.keyBindSprint.getKeyCode(), Keyboard.getEventKeyState()); - } - KeyBinding.setKeyBindState(k, Keyboard.getEventKeyState()); - if (Keyboard.getEventKeyState()) { - KeyBinding.onTick(k); - } - - if (this.debugCrashKeyPressTime > 0L) { - if (getSystemTime() - this.debugCrashKeyPressTime >= 6000L) { - throw new ReportedException(new CrashReport("Manually triggered debug crash", new Throwable())); - } - - if (!Keyboard.isKeyDown(46) || !Keyboard.isKeyDown(61)) { - this.debugCrashKeyPressTime = -1L; - } - } else if (Keyboard.isKeyDown(46) && Keyboard.isKeyDown(61)) { - this.debugCrashKeyPressTime = getSystemTime(); - } - - this.dispatchKeypresses(); - if (Keyboard.getEventKeyState()) { - if (k == 62 && this.entityRenderer != null) { - this.entityRenderer.switchUseShader(); - } - - if (this.currentScreen != null) { - this.currentScreen.handleKeyboardInput(); - } else { + AdminRay.start(); + this.ingameGUI = new GuiIngame(this); + ServerList.initServerList(this); + EaglerProfile.read(); + + if (this.serverName != null) { + this.displayGuiScreen(new GuiScreenEditProfile(new GuiConnecting(new GuiMainMenu(), this, this.serverName, this.serverPort))); + } else { + this.displayGuiScreen(new GuiScreenEditProfile(new GuiMainMenu())); + } + + this.renderEngine.deleteTexture(this.mojangLogo); + this.mojangLogo = null; + this.loadingScreen = new LoadingScreenRenderer(this); + + PlatformRuntime.removeLoadScreen(); + EagUtils.sleep(200l); + } + + private void registerMetadataSerializers() { + this.metadataSerializer_.registerMetadataSectionType(new TextureMetadataSectionSerializer(), TextureMetadataSection.class); + this.metadataSerializer_.registerMetadataSectionType(new FontMetadataSectionSerializer(), FontMetadataSection.class); + this.metadataSerializer_.registerMetadataSectionType(new AnimationMetadataSectionSerializer(), AnimationMetadataSection.class); + this.metadataSerializer_.registerMetadataSectionType(new PackMetadataSectionSerializer(), PackMetadataSection.class); + this.metadataSerializer_.registerMetadataSectionType(new LanguageMetadataSectionSerializer(), LanguageMetadataSection.class); + } + + private void initStream() { + throw new UnsupportedOperationException("wtf u trying to twitch stream in a browser game?"); + } + + private void createDisplay() { + Display.create(); + Display.setTitle("Eaglercraft 1.8.8"); + } + + private static boolean isJvm64bit() { + return true; + } + + public String getVersion() { + return this.launchedVersion; + } + + public void crashed(CrashReport crash) { + this.hasCrashed = true; + this.crashReporter = crash; + } + + /**+ + * Wrapper around displayCrashReportInternal + */ + public void displayCrashReport(CrashReport crashReportIn) { + String report = crashReportIn.getCompleteReport(); + Bootstrap.printToSYSOUT(report); + PlatformRuntime.writeCrashReport(report); + if (PlatformRuntime.getPlatformType() == EnumPlatformType.JAVASCRIPT) { + System.err.println("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"); + System.err.println("NATIVE BROWSER EXCEPTION:"); + if (!PlatformRuntime.printJSExceptionIfBrowser(crashReportIn.getCrashCause())) { + System.err.println(""); + } + System.err.println("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"); + } + } + + public boolean isUnicode() { + return this.mcLanguageManager.isCurrentLocaleUnicode() || this.gameSettings.forceUnicodeFont; + } + + public void refreshResources() { + GlStateManager.recompileShaders(); + + ArrayList arraylist = Lists.newArrayList(this.defaultResourcePacks); + + for (ResourcePackRepository.Entry resourcepackrepository$entry : this.mcResourcePackRepository.getRepositoryEntries()) { + arraylist.add(resourcepackrepository$entry.getResourcePack()); + } + + if (this.mcResourcePackRepository.getResourcePackInstance() != null) { + arraylist.add(this.mcResourcePackRepository.getResourcePackInstance()); + } + + try { + this.mcResourceManager.reloadResources(arraylist); + } catch (RuntimeException runtimeexception) { + logger.info("Caught error stitching, removing all assigned resourcepacks"); + logger.info(runtimeexception); + arraylist.clear(); + arraylist.addAll(this.defaultResourcePacks); + this.mcResourcePackRepository.setRepositories(Collections.emptyList()); + this.mcResourceManager.reloadResources(arraylist); + this.gameSettings.resourcePacks.clear(); + this.gameSettings.field_183018_l.clear(); + this.gameSettings.saveOptions(); + } + + this.mcLanguageManager.parseLanguageMetadata(arraylist); + if (this.renderGlobal != null) { + this.renderGlobal.loadRenderers(); + } + } + + private void updateDisplayMode() { + this.displayWidth = Display.getWidth(); + this.displayHeight = Display.getHeight(); + } + + private void drawSplashScreen(TextureManager textureManagerInstance) { + Display.update(); + updateDisplayMode(); + GlStateManager.viewport(0, 0, displayWidth, displayHeight); + ScaledResolution scaledresolution = new ScaledResolution(this); + int i = scaledresolution.getScaleFactor(); + GlStateManager.matrixMode(GL_PROJECTION); + GlStateManager.loadIdentity(); + GlStateManager.ortho(0.0D, (double) scaledresolution.getScaledWidth(), (double) scaledresolution.getScaledHeight(), 0.0D, 1000.0D, 3000.0D); + GlStateManager.matrixMode(GL_MODELVIEW); + GlStateManager.loadIdentity(); + GlStateManager.translate(0.0F, 0.0F, -2000.0F); + GlStateManager.disableLighting(); + GlStateManager.disableFog(); + GlStateManager.disableDepth(); + GlStateManager.enableTexture2D(); + InputStream inputstream = null; + + try { + inputstream = this.mcDefaultResourcePack.getInputStream(locationMojangPng); + this.mojangLogo = textureManagerInstance.getDynamicTextureLocation("logo", new DynamicTexture(ImageData.loadImageFile(inputstream))); + textureManagerInstance.bindTexture(this.mojangLogo); + } catch (IOException ioexception) { + logger.error("Unable to load logo: " + locationMojangPng, ioexception); + } finally { + IOUtils.closeQuietly(inputstream); + } + + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos(0.0D, (double) this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex(); + worldrenderer.pos((double) this.displayWidth, (double) this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex(); + worldrenderer.pos((double) this.displayWidth, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex(); + worldrenderer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex(); + tessellator.draw(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + short short1 = 256; + short short2 = 256; + this.func_181536_a((scaledresolution.getScaledWidth() - short1) / 2, (scaledresolution.getScaledHeight() - short2) / 2, 0, 0, short1, short2, 255, 255, 255, 255); + GlStateManager.disableLighting(); + GlStateManager.disableFog(); + GlStateManager.enableAlpha(); + GlStateManager.alphaFunc(GL_GREATER, 0.1F); + this.updateDisplay(); + + PlatformRuntime.showMojangScreen(); + EagUtils.sleep(200l); + } + + public void func_181536_a(int parInt1, int parInt2, int parInt3, int parInt4, int parInt5, int parInt6, int parInt7, int parInt8, int parInt9, int parInt10) { + float f = 0.00390625F; + float f1 = 0.00390625F; + WorldRenderer worldrenderer = Tessellator.getInstance().getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos((double) parInt1, (double) (parInt2 + parInt6), 0.0D).tex((double) ((float) parInt3 * f), (double) ((float) (parInt4 + parInt6) * f1)).color(parInt7, parInt8, parInt9, parInt10).endVertex(); + worldrenderer.pos((double) (parInt1 + parInt5), (double) (parInt2 + parInt6), 0.0D).tex((double) ((float) (parInt3 + parInt5) * f), (double) ((float) (parInt4 + parInt6) * f1)).color(parInt7, parInt8, parInt9, parInt10).endVertex(); + worldrenderer.pos((double) (parInt1 + parInt5), (double) parInt2, 0.0D).tex((double) ((float) (parInt3 + parInt5) * f), (double) ((float) parInt4 * f1)).color(parInt7, parInt8, parInt9, parInt10).endVertex(); + worldrenderer.pos((double) parInt1, (double) parInt2, 0.0D).tex((double) ((float) parInt3 * f), (double) ((float) parInt4 * f1)).color(parInt7, parInt8, parInt9, parInt10).endVertex(); + Tessellator.getInstance().draw(); + } + + /**+ + * Sets the argument GuiScreen as the main (topmost visible) + * screen. + */ + public void displayGuiScreen(GuiScreen guiScreenIn) { + if (this.currentScreen != null) { + this.currentScreen.onGuiClosed(); + } + + if (guiScreenIn == null && this.theWorld == null) { + guiScreenIn = new GuiMainMenu(); + } else if (guiScreenIn == null && this.thePlayer.getHealth() <= 0.0F) { + guiScreenIn = new GuiGameOver(); + } + + if (guiScreenIn instanceof GuiMainMenu) { + this.gameSettings.showDebugInfo = false; + this.ingameGUI.getChatGUI().clearChatMessages(); + } + + this.currentScreen = (GuiScreen) guiScreenIn; + if (guiScreenIn != null) { + this.setIngameNotInFocus(); + ScaledResolution scaledresolution = new ScaledResolution(this); + int i = scaledresolution.getScaledWidth(); + int j = scaledresolution.getScaledHeight(); + ((GuiScreen) guiScreenIn).setWorldAndResolution(this, i, j); + this.skipRenderWorld = false; + } else { + this.mcSoundHandler.resumeSounds(); + this.setIngameFocus(); + } + } + + /**+ + * Checks for an OpenGL error. If there is one, prints the error + * ID and error string. + */ + public void checkGLError(String message) { + if (this.enableGLErrorChecking) { + int i = EaglercraftGPU.glGetError(); + if (i != 0) { + String s = EaglercraftGPU.gluErrorString(i); + logger.error("########## GL ERROR ##########"); + logger.error("@ " + message); + logger.error(i + ": " + s); + } + } + } + + /**+ + * Shuts down the minecraft applet by stopping the resource + * downloads, and clearing up GL stuff; called when the + * application (or web page) is exited. + */ + public void shutdownMinecraftApplet() { + try { + logger.info("Stopping!"); + + try { + this.loadWorld((WorldClient) null); + } catch (Throwable var5) {} + + this.mcSoundHandler.unloadSounds(); + } finally { + EagRuntime.destroy(); + if (!this.hasCrashed) { + EagRuntime.exit(); + } + } + } + + /**+ + * Called repeatedly from run() + */ + private void runGameLoop() throws IOException { + long i = System.nanoTime(); + this.mcProfiler.startSection("root"); + if (Display.isCloseRequested()) { + this.shutdown(); + } + + if (this.isGamePaused && this.theWorld != null) { + float f = this.timer.renderPartialTicks; + this.timer.updateTimer(); + this.timer.renderPartialTicks = f; + } else { + this.timer.updateTimer(); + } + + this.mcProfiler.startSection("scheduledExecutables"); + synchronized (this.scheduledTasks) { + while (!this.scheduledTasks.isEmpty()) { + Util.func_181617_a((FutureTask) this.scheduledTasks.remove(0), logger); + } + } + + this.mcProfiler.endSection(); + long l = System.nanoTime(); + this.mcProfiler.startSection("tick"); + + for (int j = 0; j < this.timer.elapsedTicks; ++j) { + this.runTick(); + } + + this.mcProfiler.endStartSection("preRenderErrors"); + long i1 = System.nanoTime() - l; + this.checkGLError("Pre render"); + this.mcProfiler.endStartSection("sound"); + this.mcSoundHandler.setListener(this.thePlayer, this.timer.renderPartialTicks); + this.mcProfiler.endSection(); + this.mcProfiler.startSection("render"); + + if (!Display.contextLost()) { + GlStateManager.clearColor(0.0f, 0.0f, 0.0f, 1.0f); + GlStateManager.pushMatrix(); + GlStateManager.clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + this.mcProfiler.startSection("display"); + GlStateManager.enableTexture2D(); + if (this.thePlayer != null && this.thePlayer.isEntityInsideOpaqueBlock()) { + this.gameSettings.thirdPersonView = 0; + } + + this.mcProfiler.endSection(); + if (!this.skipRenderWorld) { + this.mcProfiler.endStartSection("gameRenderer"); + this.entityRenderer.func_181560_a(this.timer.renderPartialTicks, i); + this.mcProfiler.endSection(); + } + + this.mcProfiler.endSection(); + if (this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart && !this.gameSettings.hideGUI) { + if (!this.mcProfiler.profilingEnabled) { + this.mcProfiler.clearProfiling(); + } + + this.mcProfiler.profilingEnabled = true; + this.displayDebugInfo(i1); + } else { + this.mcProfiler.profilingEnabled = false; + this.prevFrameTime = System.nanoTime(); + } + + this.guiAchievement.updateAchievementWindow(); + GlStateManager.popMatrix(); + } + + this.mcProfiler.startSection("root"); + this.updateDisplay(); + this.checkGLError("Post render"); + + ++this.fpsCounter; + this.isGamePaused = false; + long k = System.nanoTime(); + this.field_181542_y.func_181747_a(k - this.field_181543_z); + this.field_181543_z = k; + + while (getSystemTime() >= this.debugUpdateTime + 1000L) { + debugFPS = this.fpsCounter; + this.debug = + HString.format( + "%d fps (%d chunk update%s) T: %s%s%s%s", + new Object[] { + Integer.valueOf(debugFPS), + Integer.valueOf(RenderChunk.renderChunksUpdated), + RenderChunk.renderChunksUpdated != 1 ? "s" : "", + (float) this.gameSettings.limitFramerate == GameSettings.Options.FRAMERATE_LIMIT.getValueMax() ? "inf" : Integer.valueOf(this.gameSettings.limitFramerate), + this.gameSettings.enableVsync ? " vsync" : "", + this.gameSettings.fancyGraphics ? "" : " fast", + this.gameSettings.clouds == 0 ? "" : (this.gameSettings.clouds == 1 ? " fast-clouds" : " fancy-clouds") + } + ); + RenderChunk.renderChunksUpdated = 0; + this.debugUpdateTime += 1000L; + this.fpsCounter = 0; + } + + if (this.isFramerateLimitBelowMax()) { + this.mcProfiler.startSection("fpslimit_wait"); + Display.sync(this.getLimitFramerate()); + this.mcProfiler.endSection(); + } + + this.mcProfiler.endSection(); + } + + public void updateDisplay() { + this.mcProfiler.startSection("display_update"); + Display.update(); + this.mcProfiler.endSection(); + this.checkWindowResize(); + } + + protected void checkWindowResize() { + if (!this.fullscreen && Display.wasResized()) { + int i = this.displayWidth; + int j = this.displayHeight; + this.displayWidth = Display.getWidth(); + this.displayHeight = Display.getHeight(); + if (this.displayWidth != i || this.displayHeight != j) { + if (this.displayWidth <= 0) { + this.displayWidth = 1; + } + + if (this.displayHeight <= 0) { + this.displayHeight = 1; + } + + this.resize(this.displayWidth, this.displayHeight); + } + } + } + + public int getLimitFramerate() { + return this.theWorld == null && this.currentScreen != null ? 30 : this.gameSettings.limitFramerate; + } + + public boolean isFramerateLimitBelowMax() { + return (float) this.getLimitFramerate() < GameSettings.Options.FRAMERATE_LIMIT.getValueMax(); + } + + public void freeMemory() { + try { + System.gc(); + this.loadWorld((WorldClient) null); + } catch (Throwable var2) {} + + System.gc(); + } + + /**+ + * Update debugProfilerName in response to number keys in debug + * screen + */ + private void updateDebugProfilerName(int keyCount) { + List list = this.mcProfiler.getProfilingData(this.debugProfilerName); + if (list != null && !list.isEmpty()) { + Profiler.Result profiler$result = (Profiler.Result) list.remove(0); + if (keyCount == 0) { + if (profiler$result.field_76331_c.length() > 0) { + int i = this.debugProfilerName.lastIndexOf("."); + if (i >= 0) { + this.debugProfilerName = this.debugProfilerName.substring(0, i); + } + } + } else { + --keyCount; + if (keyCount < list.size() && !((Profiler.Result) list.get(keyCount)).field_76331_c.equals("unspecified")) { + if (this.debugProfilerName.length() > 0) { + this.debugProfilerName = this.debugProfilerName + "."; + } + + this.debugProfilerName = this.debugProfilerName + ((Profiler.Result) list.get(keyCount)).field_76331_c; + } + } + } + } + + /**+ + * Parameter appears to be unused + */ + private void displayDebugInfo(long elapsedTicksTime) { + if (this.mcProfiler.profilingEnabled) { + List list = this.mcProfiler.getProfilingData(this.debugProfilerName); + Profiler.Result profiler$result = (Profiler.Result) list.remove(0); + GlStateManager.clear(GL_DEPTH_BUFFER_BIT); + GlStateManager.matrixMode(GL_PROJECTION); + GlStateManager.enableColorMaterial(); + GlStateManager.loadIdentity(); + GlStateManager.ortho(0.0D, (double) this.displayWidth, (double) this.displayHeight, 0.0D, 1000.0D, 3000.0D); + GlStateManager.matrixMode(GL_MODELVIEW); + GlStateManager.loadIdentity(); + GlStateManager.translate(0.0F, 0.0F, -2000.0F); + EaglercraftGPU.glLineWidth(1.0F); + GlStateManager.disableTexture2D(); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + short short1 = 160; + int i = this.displayWidth - short1 - 10; + int j = this.displayHeight - short1 * 2; + GlStateManager.enableBlend(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.pos((double) ((float) i - (float) short1 * 1.1F), (double) ((float) j - (float) short1 * 0.6F - 16.0F), 0.0D).color(0, 0, 0, 100).endVertex(); + worldrenderer.pos((double) ((float) i - (float) short1 * 1.1F), (double) (j + short1 * 2), 0.0D).color(0, 0, 0, 100).endVertex(); + worldrenderer.pos((double) ((float) i + (float) short1 * 1.1F), (double) (j + short1 * 2), 0.0D).color(0, 0, 0, 100).endVertex(); + worldrenderer.pos((double) ((float) i + (float) short1 * 1.1F), (double) ((float) j - (float) short1 * 0.6F - 16.0F), 0.0D).color(0, 0, 0, 100).endVertex(); + tessellator.draw(); + GlStateManager.disableBlend(); + double d0 = 0.0D; + + for (int k = 0; k < list.size(); ++k) { + Profiler.Result profiler$result1 = (Profiler.Result) list.get(k); + int l = MathHelper.floor_double(profiler$result1.field_76332_a / 4.0D) + 1; + worldrenderer.begin(6, DefaultVertexFormats.POSITION_COLOR); + int i1 = profiler$result1.func_76329_a(); + int j1 = i1 >> 16 & 255; + int k1 = i1 >> 8 & 255; + int l1 = i1 & 255; + worldrenderer.pos((double) i, (double) j, 0.0D).color(j1, k1, l1, 255).endVertex(); + + for (int i2 = l; i2 >= 0; --i2) { + float f = (float) ((d0 + profiler$result1.field_76332_a * (double) i2 / (double) l) * 3.141 * 2.0D / 100.0D); + float f1 = MathHelper.sin(f) * (float) short1; + float f2 = MathHelper.cos(f) * (float) short1 * 0.5F; + worldrenderer.pos((double) ((float) i + f1), (double) ((float) j - f2), 0.0D).color(j1, k1, l1, 255).endVertex(); + } + + tessellator.draw(); + worldrenderer.begin(5, DefaultVertexFormats.POSITION_COLOR); + + for (int l2 = l; l2 >= 0; --l2) { + float f3 = (float) ((d0 + profiler$result1.field_76332_a * (double) l2 / (double) l) * 3.141 * 2.0D / 100.0D); + float f4 = MathHelper.sin(f3) * (float) short1; + float f5 = MathHelper.cos(f3) * (float) short1 * 0.5F; + worldrenderer.pos((double) ((float) i + f4), (double) ((float) j - f5), 0.0D).color(j1 >> 1, k1 >> 1, l1 >> 1, 255).endVertex(); + worldrenderer.pos((double) ((float) i + f4), (double) ((float) j - f5 + 10.0F), 0.0D).color(j1 >> 1, k1 >> 1, l1 >> 1, 255).endVertex(); + } + + tessellator.draw(); + d0 += profiler$result1.field_76332_a; + } + + DecimalFormat decimalformat = new DecimalFormat("##0.00"); + GlStateManager.enableTexture2D(); + String s = ""; + if (!profiler$result.field_76331_c.equals("unspecified")) { + s = s + "[0] "; + } + + if (profiler$result.field_76331_c.length() == 0) { + s = s + "ROOT "; + } else { + s = s + profiler$result.field_76331_c + " "; + } + + int k2 = 16777215; + this.fontRendererObj.drawStringWithShadow(s, (float) (i - short1), (float) (j - short1 / 2 - 16), k2); + this.fontRendererObj.drawStringWithShadow(s = decimalformat.format(profiler$result.field_76330_b) + "%", (float) (i + short1 - this.fontRendererObj.getStringWidth(s)), (float) (j - short1 / 2 - 16), k2); + + for (int j2 = 0; j2 < list.size(); ++j2) { + Profiler.Result profiler$result2 = (Profiler.Result) list.get(j2); + String s1 = ""; + if (profiler$result2.field_76331_c.equals("unspecified")) { + s1 = s1 + "[?] "; + } else { + s1 = s1 + "[" + (j2 + 1) + "] "; + } + + s1 = s1 + profiler$result2.field_76331_c; + this.fontRendererObj.drawStringWithShadow(s1, (float) (i - short1), (float) (j + short1 / 2 + j2 * 8 + 20), profiler$result2.func_76329_a()); + this.fontRendererObj.drawStringWithShadow(s1 = decimalformat.format(profiler$result2.field_76332_a) + "%", (float) (i + short1 - 50 - this.fontRendererObj.getStringWidth(s1)), (float) (j + short1 / 2 + j2 * 8 + 20), profiler$result2.func_76329_a()); + this.fontRendererObj.drawStringWithShadow(s1 = decimalformat.format(profiler$result2.field_76330_b) + "%", (float) (i + short1 - this.fontRendererObj.getStringWidth(s1)), (float) (j + short1 / 2 + j2 * 8 + 20), profiler$result2.func_76329_a()); + } + } + } + + /**+ + * Called when the window is closing. Sets 'running' to false + * which allows the game loop to exit cleanly. + */ + public void shutdown() { + this.running = false; + } + + /**+ + * Will set the focus to ingame if the Minecraft window is the + * active with focus. Also clears any GUI screen currently + * displayed + */ + public void setIngameFocus() { + if (Display.isActive()) { + if (!this.inGameHasFocus) { + this.inGameHasFocus = true; + this.mouseHelper.grabMouseCursor(); + this.displayGuiScreen((GuiScreen) null); + this.leftClickCounter = 10000; + } + } + } + + /**+ + * Resets the player keystate, disables the ingame focus, and + * ungrabs the mouse cursor. + */ + public void setIngameNotInFocus() { + if (this.inGameHasFocus) { + KeyBinding.unPressAllKeys(); + this.inGameHasFocus = false; + this.mouseHelper.ungrabMouseCursor(); + } + } + + /**+ + * Displays the ingame menu + */ + public void displayInGameMenu() { + if (this.currentScreen == null) { + this.displayGuiScreen(new GuiIngameMenu()); + } + } + + private void sendClickBlockToController(boolean leftClick) { + if (!leftClick) { + this.leftClickCounter = 0; + } + + if (this.leftClickCounter <= 0 && !this.thePlayer.isUsingItem()) { + if (leftClick && this.objectMouseOver != null && this.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + BlockPos blockpos = this.objectMouseOver.getBlockPos(); + if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air && this.playerController.onPlayerDamageBlock(blockpos, this.objectMouseOver.sideHit)) { + this.effectRenderer.addBlockHitEffects(blockpos, this.objectMouseOver.sideHit); + this.thePlayer.swingItem(); + } + } else { + this.playerController.resetBlockRemoving(); + } + } + } + + private void clickMouse() { + if (this.leftClickCounter <= 0) { + this.thePlayer.swingItem(); + if (this.objectMouseOver == null) { + logger.error("Null returned as \'hitResult\', this shouldn\'t happen!"); + if (this.playerController.isNotCreative()) { + this.leftClickCounter = 10; + } + } else { + switch (this.objectMouseOver.typeOfHit) { + case ENTITY: + this.playerController.attackEntity(this.thePlayer, this.objectMouseOver.entityHit); + break; + case BLOCK: + BlockPos blockpos = this.objectMouseOver.getBlockPos(); + if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air) { + this.playerController.clickBlock(blockpos, this.objectMouseOver.sideHit); + break; + } + case MISS: + default: + if (this.playerController.isNotCreative()) { + this.leftClickCounter = 10; + } + } + } + } + } + + /**+ + * Called when user clicked he's mouse right button (place) + */ + private void rightClickMouse() { + if (!this.playerController.func_181040_m()) { + this.rightClickDelayTimer = 4; + boolean flag = true; + ItemStack itemstack = this.thePlayer.inventory.getCurrentItem(); + if (this.objectMouseOver == null) { + logger.warn("Null returned as \'hitResult\', this shouldn\'t happen!"); + } else { + switch (this.objectMouseOver.typeOfHit) { + case ENTITY: + if (this.playerController.func_178894_a(this.thePlayer, this.objectMouseOver.entityHit, this.objectMouseOver)) { + flag = false; + } else if (this.playerController.interactWithEntitySendPacket(this.thePlayer, this.objectMouseOver.entityHit)) { + flag = false; + } + break; + case BLOCK: + BlockPos blockpos = this.objectMouseOver.getBlockPos(); + if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air) { + int i = itemstack != null ? itemstack.stackSize : 0; + if (this.playerController.onPlayerRightClick(this.thePlayer, this.theWorld, itemstack, blockpos, this.objectMouseOver.sideHit, this.objectMouseOver.hitVec)) { + flag = false; + this.thePlayer.swingItem(); + } + + if (itemstack == null) { + return; + } + + if (itemstack.stackSize == 0) { + this.thePlayer.inventory.mainInventory[this.thePlayer.inventory.currentItem] = null; + } else if (itemstack.stackSize != i || this.playerController.isInCreativeMode()) { + this.entityRenderer.itemRenderer.resetEquippedProgress(); + } + } + } + } + + if (flag) { + ItemStack itemstack1 = this.thePlayer.inventory.getCurrentItem(); + if (itemstack1 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, itemstack1)) { + this.entityRenderer.itemRenderer.resetEquippedProgress2(); + } + } + } + } + + /**+ + * Toggles fullscreen mode. + */ + public void toggleFullscreen() { + Display.toggleFullscreen(); + } + + /**+ + * Called to resize the current screen. + */ + private void resize(int width, int height) { + this.displayWidth = Math.max(1, width); + this.displayHeight = Math.max(1, height); + if (this.currentScreen != null) { + ScaledResolution scaledresolution = new ScaledResolution(this); + this.currentScreen.onResize(this, scaledresolution.getScaledWidth(), scaledresolution.getScaledHeight()); + } + + this.loadingScreen = new LoadingScreenRenderer(this); + } + + public MusicTicker func_181535_r() { + return this.mcMusicTicker; + } + + /**+ + * Runs the current tick. + */ + public void runTick() throws IOException { + if (this.rightClickDelayTimer > 0) { + --this.rightClickDelayTimer; + } + + RateLimitTracker.tick(); + + this.mcProfiler.startSection("gui"); + if (!this.isGamePaused) { + this.ingameGUI.updateTick(); + } + + this.mcProfiler.endSection(); + this.entityRenderer.getMouseOver(1.0F); + this.mcProfiler.startSection("gameMode"); + if (!this.isGamePaused && this.theWorld != null) { + this.playerController.updateController(); + } + + this.mcProfiler.endStartSection("textures"); + if (!this.isGamePaused) { + this.renderEngine.tick(); + } + + if (this.currentScreen == null && this.thePlayer != null) { + if (this.thePlayer.getHealth() <= 0.0F) { + this.displayGuiScreen((GuiScreen) null); + } else if (this.thePlayer.isPlayerSleeping() && this.theWorld != null) { + this.displayGuiScreen(new GuiSleepMP()); + } + if (this.currentScreen == null && this.dontPauseTimer <= 0) { + if (!Mouse.isMouseGrabbed()) { + this.setIngameNotInFocus(); + this.displayInGameMenu(); + } + } + } else if (this.currentScreen != null && this.currentScreen instanceof GuiSleepMP && !this.thePlayer.isPlayerSleeping()) { + this.displayGuiScreen((GuiScreen) null); + } + + if (this.currentScreen != null) { + this.leftClickCounter = 10000; + this.dontPauseTimer = 6; + } else { + if (this.dontPauseTimer > 0) { + --this.dontPauseTimer; + } + } + + if (this.currentScreen != null) { + try { + this.currentScreen.handleInput(); + } catch (Throwable throwable1) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable1, "Updating screen events"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Affected screen"); + crashreportcategory.addCrashSectionCallable( + "Screen name", + new Callable() { + public String call() throws Exception { + return Minecraft.this.currentScreen.getClass().getName(); + } + } + ); + throw new ReportedException(crashreport); + } + + if (this.currentScreen != null) { + try { + this.currentScreen.updateScreen(); + } catch (Throwable throwable) { + CrashReport crashreport1 = CrashReport.makeCrashReport(throwable, "Ticking screen"); + CrashReportCategory crashreportcategory1 = crashreport1.makeCategory("Affected screen"); + crashreportcategory1.addCrashSectionCallable( + "Screen name", + new Callable() { + public String call() throws Exception { + return Minecraft.this.currentScreen.getClass().getName(); + } + } + ); + throw new ReportedException(crashreport1); + } + } + } + + if (this.currentScreen == null || this.currentScreen.allowUserInput) { + this.mcProfiler.endStartSection("mouse"); + + while (Mouse.next()) { + int i = Mouse.getEventButton(); + KeyBinding.setKeyBindState(i - 100, Mouse.getEventButtonState()); + if (Mouse.getEventButtonState()) { + if (this.thePlayer.isSpectator() && i == 2) { + this.ingameGUI.getSpectatorGui().func_175261_b(); + } else { + KeyBinding.onTick(i - 100); + } + } + + long i1 = getSystemTime() - this.systemTime; + if (i1 <= 200L) { + int j = Mouse.getEventDWheel(); + if (j != 0) { + if (this.thePlayer.isSpectator()) { + j = j < 0 ? -1 : 1; + if (this.ingameGUI.getSpectatorGui().func_175262_a()) { + this.ingameGUI.getSpectatorGui().func_175259_b(-j); + } else { + float f = MathHelper.clamp_float(this.thePlayer.capabilities.getFlySpeed() + (float) j * 0.005F, 0.0F, 0.2F); + this.thePlayer.capabilities.setFlySpeed(f); + } + } else { + this.thePlayer.inventory.changeCurrentItem(j); + } + } + + if (this.currentScreen == null) { + if ((!this.inGameHasFocus || !Mouse.isActuallyGrabbed()) && Mouse.getEventButtonState()) { + this.inGameHasFocus = false; + this.setIngameFocus(); + } + } else if (this.currentScreen != null) { + this.currentScreen.handleMouseInput(); + } + } + } + + if (this.leftClickCounter > 0) { + --this.leftClickCounter; + } + + this.mcProfiler.endStartSection("keyboard"); + + while (Keyboard.next()) { + int k = Keyboard.getEventKey() == 0 ? Keyboard.getEventCharacter() + 256 : Keyboard.getEventKey(); + if (k == 0x1D && (areKeysLocked() || isFullScreen())) { + KeyBinding.setKeyBindState(gameSettings.keyBindSprint.getKeyCode(), Keyboard.getEventKeyState()); + } + KeyBinding.setKeyBindState(k, Keyboard.getEventKeyState()); + if (Keyboard.getEventKeyState()) { + KeyBinding.onTick(k); + } + + if (this.debugCrashKeyPressTime > 0L) { + if (getSystemTime() - this.debugCrashKeyPressTime >= 6000L) { + throw new ReportedException(new CrashReport("Manually triggered debug crash", new Throwable())); + } + + if (!Keyboard.isKeyDown(46) || !Keyboard.isKeyDown(61)) { + this.debugCrashKeyPressTime = -1L; + } + } else if (Keyboard.isKeyDown(46) && Keyboard.isKeyDown(61)) { + this.debugCrashKeyPressTime = getSystemTime(); + } + + this.dispatchKeypresses(); + if (Keyboard.getEventKeyState()) { + if (k == 62 && this.entityRenderer != null) { + this.entityRenderer.switchUseShader(); + } + + if (this.currentScreen != null) { + this.currentScreen.handleKeyboardInput(); + } else { if (Keyboard.getEventKey() == this.gameSettings.keyBindFreelook.keyCode) W.freelook().smh(); if (k == 1 || (k > -1 && k == this.gameSettings.keyBindClose.getKeyCode())) { this.displayInGameMenu(); } - if(k == this.gameSettings.keyBindClickGui.getKeyCode()){ - this.displayGuiScreen(new PreGUI()); - } - - if(k == this.gameSettings.keyBindAdminX.keyCode && EntityRenderer.test){ - AdminRay.start(); - ModManager.adminRay.setEnabled(!ModManager.adminRay.isEnabled()); - this.renderGlobal.loadRenderers(); - } - - if(k == KeyboardConstants.KEY_0) { - this.displayGuiScreen(new ClickGuiRewrite()); - } - - if (k == 32 && Keyboard.isKeyDown(61) && this.ingameGUI != null) { - this.ingameGUI.getChatGUI().clearChatMessages(); - } - - if (k == 31 && Keyboard.isKeyDown(61)) { - this.refreshResources(); - } - - if (k == 17 && Keyboard.isKeyDown(61)) { - ; - } - - if (k == 18 && Keyboard.isKeyDown(61)) { - ; - } - - if (k == 47 && Keyboard.isKeyDown(61)) { - ; - } - - if (k == 38 && Keyboard.isKeyDown(61)) { - ; - } - - if (k == 22 && Keyboard.isKeyDown(61)) { - ; - } - - if (k == 20 && Keyboard.isKeyDown(61)) { - this.refreshResources(); - } - - if (k == 33 && Keyboard.isKeyDown(61)) { - this.gameSettings.setOptionValue(GameSettings.Options.RENDER_DISTANCE, - GuiScreen.isShiftKeyDown() ? -1 : 1); - } - - if (k == 30 && Keyboard.isKeyDown(61)) { - GlStateManager.recompileShaders(); - this.renderGlobal.loadRenderers(); - } - - if (k == 35 && Keyboard.isKeyDown(61)) { - this.gameSettings.advancedItemTooltips = !this.gameSettings.advancedItemTooltips; - this.gameSettings.saveOptions(); - } - - if (k == 48 && Keyboard.isKeyDown(61)) { - this.renderManager.setDebugBoundingBox(!this.renderManager.isDebugBoundingBox()); - } - - if (k == 25 && Keyboard.isKeyDown(61)) { - this.gameSettings.pauseOnLostFocus = !this.gameSettings.pauseOnLostFocus; - this.gameSettings.saveOptions(); - } - - if (k == 59) { - this.gameSettings.hideGUI = !this.gameSettings.hideGUI; - } - - if (k == 61) { - this.gameSettings.showDebugInfo = !this.gameSettings.showDebugInfo; - this.gameSettings.showDebugProfilerChart = GuiScreen.isShiftKeyDown(); - this.gameSettings.field_181657_aC = GuiScreen.isAltKeyDown(); - } - - if (this.gameSettings.keyBindTogglePerspective.isPressed()) { - ++this.gameSettings.thirdPersonView; - if (this.gameSettings.thirdPersonView > 2) { - this.gameSettings.thirdPersonView = 0; - } - - if (this.gameSettings.thirdPersonView == 0) { - this.entityRenderer.loadEntityShader(this.getRenderViewEntity()); - } else if (this.gameSettings.thirdPersonView == 1) { - this.entityRenderer.loadEntityShader((Entity) null); - } - - this.renderGlobal.setDisplayListEntitiesDirty(); - } - - if (this.gameSettings.keyBindSmoothCamera.isPressed()) { - this.gameSettings.smoothCamera = !this.gameSettings.smoothCamera; - } - } - - if (this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart) { - if (k == 11) { - this.updateDebugProfilerName(0); - } - - for (int j1 = 0; j1 < 9; ++j1) { - if (k == 2 + j1) { - this.updateDebugProfilerName(j1 + 1); - } - } - } - } - } - - for (int l = 0; l < 9; ++l) { - if (this.gameSettings.keyBindsHotbar[l].isPressed()) { - if (this.thePlayer.isSpectator()) { - this.ingameGUI.getSpectatorGui().func_175260_a(l); - } else { - this.thePlayer.inventory.currentItem = l; - } - } - } - - boolean flag = this.gameSettings.chatVisibility != EntityPlayer.EnumChatVisibility.HIDDEN; - - while (this.gameSettings.keyBindInventory.isPressed()) { - if (this.playerController.isRidingHorse()) { - this.thePlayer.sendHorseInventory(); - } else { - this.getNetHandler().addToSendQueue( - new C16PacketClientStatus(C16PacketClientStatus.EnumState.OPEN_INVENTORY_ACHIEVEMENT)); - this.displayGuiScreen(new GuiInventory(this.thePlayer)); - } - } - - while (this.gameSettings.keyBindDrop.isPressed()) { - if (!this.thePlayer.isSpectator()) { - this.thePlayer.dropOneItem(GuiScreen.isCtrlKeyDown()); - } - } - - while (this.gameSettings.keyBindChat.isPressed() && flag) { - this.displayGuiScreen(new GuiChat()); - } - - if (this.currentScreen == null && this.gameSettings.keyBindCommand.isPressed() && flag) { - this.displayGuiScreen(new GuiChat("/")); - } - - if (this.thePlayer.isUsingItem()) { - if (!this.gameSettings.keyBindUseItem.isKeyDown()) { - this.playerController.onStoppedUsingItem(this.thePlayer); - } - - while (this.gameSettings.keyBindAttack.isPressed()) { - ; - } - - while (this.gameSettings.keyBindUseItem.isPressed()) { - ; - } - - while (this.gameSettings.keyBindPickBlock.isPressed()) { - ; - } - } else { - while (this.gameSettings.keyBindAttack.isPressed()) { - this.clickMouse(); - } - - while (this.gameSettings.keyBindUseItem.isPressed()) { - this.rightClickMouse(); - } - - while (this.gameSettings.keyBindPickBlock.isPressed()) { - this.middleClickMouse(); - } - } - - if (this.gameSettings.keyBindUseItem.isKeyDown() && this.rightClickDelayTimer == 0 - && !this.thePlayer.isUsingItem()) { - this.rightClickMouse(); - } - - this.sendClickBlockToController( - this.currentScreen == null && this.gameSettings.keyBindAttack.isKeyDown() && this.inGameHasFocus); - } - - if (this.theWorld != null) { - if (this.thePlayer != null) { - ++this.joinPlayerCounter; - if (this.joinPlayerCounter == 30) { - this.joinPlayerCounter = 0; - this.theWorld.joinEntityInSurroundings(this.thePlayer); - } - } - - this.mcProfiler.endStartSection("gameRenderer"); - if (!this.isGamePaused) { - this.entityRenderer.updateRenderer(); - } - - this.mcProfiler.endStartSection("levelRenderer"); - if (!this.isGamePaused) { - this.renderGlobal.updateClouds(); - } - - this.mcProfiler.endStartSection("level"); - if (!this.isGamePaused) { - if (this.theWorld.getLastLightningBolt() > 0) { - this.theWorld.setLastLightningBolt(this.theWorld.getLastLightningBolt() - 1); - } - - this.theWorld.updateEntities(); - } - } else if (this.entityRenderer.isShaderActive()) { - this.entityRenderer.func_181022_b(); - } - - if (!this.isGamePaused) { - this.mcMusicTicker.update(); - this.mcSoundHandler.update(); - } - - if (this.theWorld != null) { - if (!this.isGamePaused) { - this.theWorld.setAllowedSpawnTypes(this.theWorld.getDifficulty() != EnumDifficulty.PEACEFUL, true); - - try { - this.theWorld.tick(); - } catch (Throwable throwable2) { - CrashReport crashreport2 = CrashReport.makeCrashReport(throwable2, "Exception in world tick"); - if (this.theWorld == null) { - CrashReportCategory crashreportcategory2 = crashreport2.makeCategory("Affected level"); - crashreportcategory2.addCrashSection("Problem", "Level is null!"); - } else { - this.theWorld.addWorldInfoToCrashReport(crashreport2); - } - - throw new ReportedException(crashreport2); - } - } - - this.mcProfiler.endStartSection("animateTick"); - if (!this.isGamePaused && this.theWorld != null) { - this.theWorld.doVoidFogParticles(MathHelper.floor_double(this.thePlayer.posX), - MathHelper.floor_double(this.thePlayer.posY), MathHelper.floor_double(this.thePlayer.posZ)); - } - - this.mcProfiler.endStartSection("particles"); - if (!this.isGamePaused) { - this.effectRenderer.updateEffects(); - } - } else if (this.myNetworkManager != null) { - this.mcProfiler.endStartSection("pendingConnection"); - this.myNetworkManager.processReceivedPackets(); - } - - if (this.theWorld != null) { - ++joinWorldTickCounter; - } else { - joinWorldTickCounter = 0; - } - - this.mcProfiler.endSection(); - this.systemTime = getSystemTime(); - } - - /**+ - * Arguments: World foldername, World ingame name, WorldSettings - */ - public void launchIntegratedServer(String folderName, String worldName, WorldSettings worldSettingsIn) { - throw new UnsupportedOperationException("singleplayer has been removed"); - } - - /**+ - * unloads the current world first - */ - public void loadWorld(WorldClient worldClientIn) { - this.loadWorld(worldClientIn, ""); - } - - /**+ - * unloads the current world first - */ - public void loadWorld(WorldClient worldClientIn, String loadingMessage) { - if (worldClientIn == null) { - NetHandlerPlayClient nethandlerplayclient = this.getNetHandler(); - if (nethandlerplayclient != null) { - nethandlerplayclient.cleanup(); - } - session.reset(); - - this.guiAchievement.clearAchievements(); - this.entityRenderer.getMapItemRenderer().clearLoadedMaps(); - } - - this.renderViewEntity = null; - this.myNetworkManager = null; - if (this.loadingScreen != null) { - this.loadingScreen.resetProgressAndMessage(loadingMessage); - this.loadingScreen.displayLoadingString(""); - } - - if (worldClientIn == null && this.theWorld != null) { - this.mcResourcePackRepository.func_148529_f(); - this.ingameGUI.func_181029_i(); - this.setServerData((ServerData) null); - this.integratedServerIsRunning = false; - } - - this.mcSoundHandler.stopSounds(); - this.theWorld = worldClientIn; - if (worldClientIn != null) { - if (this.renderGlobal != null) { - this.renderGlobal.setWorldAndLoadRenderers(worldClientIn); - } - - if (this.effectRenderer != null) { - this.effectRenderer.clearEffects(worldClientIn); - } - - if (this.thePlayer == null) { - this.thePlayer = this.playerController.func_178892_a(worldClientIn, new StatFileWriter()); - this.playerController.flipPlayer(this.thePlayer); - } - - this.thePlayer.preparePlayerToSpawn(); - worldClientIn.spawnEntityInWorld(this.thePlayer); - this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings); - this.playerController.setPlayerCapabilities(this.thePlayer); - this.renderViewEntity = this.thePlayer; - } else { - this.thePlayer = null; - } - - ModManager.scoreboard.setEnabled(true); - this.gameSettings.loadOptions(); - System.gc(); - this.systemTime = 0L; - } - - public void setDimensionAndSpawnPlayer(int dimension) { - this.theWorld.setInitialSpawnLocation(); - this.theWorld.removeAllEntities(); - int i = 0; - String s = null; - if (this.thePlayer != null) { - i = this.thePlayer.getEntityId(); - this.theWorld.removeEntity(this.thePlayer); - s = this.thePlayer.getClientBrand(); - } - - this.renderViewEntity = null; - EntityPlayerSP entityplayersp = this.thePlayer; - this.thePlayer = this.playerController.func_178892_a(this.theWorld, new StatFileWriter()); - this.thePlayer.getDataWatcher().updateWatchedObjectsFromList(entityplayersp.getDataWatcher().getAllWatched()); - this.thePlayer.dimension = dimension; - this.renderViewEntity = this.thePlayer; - this.thePlayer.preparePlayerToSpawn(); - this.thePlayer.setClientBrand(s); - this.theWorld.spawnEntityInWorld(this.thePlayer); - this.playerController.flipPlayer(this.thePlayer); - this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings); - this.thePlayer.setEntityId(i); - this.playerController.setPlayerCapabilities(this.thePlayer); - this.thePlayer.setReducedDebug(entityplayersp.hasReducedDebug()); - if (this.currentScreen instanceof GuiGameOver) { - this.displayGuiScreen((GuiScreen) null); - } - - } - - /**+ - * Gets whether this is a demo or not. - */ - public final boolean isDemo() { - return this.isDemo; - } - - public NetHandlerPlayClient getNetHandler() { - return this.thePlayer != null ? this.thePlayer.sendQueue : null; - } - - public static boolean isGuiEnabled() { - return theMinecraft == null || !theMinecraft.gameSettings.hideGUI; - } - - public static boolean isFancyGraphicsEnabled() { - return theMinecraft != null && theMinecraft.gameSettings.fancyGraphics; - } - - /**+ - * Returns if ambient occlusion is enabled - */ - public static boolean isAmbientOcclusionEnabled() { - return theMinecraft != null && theMinecraft.gameSettings.ambientOcclusion != 0; - } - - /**+ - * Called when user clicked he's mouse middle button (pick - * block) - */ - private void middleClickMouse() { - if (this.objectMouseOver != null) { - boolean flag = this.thePlayer.capabilities.isCreativeMode; - int i = 0; - boolean flag1 = false; - TileEntity tileentity = null; - Object object; - if (this.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { - BlockPos blockpos = this.objectMouseOver.getBlockPos(); - Block block = this.theWorld.getBlockState(blockpos).getBlock(); - if (block.getMaterial() == Material.air) { - return; - } - - object = block.getItem(this.theWorld, blockpos); - if (object == null) { - return; - } - - if (flag && GuiScreen.isCtrlKeyDown()) { - tileentity = this.theWorld.getTileEntity(blockpos); - } - - Block block1 = object instanceof ItemBlock && !block.isFlowerPot() - ? Block.getBlockFromItem((Item) object) - : block; - i = block1.getDamageValue(this.theWorld, blockpos); - flag1 = ((Item) object).getHasSubtypes(); - } else { - if (this.objectMouseOver.typeOfHit != MovingObjectPosition.MovingObjectType.ENTITY - || this.objectMouseOver.entityHit == null || !flag) { - return; - } - - if (this.objectMouseOver.entityHit instanceof EntityPainting) { - object = Items.painting; - } else if (this.objectMouseOver.entityHit instanceof EntityLeashKnot) { - object = Items.lead; - } else if (this.objectMouseOver.entityHit instanceof EntityItemFrame) { - EntityItemFrame entityitemframe = (EntityItemFrame) this.objectMouseOver.entityHit; - ItemStack itemstack = entityitemframe.getDisplayedItem(); - if (itemstack == null) { - object = Items.item_frame; - } else { - object = itemstack.getItem(); - i = itemstack.getMetadata(); - flag1 = true; - } - } else if (this.objectMouseOver.entityHit instanceof EntityMinecart) { - EntityMinecart entityminecart = (EntityMinecart) this.objectMouseOver.entityHit; - switch (entityminecart.getMinecartType()) { - case FURNACE: - object = Items.furnace_minecart; - break; - case CHEST: - object = Items.chest_minecart; - break; - case TNT: - object = Items.tnt_minecart; - break; - case HOPPER: - object = Items.hopper_minecart; - break; - case COMMAND_BLOCK: - object = Items.command_block_minecart; - break; - default: - object = Items.minecart; - } - } else if (this.objectMouseOver.entityHit instanceof EntityBoat) { - object = Items.boat; - } else if (this.objectMouseOver.entityHit instanceof EntityArmorStand) { - object = Items.armor_stand; - } else { - object = Items.spawn_egg; - i = EntityList.getEntityID(this.objectMouseOver.entityHit); - flag1 = true; - if (!EntityList.entityEggs.containsKey(Integer.valueOf(i))) { - return; - } - } - } - - InventoryPlayer inventoryplayer = this.thePlayer.inventory; - if (tileentity == null) { - inventoryplayer.setCurrentItem((Item) object, i, flag1, flag); - } else { - ItemStack itemstack1 = this.func_181036_a((Item) object, i, tileentity); - inventoryplayer.setInventorySlotContents(inventoryplayer.currentItem, itemstack1); - } - - if (flag) { - int j = this.thePlayer.inventoryContainer.inventorySlots.size() - 9 + inventoryplayer.currentItem; - this.playerController.sendSlotPacket(inventoryplayer.getStackInSlot(inventoryplayer.currentItem), j); - } - - } - } - - private ItemStack func_181036_a(Item parItem, int parInt1, TileEntity parTileEntity) { - ItemStack itemstack = new ItemStack(parItem, 1, parInt1); - NBTTagCompound nbttagcompound = new NBTTagCompound(); - parTileEntity.writeToNBT(nbttagcompound); - if (parItem == Items.skull && nbttagcompound.hasKey("Owner")) { - NBTTagCompound nbttagcompound2 = nbttagcompound.getCompoundTag("Owner"); - NBTTagCompound nbttagcompound3 = new NBTTagCompound(); - nbttagcompound3.setTag("SkullOwner", nbttagcompound2); - itemstack.setTagCompound(nbttagcompound3); - return itemstack; - } else { - itemstack.setTagInfo("BlockEntityTag", nbttagcompound); - NBTTagCompound nbttagcompound1 = new NBTTagCompound(); - NBTTagList nbttaglist = new NBTTagList(); - nbttaglist.appendTag(new NBTTagString("(+NBT)")); - nbttagcompound1.setTag("Lore", nbttaglist); - itemstack.setTagInfo("display", nbttagcompound1); - return itemstack; - } - } - - /**+ - * adds core server Info (GL version , Texture pack, isModded, - * type), and the worldInfo to the crash report - */ - public CrashReport addGraphicsAndWorldToCrashReport(CrashReport theCrash) { - theCrash.getCategory().addCrashSectionCallable("Launched Version", new Callable() { - public String call() throws Exception { - return Minecraft.this.launchedVersion; - } - }); - theCrash.getCategory().addCrashSectionCallable("LWJGL", new Callable() { - public String call() { - return EagRuntime.getVersion(); - } - }); - theCrash.getCategory().addCrashSectionCallable("OpenGL", new Callable() { - public String call() { - return EaglercraftGPU.glGetString(7937) + " GL version " + EaglercraftGPU.glGetString(7938) + ", " - + EaglercraftGPU.glGetString(7936); - } - }); - theCrash.getCategory().addCrashSectionCallable("Is Modded", new Callable() { - public String call() throws Exception { - return "Definitely Not; You're an eagler"; - } - }); - theCrash.getCategory().addCrashSectionCallable("Type", new Callable() { - public String call() throws Exception { - return "Client (map_client.txt)"; - } - }); - theCrash.getCategory().addCrashSectionCallable("Resource Packs", new Callable() { - public String call() throws Exception { - StringBuilder stringbuilder = new StringBuilder(); - - for (String s : Minecraft.this.gameSettings.resourcePacks) { - if (stringbuilder.length() > 0) { - stringbuilder.append(", "); - } - - stringbuilder.append(s); - if (Minecraft.this.gameSettings.field_183018_l.contains(s)) { - stringbuilder.append(" (incompatible)"); - } - } - - return stringbuilder.toString(); - } - }); - theCrash.getCategory().addCrashSectionCallable("Current Language", new Callable() { - public String call() throws Exception { - return Minecraft.this.mcLanguageManager.getCurrentLanguage().toString(); - } - }); - theCrash.getCategory().addCrashSectionCallable("Profiler Position", new Callable() { - public String call() throws Exception { - return Minecraft.this.mcProfiler.profilingEnabled ? Minecraft.this.mcProfiler.getNameOfLastSection() - : "N/A (disabled)"; - } - }); - if (this.theWorld != null) { - this.theWorld.addWorldInfoToCrashReport(theCrash); - } - - return theCrash; - } - - /**+ - * Return the singleton Minecraft instance for the game - */ - public static Minecraft getMinecraft() { - return theMinecraft; - } - - public ListenableFuture scheduleResourcesRefresh() { - return this.addScheduledTask(new Runnable() { - public void run() { - Minecraft.this.loadingScreen.eaglerShow(I18n.format("resourcePack.load.refreshing"), - I18n.format("resourcePack.load.pleaseWait")); - Minecraft.this.refreshResources(); - } - }); - } - - private String func_181538_aA() { - return this.currentServerData != null ? "multiplayer" : "out_of_game"; - } - - /**+ - * Returns whether snooping is enabled or not. - */ - public boolean isSnooperEnabled() { - return this.gameSettings.snooperEnabled; - } - - /**+ - * Set the current ServerData instance. - */ - public void setServerData(ServerData serverDataIn) { - this.currentServerData = serverDataIn; - } - - public ServerData getCurrentServerData() { - return this.currentServerData; - } - - public boolean isIntegratedServerRunning() { - return this.integratedServerIsRunning; - } - - /**+ - * Returns true if there is only one player playing, and the - * current server is the integrated one. - */ - public boolean isSingleplayer() { - return false; - } - - public static void stopIntegratedServer() { - - } - - /**+ - * Gets the system time in milliseconds. - */ - public static long getSystemTime() { - return System.currentTimeMillis(); - } - - /**+ - * Returns whether we're in full screen or not. - */ - public boolean isFullScreen() { - return Display.isFullscreen(); - } - - public Session getSession() { - return this.session; - } - - public TextureManager getTextureManager() { - return this.renderEngine; - } - - public IResourceManager getResourceManager() { - return this.mcResourceManager; - } - - public ResourcePackRepository getResourcePackRepository() { - return this.mcResourcePackRepository; - } - - public LanguageManager getLanguageManager() { - return this.mcLanguageManager; - } - - public TextureMap getTextureMapBlocks() { - return this.textureMapBlocks; - } - - public boolean isJava64bit() { - return this.jvm64bit; - } - - public boolean isGamePaused() { - return this.isGamePaused; - } - - public SoundHandler getSoundHandler() { - return this.mcSoundHandler; - } - - public MusicTicker.MusicType getAmbientMusicType() { - return this.thePlayer != null ? (this.thePlayer.worldObj.provider instanceof WorldProviderHell - ? MusicTicker.MusicType.NETHER - : (this.thePlayer.worldObj.provider instanceof WorldProviderEnd - ? (BossStatus.bossName != null && BossStatus.statusBarTime > 0 ? MusicTicker.MusicType.END_BOSS - : MusicTicker.MusicType.END) - : (this.thePlayer.capabilities.isCreativeMode && this.thePlayer.capabilities.allowFlying - ? MusicTicker.MusicType.CREATIVE - : MusicTicker.MusicType.GAME))) - : MusicTicker.MusicType.MENU; - } - - public void dispatchKeypresses() { - int i = Keyboard.getEventKey() == 0 ? Keyboard.getEventCharacter() : Keyboard.getEventKey(); - if (i != 0 && !Keyboard.isRepeatEvent()) { - if (!(this.currentScreen instanceof GuiControls) - || ((GuiControls) this.currentScreen).time <= getSystemTime() - 20L) { - if (Keyboard.getEventKeyState()) { - if (i == this.gameSettings.keyBindScreenshot.getKeyCode()) { - this.ingameGUI.getChatGUI().printChatMessage(ScreenShotHelper.saveScreenshot()); - } - } - } - } - } - - public Entity getRenderViewEntity() { - return this.renderViewEntity; - } - - public void setRenderViewEntity(Entity viewingEntity) { - this.renderViewEntity = viewingEntity; - this.entityRenderer.loadEntityShader(viewingEntity); - } - - public ListenableFuture addScheduledTask(Callable callableToSchedule) { - Validate.notNull(callableToSchedule); - ListenableFutureTask listenablefuturetask = ListenableFutureTask.create(callableToSchedule); - synchronized (this.scheduledTasks) { - this.scheduledTasks.add(listenablefuturetask); - return listenablefuturetask; - } - } - - public ListenableFuture addScheduledTask(Runnable runnableToSchedule) { - Validate.notNull(runnableToSchedule); - return this.addScheduledTask(Executors.callable(runnableToSchedule)); - } - - public BlockRendererDispatcher getBlockRendererDispatcher() { - return this.blockRenderDispatcher; - } - - public RenderManager getRenderManager() { - return this.renderManager; - } - - public RenderItem getRenderItem() { - return this.renderItem; - } - - public ItemRenderer getItemRenderer() { - return this.itemRenderer; - } - - public static int getDebugFPS() { - return debugFPS; - } - - public FrameTimer func_181539_aj() { - return this.field_181542_y; - } - - public boolean func_181540_al() { - return this.field_181541_X; - } - - public void func_181537_a(boolean parFlag) { - this.field_181541_X = parFlag; - } - - /**+ - * Used in the usage snooper. - */ - public static int getGLMaximumTextureSize() { - return EaglercraftGPU.glGetInteger(GL_MAX_TEXTURE_SIZE); - } - - public boolean areKeysLocked() { - return PlatformInput.lockKeys; - } -} \ No newline at end of file + if (k == this.gameSettings.keyBindClickGui.getKeyCode()) { + this.displayGuiScreen(new PreGUI()); + } + + if (k == this.gameSettings.keyBindAdminX.keyCode && EntityRenderer.test) { + AdminRay.start(); + ModManager.adminRay.setEnabled(!ModManager.adminRay.isEnabled()); + this.renderGlobal.loadRenderers(); + } + + if (k == KeyboardConstants.KEY_0) { + this.displayGuiScreen(new ClickGuiRewrite()); + } + + if (k == 32 && Keyboard.isKeyDown(61) && this.ingameGUI != null) { + this.ingameGUI.getChatGUI().clearChatMessages(); + } + + if (k == 31 && Keyboard.isKeyDown(61)) { + this.refreshResources(); + } + + if (k == 17 && Keyboard.isKeyDown(61)) {} + + if (k == 18 && Keyboard.isKeyDown(61)) {} + + if (k == 47 && Keyboard.isKeyDown(61)) {} + + if (k == 38 && Keyboard.isKeyDown(61)) {} + + if (k == 22 && Keyboard.isKeyDown(61)) {} + + if (k == 20 && Keyboard.isKeyDown(61)) { + this.refreshResources(); + } + + if (k == 33 && Keyboard.isKeyDown(61)) { + this.gameSettings.setOptionValue(GameSettings.Options.RENDER_DISTANCE, GuiScreen.isShiftKeyDown() ? -1 : 1); + } + + if (k == 30 && Keyboard.isKeyDown(61)) { + GlStateManager.recompileShaders(); + this.renderGlobal.loadRenderers(); + } + + if (k == 35 && Keyboard.isKeyDown(61)) { + this.gameSettings.advancedItemTooltips = !this.gameSettings.advancedItemTooltips; + this.gameSettings.saveOptions(); + } + + if (k == 48 && Keyboard.isKeyDown(61)) { + this.renderManager.setDebugBoundingBox(!this.renderManager.isDebugBoundingBox()); + } + + if (k == 25 && Keyboard.isKeyDown(61)) { + this.gameSettings.pauseOnLostFocus = !this.gameSettings.pauseOnLostFocus; + this.gameSettings.saveOptions(); + } + + if (k == 59) { + this.gameSettings.hideGUI = !this.gameSettings.hideGUI; + } + + if (k == 61) { + this.gameSettings.showDebugInfo = !this.gameSettings.showDebugInfo; + this.gameSettings.showDebugProfilerChart = GuiScreen.isShiftKeyDown(); + this.gameSettings.field_181657_aC = GuiScreen.isAltKeyDown(); + } + + if (this.gameSettings.keyBindTogglePerspective.isPressed()) { + ++this.gameSettings.thirdPersonView; + if (this.gameSettings.thirdPersonView > 2) { + this.gameSettings.thirdPersonView = 0; + } + + if (this.gameSettings.thirdPersonView == 0) { + this.entityRenderer.loadEntityShader(this.getRenderViewEntity()); + } else if (this.gameSettings.thirdPersonView == 1) { + this.entityRenderer.loadEntityShader((Entity) null); + } + + this.renderGlobal.setDisplayListEntitiesDirty(); + } + + if (this.gameSettings.keyBindSmoothCamera.isPressed()) { + this.gameSettings.smoothCamera = !this.gameSettings.smoothCamera; + } + } + + if (this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart) { + if (k == 11) { + this.updateDebugProfilerName(0); + } + + for (int j1 = 0; j1 < 9; ++j1) { + if (k == 2 + j1) { + this.updateDebugProfilerName(j1 + 1); + } + } + } + } + } + + for (int l = 0; l < 9; ++l) { + if (this.gameSettings.keyBindsHotbar[l].isPressed()) { + if (this.thePlayer.isSpectator()) { + this.ingameGUI.getSpectatorGui().func_175260_a(l); + } else { + this.thePlayer.inventory.currentItem = l; + } + } + } + + boolean flag = this.gameSettings.chatVisibility != EntityPlayer.EnumChatVisibility.HIDDEN; + + while (this.gameSettings.keyBindInventory.isPressed()) { + if (this.playerController.isRidingHorse()) { + this.thePlayer.sendHorseInventory(); + } else { + this.getNetHandler().addToSendQueue(new C16PacketClientStatus(C16PacketClientStatus.EnumState.OPEN_INVENTORY_ACHIEVEMENT)); + this.displayGuiScreen(new GuiInventory(this.thePlayer)); + } + } + + while (this.gameSettings.keyBindDrop.isPressed()) { + if (!this.thePlayer.isSpectator()) { + this.thePlayer.dropOneItem(GuiScreen.isCtrlKeyDown()); + } + } + + while (this.gameSettings.keyBindChat.isPressed() && flag) { + this.displayGuiScreen(new GuiChat()); + } + + if (this.currentScreen == null && this.gameSettings.keyBindCommand.isPressed() && flag) { + this.displayGuiScreen(new GuiChat("/")); + } + + if (this.thePlayer.isUsingItem()) { + if (!this.gameSettings.keyBindUseItem.isKeyDown()) { + this.playerController.onStoppedUsingItem(this.thePlayer); + } + + while (this.gameSettings.keyBindAttack.isPressed()) {} + + while (this.gameSettings.keyBindUseItem.isPressed()) {} + + while (this.gameSettings.keyBindPickBlock.isPressed()) {} + } else { + while (this.gameSettings.keyBindAttack.isPressed()) { + this.clickMouse(); + } + + while (this.gameSettings.keyBindUseItem.isPressed()) { + this.rightClickMouse(); + } + + while (this.gameSettings.keyBindPickBlock.isPressed()) { + this.middleClickMouse(); + } + } + + if (this.gameSettings.keyBindUseItem.isKeyDown() && this.rightClickDelayTimer == 0 && !this.thePlayer.isUsingItem()) { + this.rightClickMouse(); + } + + this.sendClickBlockToController(this.currentScreen == null && this.gameSettings.keyBindAttack.isKeyDown() && this.inGameHasFocus); + } + + if (this.theWorld != null) { + if (this.thePlayer != null) { + ++this.joinPlayerCounter; + if (this.joinPlayerCounter == 30) { + this.joinPlayerCounter = 0; + this.theWorld.joinEntityInSurroundings(this.thePlayer); + } + } + + this.mcProfiler.endStartSection("gameRenderer"); + if (!this.isGamePaused) { + this.entityRenderer.updateRenderer(); + } + + this.mcProfiler.endStartSection("levelRenderer"); + if (!this.isGamePaused) { + this.renderGlobal.updateClouds(); + } + + this.mcProfiler.endStartSection("level"); + if (!this.isGamePaused) { + if (this.theWorld.getLastLightningBolt() > 0) { + this.theWorld.setLastLightningBolt(this.theWorld.getLastLightningBolt() - 1); + } + + this.theWorld.updateEntities(); + } + } else if (this.entityRenderer.isShaderActive()) { + this.entityRenderer.func_181022_b(); + } + + if (!this.isGamePaused) { + this.mcMusicTicker.update(); + this.mcSoundHandler.update(); + } + + if (this.theWorld != null) { + if (!this.isGamePaused) { + this.theWorld.setAllowedSpawnTypes(this.theWorld.getDifficulty() != EnumDifficulty.PEACEFUL, true); + + try { + this.theWorld.tick(); + } catch (Throwable throwable2) { + CrashReport crashreport2 = CrashReport.makeCrashReport(throwable2, "Exception in world tick"); + if (this.theWorld == null) { + CrashReportCategory crashreportcategory2 = crashreport2.makeCategory("Affected level"); + crashreportcategory2.addCrashSection("Problem", "Level is null!"); + } else { + this.theWorld.addWorldInfoToCrashReport(crashreport2); + } + + throw new ReportedException(crashreport2); + } + } + + this.mcProfiler.endStartSection("animateTick"); + if (!this.isGamePaused && this.theWorld != null) { + this.theWorld.doVoidFogParticles(MathHelper.floor_double(this.thePlayer.posX), MathHelper.floor_double(this.thePlayer.posY), MathHelper.floor_double(this.thePlayer.posZ)); + } + + this.mcProfiler.endStartSection("particles"); + if (!this.isGamePaused) { + this.effectRenderer.updateEffects(); + } + } else if (this.myNetworkManager != null) { + this.mcProfiler.endStartSection("pendingConnection"); + this.myNetworkManager.processReceivedPackets(); + } + + if (this.theWorld != null) { + ++joinWorldTickCounter; + } else { + joinWorldTickCounter = 0; + } + + this.mcProfiler.endSection(); + this.systemTime = getSystemTime(); + } + + /**+ + * Arguments: World foldername, World ingame name, WorldSettings + */ + public void launchIntegratedServer(String folderName, String worldName, WorldSettings worldSettingsIn) { + throw new UnsupportedOperationException("singleplayer has been removed"); + } + + /**+ + * unloads the current world first + */ + public void loadWorld(WorldClient worldClientIn) { + this.loadWorld(worldClientIn, ""); + } + + /**+ + * unloads the current world first + */ + public void loadWorld(WorldClient worldClientIn, String loadingMessage) { + if (worldClientIn == null) { + NetHandlerPlayClient nethandlerplayclient = this.getNetHandler(); + if (nethandlerplayclient != null) { + nethandlerplayclient.cleanup(); + } + session.reset(); + + this.guiAchievement.clearAchievements(); + this.entityRenderer.getMapItemRenderer().clearLoadedMaps(); + } + + this.renderViewEntity = null; + this.myNetworkManager = null; + if (this.loadingScreen != null) { + this.loadingScreen.resetProgressAndMessage(loadingMessage); + this.loadingScreen.displayLoadingString(""); + } + + if (worldClientIn == null && this.theWorld != null) { + this.mcResourcePackRepository.func_148529_f(); + this.ingameGUI.func_181029_i(); + this.setServerData((ServerData) null); + this.integratedServerIsRunning = false; + } + + this.mcSoundHandler.stopSounds(); + this.theWorld = worldClientIn; + if (worldClientIn != null) { + if (this.renderGlobal != null) { + this.renderGlobal.setWorldAndLoadRenderers(worldClientIn); + } + + if (this.effectRenderer != null) { + this.effectRenderer.clearEffects(worldClientIn); + } + + if (this.thePlayer == null) { + this.thePlayer = this.playerController.func_178892_a(worldClientIn, new StatFileWriter()); + this.playerController.flipPlayer(this.thePlayer); + } + + this.thePlayer.preparePlayerToSpawn(); + worldClientIn.spawnEntityInWorld(this.thePlayer); + this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings); + this.playerController.setPlayerCapabilities(this.thePlayer); + this.renderViewEntity = this.thePlayer; + } else { + this.thePlayer = null; + } + + ModManager.scoreboard.setEnabled(true); + this.gameSettings.loadOptions(); + System.gc(); + this.systemTime = 0L; + } + + public void setDimensionAndSpawnPlayer(int dimension) { + this.theWorld.setInitialSpawnLocation(); + this.theWorld.removeAllEntities(); + int i = 0; + String s = null; + if (this.thePlayer != null) { + i = this.thePlayer.getEntityId(); + this.theWorld.removeEntity(this.thePlayer); + s = this.thePlayer.getClientBrand(); + } + + this.renderViewEntity = null; + EntityPlayerSP entityplayersp = this.thePlayer; + this.thePlayer = this.playerController.func_178892_a(this.theWorld, new StatFileWriter()); + this.thePlayer.getDataWatcher().updateWatchedObjectsFromList(entityplayersp.getDataWatcher().getAllWatched()); + this.thePlayer.dimension = dimension; + this.renderViewEntity = this.thePlayer; + this.thePlayer.preparePlayerToSpawn(); + this.thePlayer.setClientBrand(s); + this.theWorld.spawnEntityInWorld(this.thePlayer); + this.playerController.flipPlayer(this.thePlayer); + this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings); + this.thePlayer.setEntityId(i); + this.playerController.setPlayerCapabilities(this.thePlayer); + this.thePlayer.setReducedDebug(entityplayersp.hasReducedDebug()); + if (this.currentScreen instanceof GuiGameOver) { + this.displayGuiScreen((GuiScreen) null); + } + } + + /**+ + * Gets whether this is a demo or not. + */ + public final boolean isDemo() { + return this.isDemo; + } + + public NetHandlerPlayClient getNetHandler() { + return this.thePlayer != null ? this.thePlayer.sendQueue : null; + } + + public static boolean isGuiEnabled() { + return theMinecraft == null || !theMinecraft.gameSettings.hideGUI; + } + + public static boolean isFancyGraphicsEnabled() { + return theMinecraft != null && theMinecraft.gameSettings.fancyGraphics; + } + + /**+ + * Returns if ambient occlusion is enabled + */ + public static boolean isAmbientOcclusionEnabled() { + return theMinecraft != null && theMinecraft.gameSettings.ambientOcclusion != 0; + } + + /**+ + * Called when user clicked he's mouse middle button (pick + * block) + */ + private void middleClickMouse() { + if (this.objectMouseOver != null) { + boolean flag = this.thePlayer.capabilities.isCreativeMode; + int i = 0; + boolean flag1 = false; + TileEntity tileentity = null; + Object object; + if (this.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + BlockPos blockpos = this.objectMouseOver.getBlockPos(); + Block block = this.theWorld.getBlockState(blockpos).getBlock(); + if (block.getMaterial() == Material.air) { + return; + } + + object = block.getItem(this.theWorld, blockpos); + if (object == null) { + return; + } + + if (flag && GuiScreen.isCtrlKeyDown()) { + tileentity = this.theWorld.getTileEntity(blockpos); + } + + Block block1 = object instanceof ItemBlock && !block.isFlowerPot() ? Block.getBlockFromItem((Item) object) : block; + i = block1.getDamageValue(this.theWorld, blockpos); + flag1 = ((Item) object).getHasSubtypes(); + } else { + if (this.objectMouseOver.typeOfHit != MovingObjectPosition.MovingObjectType.ENTITY || this.objectMouseOver.entityHit == null || !flag) { + return; + } + + if (this.objectMouseOver.entityHit instanceof EntityPainting) { + object = Items.painting; + } else if (this.objectMouseOver.entityHit instanceof EntityLeashKnot) { + object = Items.lead; + } else if (this.objectMouseOver.entityHit instanceof EntityItemFrame) { + EntityItemFrame entityitemframe = (EntityItemFrame) this.objectMouseOver.entityHit; + ItemStack itemstack = entityitemframe.getDisplayedItem(); + if (itemstack == null) { + object = Items.item_frame; + } else { + object = itemstack.getItem(); + i = itemstack.getMetadata(); + flag1 = true; + } + } else if (this.objectMouseOver.entityHit instanceof EntityMinecart) { + EntityMinecart entityminecart = (EntityMinecart) this.objectMouseOver.entityHit; + switch (entityminecart.getMinecartType()) { + case FURNACE: + object = Items.furnace_minecart; + break; + case CHEST: + object = Items.chest_minecart; + break; + case TNT: + object = Items.tnt_minecart; + break; + case HOPPER: + object = Items.hopper_minecart; + break; + case COMMAND_BLOCK: + object = Items.command_block_minecart; + break; + default: + object = Items.minecart; + } + } else if (this.objectMouseOver.entityHit instanceof EntityBoat) { + object = Items.boat; + } else if (this.objectMouseOver.entityHit instanceof EntityArmorStand) { + object = Items.armor_stand; + } else { + object = Items.spawn_egg; + i = EntityList.getEntityID(this.objectMouseOver.entityHit); + flag1 = true; + if (!EntityList.entityEggs.containsKey(Integer.valueOf(i))) { + return; + } + } + } + + InventoryPlayer inventoryplayer = this.thePlayer.inventory; + if (tileentity == null) { + inventoryplayer.setCurrentItem((Item) object, i, flag1, flag); + } else { + ItemStack itemstack1 = this.func_181036_a((Item) object, i, tileentity); + inventoryplayer.setInventorySlotContents(inventoryplayer.currentItem, itemstack1); + } + + if (flag) { + int j = this.thePlayer.inventoryContainer.inventorySlots.size() - 9 + inventoryplayer.currentItem; + this.playerController.sendSlotPacket(inventoryplayer.getStackInSlot(inventoryplayer.currentItem), j); + } + } + } + + private ItemStack func_181036_a(Item parItem, int parInt1, TileEntity parTileEntity) { + ItemStack itemstack = new ItemStack(parItem, 1, parInt1); + NBTTagCompound nbttagcompound = new NBTTagCompound(); + parTileEntity.writeToNBT(nbttagcompound); + if (parItem == Items.skull && nbttagcompound.hasKey("Owner")) { + NBTTagCompound nbttagcompound2 = nbttagcompound.getCompoundTag("Owner"); + NBTTagCompound nbttagcompound3 = new NBTTagCompound(); + nbttagcompound3.setTag("SkullOwner", nbttagcompound2); + itemstack.setTagCompound(nbttagcompound3); + return itemstack; + } else { + itemstack.setTagInfo("BlockEntityTag", nbttagcompound); + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + NBTTagList nbttaglist = new NBTTagList(); + nbttaglist.appendTag(new NBTTagString("(+NBT)")); + nbttagcompound1.setTag("Lore", nbttaglist); + itemstack.setTagInfo("display", nbttagcompound1); + return itemstack; + } + } + + /**+ + * adds core server Info (GL version , Texture pack, isModded, + * type), and the worldInfo to the crash report + */ + public CrashReport addGraphicsAndWorldToCrashReport(CrashReport theCrash) { + theCrash + .getCategory() + .addCrashSectionCallable( + "Launched Version", + new Callable() { + public String call() throws Exception { + return Minecraft.this.launchedVersion; + } + } + ); + theCrash + .getCategory() + .addCrashSectionCallable( + "LWJGL", + new Callable() { + public String call() { + return EagRuntime.getVersion(); + } + } + ); + theCrash + .getCategory() + .addCrashSectionCallable( + "OpenGL", + new Callable() { + public String call() { + return EaglercraftGPU.glGetString(7937) + " GL version " + EaglercraftGPU.glGetString(7938) + ", " + EaglercraftGPU.glGetString(7936); + } + } + ); + theCrash + .getCategory() + .addCrashSectionCallable( + "Is Modded", + new Callable() { + public String call() throws Exception { + return "Definitely Not; You're an eagler"; + } + } + ); + theCrash + .getCategory() + .addCrashSectionCallable( + "Type", + new Callable() { + public String call() throws Exception { + return "Client (map_client.txt)"; + } + } + ); + theCrash + .getCategory() + .addCrashSectionCallable( + "Resource Packs", + new Callable() { + public String call() throws Exception { + StringBuilder stringbuilder = new StringBuilder(); + + for (String s : Minecraft.this.gameSettings.resourcePacks) { + if (stringbuilder.length() > 0) { + stringbuilder.append(", "); + } + + stringbuilder.append(s); + if (Minecraft.this.gameSettings.field_183018_l.contains(s)) { + stringbuilder.append(" (incompatible)"); + } + } + + return stringbuilder.toString(); + } + } + ); + theCrash + .getCategory() + .addCrashSectionCallable( + "Current Language", + new Callable() { + public String call() throws Exception { + return Minecraft.this.mcLanguageManager.getCurrentLanguage().toString(); + } + } + ); + theCrash + .getCategory() + .addCrashSectionCallable( + "Profiler Position", + new Callable() { + public String call() throws Exception { + return Minecraft.this.mcProfiler.profilingEnabled ? Minecraft.this.mcProfiler.getNameOfLastSection() : "N/A (disabled)"; + } + } + ); + if (this.theWorld != null) { + this.theWorld.addWorldInfoToCrashReport(theCrash); + } + + return theCrash; + } + + /**+ + * Return the singleton Minecraft instance for the game + */ + public static Minecraft getMinecraft() { + return theMinecraft; + } + + public ListenableFuture scheduleResourcesRefresh() { + return this.addScheduledTask( + new Runnable() { + public void run() { + Minecraft.this.loadingScreen.eaglerShow(I18n.format("resourcePack.load.refreshing"), I18n.format("resourcePack.load.pleaseWait")); + Minecraft.this.refreshResources(); + } + } + ); + } + + private String func_181538_aA() { + return this.currentServerData != null ? "multiplayer" : "out_of_game"; + } + + /**+ + * Returns whether snooping is enabled or not. + */ + public boolean isSnooperEnabled() { + return this.gameSettings.snooperEnabled; + } + + /**+ + * Set the current ServerData instance. + */ + public void setServerData(ServerData serverDataIn) { + this.currentServerData = serverDataIn; + } + + public ServerData getCurrentServerData() { + return this.currentServerData; + } + + public boolean isIntegratedServerRunning() { + return this.integratedServerIsRunning; + } + + /**+ + * Returns true if there is only one player playing, and the + * current server is the integrated one. + */ + public boolean isSingleplayer() { + return false; + } + + public static void stopIntegratedServer() {} + + /**+ + * Gets the system time in milliseconds. + */ + public static long getSystemTime() { + return System.currentTimeMillis(); + } + + /**+ + * Returns whether we're in full screen or not. + */ + public boolean isFullScreen() { + return Display.isFullscreen(); + } + + public Session getSession() { + return this.session; + } + + public TextureManager getTextureManager() { + return this.renderEngine; + } + + public IResourceManager getResourceManager() { + return this.mcResourceManager; + } + + public ResourcePackRepository getResourcePackRepository() { + return this.mcResourcePackRepository; + } + + public LanguageManager getLanguageManager() { + return this.mcLanguageManager; + } + + public TextureMap getTextureMapBlocks() { + return this.textureMapBlocks; + } + + public boolean isJava64bit() { + return this.jvm64bit; + } + + public boolean isGamePaused() { + return this.isGamePaused; + } + + public SoundHandler getSoundHandler() { + return this.mcSoundHandler; + } + + public MusicTicker.MusicType getAmbientMusicType() { + return this.thePlayer != null + ? ( + this.thePlayer.worldObj.provider instanceof WorldProviderHell + ? MusicTicker.MusicType.NETHER + : (this.thePlayer.worldObj.provider instanceof WorldProviderEnd ? (BossStatus.bossName != null && BossStatus.statusBarTime > 0 ? MusicTicker.MusicType.END_BOSS : MusicTicker.MusicType.END) : (this.thePlayer.capabilities.isCreativeMode && this.thePlayer.capabilities.allowFlying ? MusicTicker.MusicType.CREATIVE : MusicTicker.MusicType.GAME)) + ) + : MusicTicker.MusicType.MENU; + } + + public void dispatchKeypresses() { + int i = Keyboard.getEventKey() == 0 ? Keyboard.getEventCharacter() : Keyboard.getEventKey(); + if (i != 0 && !Keyboard.isRepeatEvent()) { + if (!(this.currentScreen instanceof GuiControls) || ((GuiControls) this.currentScreen).time <= getSystemTime() - 20L) { + if (Keyboard.getEventKeyState()) { + if (i == this.gameSettings.keyBindScreenshot.getKeyCode()) { + this.ingameGUI.getChatGUI().printChatMessage(ScreenShotHelper.saveScreenshot()); + } + } + } + } + } + + public Entity getRenderViewEntity() { + return this.renderViewEntity; + } + + public void setRenderViewEntity(Entity viewingEntity) { + this.renderViewEntity = viewingEntity; + this.entityRenderer.loadEntityShader(viewingEntity); + } + + public ListenableFuture addScheduledTask(Callable callableToSchedule) { + Validate.notNull(callableToSchedule); + ListenableFutureTask listenablefuturetask = ListenableFutureTask.create(callableToSchedule); + synchronized (this.scheduledTasks) { + this.scheduledTasks.add(listenablefuturetask); + return listenablefuturetask; + } + } + + public ListenableFuture addScheduledTask(Runnable runnableToSchedule) { + Validate.notNull(runnableToSchedule); + return this.addScheduledTask(Executors.callable(runnableToSchedule)); + } + + public BlockRendererDispatcher getBlockRendererDispatcher() { + return this.blockRenderDispatcher; + } + + public RenderManager getRenderManager() { + return this.renderManager; + } + + public RenderItem getRenderItem() { + return this.renderItem; + } + + public ItemRenderer getItemRenderer() { + return this.itemRenderer; + } + + public static int getDebugFPS() { + return debugFPS; + } + + public FrameTimer func_181539_aj() { + return this.field_181542_y; + } + + public boolean func_181540_al() { + return this.field_181541_X; + } + + public void func_181537_a(boolean parFlag) { + this.field_181541_X = parFlag; + } + + /**+ + * Used in the usage snooper. + */ + public static int getGLMaximumTextureSize() { + return EaglercraftGPU.glGetInteger(GL_MAX_TEXTURE_SIZE); + } + + public boolean areKeysLocked() { + return PlatformInput.lockKeys; + } +} diff --git a/src/main/java/net/minecraft/client/entity/EntityPlayerSP.java b/src/main/java/net/minecraft/client/entity/EntityPlayerSP.java index 4d7ae2e4..9cb670af 100644 --- a/src/main/java/net/minecraft/client/entity/EntityPlayerSP.java +++ b/src/main/java/net/minecraft/client/entity/EntityPlayerSP.java @@ -135,7 +135,7 @@ public class EntityPlayerSP extends AbstractClientPlayer { * Called to update the entity's position/logic. */ public void onUpdate() { - if(ModManager.sprint.isEnabled()){ + if (ModManager.sprint.isEnabled()) { Sprint.onUpdate(); } if (this.worldObj.isBlockLoaded(new BlockPos(this.posX, 0.0D, this.posZ))) { @@ -532,13 +532,13 @@ public class EntityPlayerSP extends AbstractClientPlayer { * Args: entity that was hit critically */ public void onCriticalHit(Entity entityHit) { - for(int i = 0; i < ParticleMultiplier.multiplier.getValue(); i++){ + for (int i = 0; i < ParticleMultiplier.multiplier.getValue(); i++) { this.mc.effectRenderer.emitParticleAtEntity(entityHit, EnumParticleTypes.CRIT); } } public void onEnchantmentCritical(Entity entityHit) { - for(int i = 0; i < ParticleMultiplier.multiplier.getValue(); i++){ + for (int i = 0; i < ParticleMultiplier.multiplier.getValue(); i++) { this.mc.effectRenderer.emitParticleAtEntity(entityHit, EnumParticleTypes.CRIT_MAGIC); } } diff --git a/src/main/java/net/minecraft/client/gui/GuiButton.java b/src/main/java/net/minecraft/client/gui/GuiButton.java index b791b5dd..c34e6920 100644 --- a/src/main/java/net/minecraft/client/gui/GuiButton.java +++ b/src/main/java/net/minecraft/client/gui/GuiButton.java @@ -78,31 +78,28 @@ public class GuiButton extends Gui { * Draws this button to the screen. */ public void drawButton(Minecraft mc, int mouseX, int mouseY) { - if (this.visible) { - FontRenderer fontrenderer = mc.fontRendererObj; - mc.getTextureManager().bindTexture(buttonTextures); - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width - && mouseY < this.yPosition + this.height; - int i = this.getHoverState(this.hovered); - GlStateManager.enableBlend(); - GlStateManager.tryBlendFuncSeparate(RealOpenGLEnums.GL_SRC_ALPHA, RealOpenGLEnums.GL_ONE_MINUS_SRC_ALPHA, 1, 0); - GlStateManager.blendFunc(RealOpenGLEnums.GL_SRC_ALPHA, RealOpenGLEnums.GL_ONE_MINUS_SRC_ALPHA); - this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + i * 20, this.width / 2, this.height); - this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, - 46 + i * 20, this.width / 2, this.height); - this.mouseDragged(mc, mouseX, mouseY); - int j = 14737632; - if (!this.enabled) { - j = 10526880; - } else if (this.hovered) { - j = 14737632; - } - - drawCenteredString(mc.fontRendererObj, this.displayString, this.xPosition + this.width / 2f, this.yPosition + (this.height - 8) / 2f, this.hovered && this.enabled ? new Color(47, 116, 253, 255).getRGB() : new Color(200, 200, 200).getRGB()); - } - } + if (this.visible) { + FontRenderer fontrenderer = mc.fontRendererObj; + mc.getTextureManager().bindTexture(buttonTextures); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + int i = this.getHoverState(this.hovered); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(RealOpenGLEnums.GL_SRC_ALPHA, RealOpenGLEnums.GL_ONE_MINUS_SRC_ALPHA, 1, 0); + GlStateManager.blendFunc(RealOpenGLEnums.GL_SRC_ALPHA, RealOpenGLEnums.GL_ONE_MINUS_SRC_ALPHA); + this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + i * 20, this.width / 2, this.height); + this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + i * 20, this.width / 2, this.height); + this.mouseDragged(mc, mouseX, mouseY); + int j = 14737632; + if (!this.enabled) { + j = 10526880; + } else if (this.hovered) { + j = 14737632; + } + drawCenteredString(mc.fontRendererObj, this.displayString, this.xPosition + this.width / 2f, this.yPosition + (this.height - 8) / 2f, this.hovered && this.enabled ? new Color(47, 116, 253, 255).getRGB() : new Color(200, 200, 200).getRGB()); + } + } /**+ * Fired when the mouse button is dragged. Equivalent of diff --git a/src/main/java/net/minecraft/client/gui/GuiChat.java b/src/main/java/net/minecraft/client/gui/GuiChat.java index f37c080b..37ae4893 100644 --- a/src/main/java/net/minecraft/client/gui/GuiChat.java +++ b/src/main/java/net/minecraft/client/gui/GuiChat.java @@ -1,10 +1,8 @@ package net.minecraft.client.gui; import com.google.common.collect.Lists; - import dev.resent.util.misc.GlUtils; import dev.resent.visual.ui.animation.SimpleAnimation; - import java.io.IOException; import java.util.List; import net.lax1dude.eaglercraft.v1_8.Keyboard; @@ -284,9 +282,8 @@ public class GuiChat extends GuiScreen { GlUtils.startTranslate(0, 29 - (int) animation.getValue()); drawRect(2, this.height - 14, this.width - 2, this.height - 2, Integer.MIN_VALUE); this.inputField.drawTextBox(); - if (this.inputField.isTypingPassword) - this.mc.fontRendererObj.drawStringWithShadow("Password Hidden", 2, this.height - 25, 16770425); - + if (this.inputField.isTypingPassword) this.mc.fontRendererObj.drawStringWithShadow("Password Hidden", 2, this.height - 25, 16770425); + GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); IChatComponent ichatcomponent = this.mc.ingameGUI.getChatGUI().getChatComponent(Mouse.getX(), Mouse.getY()); if (ichatcomponent != null && ichatcomponent.getChatStyle().getChatHoverEvent() != null) { diff --git a/src/main/java/net/minecraft/client/gui/GuiIngame.java b/src/main/java/net/minecraft/client/gui/GuiIngame.java index 1ea3b6ad..e858e362 100644 --- a/src/main/java/net/minecraft/client/gui/GuiIngame.java +++ b/src/main/java/net/minecraft/client/gui/GuiIngame.java @@ -5,19 +5,17 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_ONE_MINUS_ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_ONE_MINUS_SRC_COLOR; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_SRC_ALPHA; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - import com.google.common.base.Predicate; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; - import dev.resent.client.Resent; import dev.resent.module.base.RenderMod; import dev.resent.util.misc.W; import dev.resent.visual.crosshair.CrosshairManager; import dev.resent.visual.ui.animation.SimpleAnimation; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerTextureAtlasSprite; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; @@ -303,11 +301,14 @@ public class GuiIngame extends Gui { this.overlayPlayerList.renderPlayerlist(i, scoreboard, scoreobjective1); } - Resent.INSTANCE.modManager.modules.stream().filter(m -> m.isEnabled() && m instanceof RenderMod).forEach(m -> { - if(!Minecraft.getMinecraft().gameSettings.showDebugInfo && m.getName() != "CPS"){ - ((RenderMod) m).draw(); - } - }); + Resent.INSTANCE.modManager.modules + .stream() + .filter(m -> m.isEnabled() && m instanceof RenderMod) + .forEach(m -> { + if (!Minecraft.getMinecraft().gameSettings.showDebugInfo && m.getName() != "CPS") { + ((RenderMod) m).draw(); + } + }); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.disableLighting(); @@ -318,12 +319,11 @@ public class GuiIngame extends Gui { if (this.showCrosshair()) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - if(CrosshairManager.crosshairLocation == null){ - if(CrosshairManager.read() != null) - CrosshairManager.forceLoad(CrosshairManager.read()); + if (CrosshairManager.crosshairLocation == null) { + if (CrosshairManager.read() != null) CrosshairManager.forceLoad(CrosshairManager.read()); this.mc.getTextureManager().bindTexture(icons); } - + GlStateManager.enableBlend(); GlStateManager.tryBlendFuncSeparate(GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR, 1, 0); GlStateManager.enableAlpha(); @@ -334,34 +334,33 @@ public class GuiIngame extends Gui { public SimpleAnimation simpleAnimation = new SimpleAnimation(0.0F); - protected void renderTooltip(ScaledResolution sr, float partialTicks) { - if (this.mc.getRenderViewEntity() instanceof EntityPlayer) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(widgetsTexPath); - EntityPlayer entityplayer = (EntityPlayer) this.mc.getRenderViewEntity(); - int i = sr.getScaledWidth() / 2; - float f = this.zLevel; - this.zLevel = -90.0F; - this.drawTexturedModalRect(i - 91, sr.getScaledHeight() - 22, 0, 0, 182, 22); - this.drawTexturedModalRect(i - 91 - 1 + entityplayer.inventory.currentItem * 20, - sr.getScaledHeight() - 22 - 1, 0, 22, 24, 22); - this.zLevel = f; - GlStateManager.enableRescaleNormal(); - GlStateManager.enableBlend(); - GlStateManager.tryBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, 1, 0); - RenderHelper.enableGUIStandardItemLighting(); + protected void renderTooltip(ScaledResolution sr, float partialTicks) { + if (this.mc.getRenderViewEntity() instanceof EntityPlayer) { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(widgetsTexPath); + EntityPlayer entityplayer = (EntityPlayer) this.mc.getRenderViewEntity(); + int i = sr.getScaledWidth() / 2; + float f = this.zLevel; + this.zLevel = -90.0F; + this.drawTexturedModalRect(i - 91, sr.getScaledHeight() - 22, 0, 0, 182, 22); + this.drawTexturedModalRect(i - 91 - 1 + entityplayer.inventory.currentItem * 20, sr.getScaledHeight() - 22 - 1, 0, 22, 24, 22); + this.zLevel = f; + GlStateManager.enableRescaleNormal(); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, 1, 0); + RenderHelper.enableGUIStandardItemLighting(); - for (int j = 0; j < 9; ++j) { - int k = sr.getScaledWidth() / 2 - 90 + j * 20 + 2; - int l = sr.getScaledHeight() - 16 - 3; - this.renderHotbarItem(j, k, l, partialTicks, entityplayer); - } + for (int j = 0; j < 9; ++j) { + int k = sr.getScaledWidth() / 2 - 90 + j * 20 + 2; + int l = sr.getScaledHeight() - 16 - 3; + this.renderHotbarItem(j, k, l, partialTicks, entityplayer); + } - RenderHelper.disableStandardItemLighting(); - GlStateManager.disableRescaleNormal(); - GlStateManager.disableBlend(); - } - } + RenderHelper.disableStandardItemLighting(); + GlStateManager.disableRescaleNormal(); + GlStateManager.disableBlend(); + } + } public void renderHorseJumpBar(ScaledResolution parScaledResolution, int parInt1) { this.mc.mcProfiler.startSection("jumpBar"); diff --git a/src/main/java/net/minecraft/client/gui/GuiMainMenu.java b/src/main/java/net/minecraft/client/gui/GuiMainMenu.java index 02c49087..572108a8 100644 --- a/src/main/java/net/minecraft/client/gui/GuiMainMenu.java +++ b/src/main/java/net/minecraft/client/gui/GuiMainMenu.java @@ -21,7 +21,7 @@ public class GuiMainMenu extends GuiScreen { public void drawScreen(final int mouseX, final int mouseY, final float partialTicks) { this.drawDefaultBackground(); this.mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/background.jpg")); - Gui.drawModalRectWithCustomSizedTexture(0, 0, 0.0f, 0.0f, this.width+60, this.height, this.width + 21, this.height + 50); + Gui.drawModalRectWithCustomSizedTexture(0, 0, 0.0f, 0.0f, this.width + 60, this.height, this.width + 21, this.height + 50); final String s1 = "Copyright " + EnumChatFormatting.RED + EnumChatFormatting.BOLD + "M" + EnumChatFormatting.RESET + "ojang AB"; this.drawString(Minecraft.getMinecraft().fontRendererObj, s1, this.width - Minecraft.getMinecraft().fontRendererObj.getStringWidth(s1) - 2, this.height - 10, -1); GlUtils.drawCenteredScaledString("" + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + "Resent", this.width / 2, this.height / 2 - 50, -1, 3f); diff --git a/src/main/java/net/minecraft/client/gui/GuiScreen.java b/src/main/java/net/minecraft/client/gui/GuiScreen.java index 58cbfa02..1422618c 100644 --- a/src/main/java/net/minecraft/client/gui/GuiScreen.java +++ b/src/main/java/net/minecraft/client/gui/GuiScreen.java @@ -558,12 +558,11 @@ public abstract class GuiScreen extends Gui implements GuiYesNoCallback { private void openWebLink(String parURI) { EagRuntime.openLink(parURI); } - + public boolean isMouseInside(double mouseX, double mouseY, double x, double y, double width, double height) { return (mouseX >= x && mouseX <= width) && (mouseY >= y && mouseY <= height); } - /**+ * Returns true if either windows ctrl key is down or if either * mac meta key is down diff --git a/src/main/java/net/minecraft/client/gui/GuiTextField.java b/src/main/java/net/minecraft/client/gui/GuiTextField.java index 83015915..93de6fc2 100644 --- a/src/main/java/net/minecraft/client/gui/GuiTextField.java +++ b/src/main/java/net/minecraft/client/gui/GuiTextField.java @@ -66,7 +66,7 @@ public class GuiTextField extends Gui { private boolean visible = true; private GuiPageButtonList.GuiResponder field_175210_x; private Predicate field_175209_y = Predicates.alwaysTrue(); - + public boolean isTypingPassword = false; public GuiTextField(int componentId, FontRenderer fontrendererObj, int x, int y, int par5Width, int par6Height) { @@ -452,49 +452,40 @@ public class GuiTextField extends Gui { if (k > s.length()) { k = s.length(); } - - if (s.length() > 0) { - - String s1 = flag ? s.substring(0, j) : s; + String s1 = flag ? s.substring(0, j) : s; String s2 = s1; - + if (s1.startsWith("/l ") || s1.startsWith("/login ") || s1.startsWith("/log ")) { - s2 = ""; - String password = ""; - // password isnt sent anywhere, its just used for counting how many "*" you need for hiding the password. - - if (s1.startsWith("/l ")) { - s2 = s1.substring(0, 3); - password = s1.substring(3); - } - - if (s1.startsWith("/login ")) { - s2 = s1.substring(0, 7); - password = s1.substring(7); - } - - if (s1.startsWith("/log ")) { - s2 = s1.substring(0, 5); - password = s1.substring(7); - } - - if (password.length() > 0) { - isTypingPassword = true; - for (int n = 0; n < password.length(); n++) { - s2 += "*"; - } - } - - - + s2 = ""; + String password = ""; + // password isnt sent anywhere, its just used for counting how many "*" you need for hiding the password. + + if (s1.startsWith("/l ")) { + s2 = s1.substring(0, 3); + password = s1.substring(3); + } + + if (s1.startsWith("/login ")) { + s2 = s1.substring(0, 7); + password = s1.substring(7); + } + + if (s1.startsWith("/log ")) { + s2 = s1.substring(0, 5); + password = s1.substring(7); + } + + if (password.length() > 0) { + isTypingPassword = true; + for (int n = 0; n < password.length(); n++) { + s2 += "*"; + } + } + } else { + isTypingPassword = false; } - else { - isTypingPassword = false; - } - - j1 = this.fontRendererInstance.drawStringWithShadow(s2, (float) l, (float) i1, i); } diff --git a/src/main/java/net/minecraft/client/model/ModelRenderer.java b/src/main/java/net/minecraft/client/model/ModelRenderer.java index 0e8cc3ae..643002d1 100644 --- a/src/main/java/net/minecraft/client/model/ModelRenderer.java +++ b/src/main/java/net/minecraft/client/model/ModelRenderer.java @@ -2,11 +2,9 @@ package net.minecraft.client.model; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_COMPILE; -import java.util.List; - import com.google.common.collect.Lists; - import dev.resent.module.base.ModManager; +import java.util.List; import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer; @@ -142,7 +140,6 @@ public class ModelRenderer { private boolean compiledState; public void render(float parFloat1) { - boolean batchRendering = ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.batchRendering.getValue(); if (compiledState != batchRendering) { @@ -273,7 +270,7 @@ public class ModelRenderer { WorldRenderer worldrenderer = Tessellator.getInstance().getWorldRenderer(); boolean batchRendering = ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.batchRendering.getValue(); - + this.compiledState = batchRendering; if (batchRendering) { Tessellator.getInstance().getWorldRenderer().begin(7, DefaultVertexFormats.OLDMODEL_POSITION_TEX_NORMAL); diff --git a/src/main/java/net/minecraft/client/model/TexturedQuad.java b/src/main/java/net/minecraft/client/model/TexturedQuad.java index 4182d386..7863de1b 100644 --- a/src/main/java/net/minecraft/client/model/TexturedQuad.java +++ b/src/main/java/net/minecraft/client/model/TexturedQuad.java @@ -75,7 +75,6 @@ public class TexturedQuad { f2 = -f2; } - boolean batchRendering = ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.batchRendering.getValue(); this.drawOnSelf = !renderer.isDrawing; if (this.drawOnSelf || !batchRendering) { diff --git a/src/main/java/net/minecraft/client/multiplayer/PlayerControllerMP.java b/src/main/java/net/minecraft/client/multiplayer/PlayerControllerMP.java index 8dd1b6c2..3486a7ec 100644 --- a/src/main/java/net/minecraft/client/multiplayer/PlayerControllerMP.java +++ b/src/main/java/net/minecraft/client/multiplayer/PlayerControllerMP.java @@ -282,24 +282,21 @@ public class PlayerControllerMP { } public void updateController() { - this.syncCurrentPlayItem(); - if (this.netClientHandler.getNetworkManager().isChannelOpen()) { - try { - this.netClientHandler.getNetworkManager().processReceivedPackets(); - } catch (IOException ex) { - EaglercraftNetworkManager.logger - .fatal("Unhandled IOException was thrown " + "while processing multiplayer packets!"); - EaglercraftNetworkManager.logger.fatal(ex); - EaglercraftNetworkManager.logger.fatal("Disconnecting..."); - this.netClientHandler.getNetworkManager() - .closeChannel(new ChatComponentText("Exception thrown: " + ex.toString())); - } - this.netClientHandler.getSkinCache().flush(); - } else { - this.netClientHandler.getNetworkManager().checkDisconnected(); - } - - } + this.syncCurrentPlayItem(); + if (this.netClientHandler.getNetworkManager().isChannelOpen()) { + try { + this.netClientHandler.getNetworkManager().processReceivedPackets(); + } catch (IOException ex) { + EaglercraftNetworkManager.logger.fatal("Unhandled IOException was thrown " + "while processing multiplayer packets!"); + EaglercraftNetworkManager.logger.fatal(ex); + EaglercraftNetworkManager.logger.fatal("Disconnecting..."); + this.netClientHandler.getNetworkManager().closeChannel(new ChatComponentText("Exception thrown: " + ex.toString())); + } + this.netClientHandler.getSkinCache().flush(); + } else { + this.netClientHandler.getNetworkManager().checkDisconnected(); + } + } private boolean isHittingPosition(BlockPos pos) { ItemStack itemstack = this.mc.thePlayer.getHeldItem(); diff --git a/src/main/java/net/minecraft/client/multiplayer/WorldClient.java b/src/main/java/net/minecraft/client/multiplayer/WorldClient.java index 7ca28321..8159a297 100644 --- a/src/main/java/net/minecraft/client/multiplayer/WorldClient.java +++ b/src/main/java/net/minecraft/client/multiplayer/WorldClient.java @@ -1,9 +1,7 @@ package net.minecraft.client.multiplayer; import com.google.common.collect.Sets; - import dev.resent.module.base.ModManager; - import java.util.Set; import java.util.concurrent.Callable; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; diff --git a/src/main/java/net/minecraft/client/particle/EffectRenderer.java b/src/main/java/net/minecraft/client/particle/EffectRenderer.java index 28f07e2e..b156053d 100644 --- a/src/main/java/net/minecraft/client/particle/EffectRenderer.java +++ b/src/main/java/net/minecraft/client/particle/EffectRenderer.java @@ -4,9 +4,7 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; import com.google.common.collect.Lists; import com.google.common.collect.Maps; - import dev.resent.module.base.ModManager; - import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -359,8 +357,7 @@ public class EffectRenderer { } public void addBlockDestroyEffects(BlockPos pos, IBlockState state) { - if(ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.blockEffects.getValue()) - return; + if (ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.blockEffects.getValue()) return; if (state.getBlock().getMaterial() != Material.air) { state = state.getBlock().getActualState(state, this.worldObj, pos); @@ -383,8 +380,7 @@ public class EffectRenderer { * Adds block hit particles for the specified block */ public void addBlockHitEffects(BlockPos pos, EnumFacing side) { - if(ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.blockEffects.getValue()) - return; + if (ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.blockEffects.getValue()) return; IBlockState iblockstate = this.worldObj.getBlockState(pos); Block block = iblockstate.getBlock(); diff --git a/src/main/java/net/minecraft/client/renderer/EntityRenderer.java b/src/main/java/net/minecraft/client/renderer/EntityRenderer.java index fa3b4da9..4db3e08f 100644 --- a/src/main/java/net/minecraft/client/renderer/EntityRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/EntityRenderer.java @@ -24,7 +24,6 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_TEXTURE_WR import com.google.common.base.Predicate; import com.google.common.base.Predicates; - import dev.resent.client.Resent; import dev.resent.module.base.ModManager; import dev.resent.module.base.RenderMod; @@ -660,13 +659,11 @@ public class EntityRenderer implements IResourceManagerReloadListener { } public void enableLightmap() { - if(ModManager.fpsOptions.lightUpdates.getValue() || ModManager.fullbright.isEnabled()) - return; - - GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit); - GlStateManager.enableTexture2D(); - GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit); - + if (ModManager.fpsOptions.lightUpdates.getValue() || ModManager.fullbright.isEnabled()) return; + + GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit); + GlStateManager.enableTexture2D(); + GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit); } /**+ @@ -886,7 +883,7 @@ public class EntityRenderer implements IResourceManagerReloadListener { GlStateManager.enableOverlayFramebufferBlending(); this.mc.ingameGUI.renderGameOverlay(parFloat1); } - if(ModManager.cps.isEnabled()){ + if (ModManager.cps.isEnabled()) { ModManager.cps.draw(); } if (framebufferAge == -1l || framebufferAge > (Minecraft.getDebugFPS() < 25 ? 125l : 75l)) { @@ -1204,7 +1201,7 @@ public class EntityRenderer implements IResourceManagerReloadListener { this.mc.mcProfiler.endStartSection("hand"); - if(ModManager.adminSpawner.isEnabled()){ + if (ModManager.adminSpawner.isEnabled()) { ModManager.adminSpawner.render(); } if (this.renderHand) { diff --git a/src/main/java/net/minecraft/client/renderer/ItemRenderer.java b/src/main/java/net/minecraft/client/renderer/ItemRenderer.java index 966b6676..45698ea7 100644 --- a/src/main/java/net/minecraft/client/renderer/ItemRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/ItemRenderer.java @@ -311,7 +311,7 @@ public class ItemRenderer { this.func_178110_a((EntityPlayerSP) entityplayersp, partialTicks); GlStateManager.enableRescaleNormal(); GlStateManager.pushMatrix(); - if(ModManager.hand.isEnabled()){ + if (ModManager.hand.isEnabled()) { GlStateManager.scale(-1.0D, 1.0D, 1.0D); GlStateManager.disableCull(); } diff --git a/src/main/java/net/minecraft/client/renderer/entity/RendererLivingEntity.java b/src/main/java/net/minecraft/client/renderer/entity/RendererLivingEntity.java index 75703b7d..7c76dadc 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RendererLivingEntity.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RendererLivingEntity.java @@ -4,11 +4,9 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_GREATER; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_ONE_MINUS_SRC_ALPHA; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_SRC_ALPHA; -import java.util.List; - import com.google.common.collect.Lists; - import dev.resent.module.base.ModManager; +import java.util.List; import net.lax1dude.eaglercraft.v1_8.internal.buffer.FloatBuffer; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.Logger; @@ -404,8 +402,7 @@ public abstract class RendererLivingEntity extends R } } - if(Minecraft.isGuiEnabled() && !entitylivingbase.isInvisibleToPlayer(Minecraft.getMinecraft().thePlayer) || ModManager.selfNametag.isEnabled()) - return true; + if (Minecraft.isGuiEnabled() && !entitylivingbase.isInvisibleToPlayer(Minecraft.getMinecraft().thePlayer) || ModManager.selfNametag.isEnabled()) return true; return Minecraft.isGuiEnabled() && entitylivingbase != this.renderManager.livingPlayer && !entitylivingbase.isInvisibleToPlayer(Minecraft.getMinecraft().thePlayer) && entitylivingbase.riddenByEntity == null; } diff --git a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerCape.java b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerCape.java index e22f80c6..910d1fab 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/layers/LayerCape.java +++ b/src/main/java/net/minecraft/client/renderer/entity/layers/LayerCape.java @@ -38,11 +38,10 @@ public class LayerCape implements LayerRenderer { public void doRenderLayer(AbstractClientPlayer abstractclientplayer, float var2, float var3, float f, float var5, float var6, float var7, float var8) { if (abstractclientplayer.hasPlayerInfo() && !abstractclientplayer.isInvisible() && this.playerRenderer.getMainModel() instanceof ModelPlayer && ModManager.cape.isEnabled() && CapeManager.shouldRender(abstractclientplayer)) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - if(CapeManager.capeLocation == null){ - if(CapeManager.read() != null) - CapeManager.forceLoad(CapeManager.read()); + if (CapeManager.capeLocation == null) { + if (CapeManager.read() != null) CapeManager.forceLoad(CapeManager.read()); this.playerRenderer.bindTexture(new ResourceLocation("eagler:gui/unnamed.png")); - }else { + } else { this.playerRenderer.bindTexture(CapeManager.capeLocation); } GlStateManager.pushMatrix(); diff --git a/src/main/java/net/minecraft/client/settings/GameSettings.java b/src/main/java/net/minecraft/client/settings/GameSettings.java index bfee9a32..dfd51c97 100644 --- a/src/main/java/net/minecraft/client/settings/GameSettings.java +++ b/src/main/java/net/minecraft/client/settings/GameSettings.java @@ -4,7 +4,6 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; - import dev.resent.client.Resent; import dev.resent.module.base.ModManager; import java.io.BufferedReader; @@ -225,7 +224,7 @@ public class GameSettings { }, this.keyBindsHotbar ); - + this.difficulty = EnumDifficulty.NORMAL; this.lastServer = ""; this.fovSetting = 70.0F; diff --git a/src/main/java/net/minecraft/entity/Entity.java b/src/main/java/net/minecraft/entity/Entity.java index 16ad25d6..23d20cbe 100644 --- a/src/main/java/net/minecraft/entity/Entity.java +++ b/src/main/java/net/minecraft/entity/Entity.java @@ -802,8 +802,7 @@ public abstract class Entity { * sprinting and not in water. */ public void spawnRunningParticles() { - if(!this.onGround) - return; + if (!this.onGround) return; if (this.isSprinting() && !this.isInWater()) { this.createRunningParticles(); } diff --git a/src/main/java/net/minecraft/entity/player/EntityPlayer.java b/src/main/java/net/minecraft/entity/player/EntityPlayer.java index aeda04c2..c5132d9a 100644 --- a/src/main/java/net/minecraft/entity/player/EntityPlayer.java +++ b/src/main/java/net/minecraft/entity/player/EntityPlayer.java @@ -2,11 +2,9 @@ package net.minecraft.entity.player; import com.google.common.base.Charsets; import com.google.common.collect.Lists; - import dev.resent.client.Resent; import dev.resent.module.base.ModManager; import dev.resent.module.impl.misc.ParticleMultiplier; - import java.util.Collection; import java.util.List; import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; diff --git a/src/main/java/net/minecraft/util/MathHelper.java b/src/main/java/net/minecraft/util/MathHelper.java index b29b069b..2b2ed51b 100644 --- a/src/main/java/net/minecraft/util/MathHelper.java +++ b/src/main/java/net/minecraft/util/MathHelper.java @@ -485,7 +485,6 @@ public class MathHelper { } static { - for (int j = 0; j < 4096; ++j) { SIN_TABLE_FAST[j] = (float) Math.sin(((float) j + 0.5f) / 4096.0f * ((float) Math.PI * 2f)); } diff --git a/src/main/java/net/minecraft/util/Timer.java b/src/main/java/net/minecraft/util/Timer.java index d66309ec..05f70a40 100644 --- a/src/main/java/net/minecraft/util/Timer.java +++ b/src/main/java/net/minecraft/util/Timer.java @@ -85,6 +85,6 @@ public class Timer { this.elapsedTicks = 10; } - this.renderPartialTicks = ((int)(this.elapsedPartialTicks*64.0f) / 64.0f); + this.renderPartialTicks = ((int) (this.elapsedPartialTicks * 64.0f) / 64.0f); } } diff --git a/src/main/java/net/minecraft/world/World.java b/src/main/java/net/minecraft/world/World.java index a59b1c37..1f0901b7 100644 --- a/src/main/java/net/minecraft/world/World.java +++ b/src/main/java/net/minecraft/world/World.java @@ -3,7 +3,6 @@ package net.minecraft.world; import com.google.common.base.Predicate; import com.google.common.collect.Lists; import com.google.common.collect.Sets; - import dev.resent.module.base.ModManager; import dev.resent.util.misc.W; import java.util.ArrayList; @@ -2108,9 +2107,9 @@ public abstract class World implements IBlockAccess { } public boolean checkLightFor(EnumSkyBlock lightType, BlockPos pos) { - if(ModManager.fpsOptions.lightUpdates.getValue()){ + if (ModManager.fpsOptions.lightUpdates.getValue()) { return true; - }else if (!this.isAreaLoaded(pos, 17, false)) { + } else if (!this.isAreaLoaded(pos, 17, false)) { return false; } else { int i = 0; diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformInput.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformInput.java index 4903eba3..243f7981 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformInput.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformInput.java @@ -95,7 +95,7 @@ public class PlatformInput { public static boolean keyboardLockSupported = false; public static boolean lockKeys = false; - + @JSBody(params = {}, script = "") private static native void onBeforeCloseRegister(); @@ -617,7 +617,7 @@ public class PlatformInput { } @JSBody(params = {}, script = "return returnHasSiteInteractionHappened()") - private static native boolean checkIfSiteInteractionHappened(); + private static native boolean checkIfSiteInteractionHappened(); @JSBody(params = {}, script = "return window.matchMedia('(display-mode: fullscreen)');") private static native JSObject fullscreenMediaQuery(); diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java index 4baf64d6..5cda61c7 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java @@ -1,12 +1,34 @@ package net.lax1dude.eaglercraft.v1_8.internal; +import com.jcraft.jzlib.DeflaterOutputStream; +import com.jcraft.jzlib.GZIPInputStream; +import com.jcraft.jzlib.GZIPOutputStream; +import com.jcraft.jzlib.InflaterInputStream; +import dev.resent.client.ClientInfo; +import dev.resent.client.Resent; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.text.SimpleDateFormat; import java.util.Date; import java.util.function.Consumer; - +import net.lax1dude.eaglercraft.v1_8.EagUtils; +import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion; +import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer; +import net.lax1dude.eaglercraft.v1_8.internal.buffer.EaglerArrayBufferAllocator; +import net.lax1dude.eaglercraft.v1_8.internal.buffer.FloatBuffer; +import net.lax1dude.eaglercraft.v1_8.internal.buffer.IntBuffer; +import net.lax1dude.eaglercraft.v1_8.internal.teavm.EPKLoader; +import net.lax1dude.eaglercraft.v1_8.internal.teavm.EarlyLoadScreen; +import net.lax1dude.eaglercraft.v1_8.internal.teavm.MainClass; +import net.lax1dude.eaglercraft.v1_8.internal.teavm.MainClass.EPKFileEntry; +import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMClientConfigAdapter; +import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMUtils; +import net.lax1dude.eaglercraft.v1_8.internal.teavm.WebGL2RenderingContext; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; +import net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums; +import net.lax1dude.eaglercraft.v1_8.profile.EaglerProfile; import org.teavm.interop.Async; import org.teavm.interop.AsyncCallback; import org.teavm.jso.JSBody; @@ -28,31 +50,6 @@ import org.teavm.jso.typedarrays.ArrayBuffer; import org.teavm.jso.webaudio.MediaStream; import org.teavm.jso.webgl.WebGLFramebuffer; -import com.jcraft.jzlib.DeflaterOutputStream; -import com.jcraft.jzlib.GZIPInputStream; -import com.jcraft.jzlib.GZIPOutputStream; -import com.jcraft.jzlib.InflaterInputStream; - -import dev.resent.client.ClientInfo; -import dev.resent.client.Resent; -import net.lax1dude.eaglercraft.v1_8.EagUtils; -import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion; -import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer; -import net.lax1dude.eaglercraft.v1_8.internal.buffer.EaglerArrayBufferAllocator; -import net.lax1dude.eaglercraft.v1_8.internal.buffer.FloatBuffer; -import net.lax1dude.eaglercraft.v1_8.internal.buffer.IntBuffer; -import net.lax1dude.eaglercraft.v1_8.internal.teavm.EPKLoader; -import net.lax1dude.eaglercraft.v1_8.internal.teavm.EarlyLoadScreen; -import net.lax1dude.eaglercraft.v1_8.internal.teavm.MainClass; -import net.lax1dude.eaglercraft.v1_8.internal.teavm.MainClass.EPKFileEntry; -import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMClientConfigAdapter; -import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMUtils; -import net.lax1dude.eaglercraft.v1_8.internal.teavm.WebGL2RenderingContext; -import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; -import net.lax1dude.eaglercraft.v1_8.log4j.Logger; -import net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums; -import net.lax1dude.eaglercraft.v1_8.profile.EaglerProfile; - /** * Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved. * @@ -158,7 +155,6 @@ public class PlatformRuntime { EagUtils.sleep(50l); logger.info("Decompressing: {}", logURL); - try { EPKLoader.loadEPK(epkFileData, epkFiles[i].path, PlatformAssets.assets); @@ -173,7 +169,6 @@ public class PlatformRuntime { logger.info("Initializing sound engine..."); - enableScreen(); PlatformInput.pressAnyKeyScreen(); @@ -197,13 +192,13 @@ public class PlatformRuntime { @JSBody(params = { "version" }, script = "setVersion(version)") public static native void setClientVersion(String version); - @JSBody( script = "die()") + @JSBody(script = "die()") public static native void remove(); - @JSBody( script = "enable()") + @JSBody(script = "enable()") public static native void enableScreen(); - @JSBody( script = "loading()") + @JSBody(script = "loading()") public static native void loadingScreen(); @JSBody(params = {}, script = "return {antialias: false, depth: false, powerPreference: \"high-performance\", desynchronized: true, preserveDrawingBuffer: false, premultipliedAlpha: false, alpha: false};") @@ -304,32 +299,39 @@ public class PlatformRuntime { request.setResponseType("arraybuffer"); request.open("GET", assetPackageURI, true); - TeaVMUtils.addEventListener(request, "load", new EventListener() { - @Override - public void handleEvent(Event evt) { - int stat = request.getStatus(); - if(stat == 0 || (stat >= 200 && stat < 400)) { - cb.complete((ArrayBuffer)request.getResponse()); - }else { - cb.complete(null); + TeaVMUtils.addEventListener( + request, + "load", + new EventListener() { + @Override + public void handleEvent(Event evt) { + int stat = request.getStatus(); + if (stat == 0 || (stat >= 200 && stat < 400)) { + cb.complete((ArrayBuffer) request.getResponse()); + } else { + cb.complete(null); + } } } - }); + ); - TeaVMUtils.addEventListener(request, "progress", new EventListener() { - @Override - public void handleEvent(Event evt) { - try{ - int epkSize = Integer.parseInt(request.getResponseHeader("content-length")); - Event event = evt; - - - setBarProgress(event, epkSize); - }catch (Exception e){ - e.printStackTrace(); + TeaVMUtils.addEventListener( + request, + "progress", + new EventListener() { + @Override + public void handleEvent(Event evt) { + try { + int epkSize = Integer.parseInt(request.getResponseHeader("content-length")); + Event event = evt; + + setBarProgress(event, epkSize); + } catch (Exception e) { + e.printStackTrace(); + } } } - }); + ); TeaVMUtils.addEventListener( request, @@ -611,8 +613,10 @@ public class PlatformRuntime { mediaRec = null; } } + @JSBody(params = {}, script = "showMojang();") public static native void showMojangScreen(); + @JSBody(params = {}, script = "die2();") public static native void removeLoadScreen(); } diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/MainClass.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/MainClass.java index 907b05cb..745f2fb2 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/MainClass.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/MainClass.java @@ -1,5 +1,6 @@ package net.lax1dude.eaglercraft.v1_8.internal.teavm; +import dev.resent.client.ClientInfo; import java.io.PrintStream; import net.lax1dude.eaglercraft.v1_8.EagRuntime; import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion; @@ -19,8 +20,6 @@ import org.teavm.jso.dom.html.HTMLDocument; import org.teavm.jso.dom.html.HTMLElement; import org.teavm.jso.webgl.WebGLRenderingContext; -import dev.resent.client.ClientInfo; - /** * Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved. *