Reformat & optimize

This commit is contained in:
ThisIsALegitUsername 2023-04-07 20:39:09 +00:00
parent b640363f36
commit 909092720c
80 changed files with 2804 additions and 2957 deletions

View File

@ -10,7 +10,10 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
public @interface Module { public @interface Module {
String name() default "No name set"; String name() default "No name set";
String description() default "No description set."; String description() default "No description set.";
Category category() default Category.MISC; Category category() default Category.MISC;
boolean hasSetting() default false; boolean hasSetting() default false;
} }

View File

@ -10,7 +10,9 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
public @interface RenderModule { public @interface RenderModule {
String name(); String name();
String description() default "No description set."; String description() default "No description set.";
Category category(); Category category();
int x(); int x();

View File

@ -17,9 +17,9 @@ public class ClientInfo {
STABLE("Stable"); STABLE("Stable");
String name; String name;
Release(String name) { Release(String name) {
this.name = name; this.name = name;
} }
} }
} }

View File

@ -4,7 +4,6 @@ import dev.resent.module.base.ModManager;
import dev.resent.sound.SoundManager; import dev.resent.sound.SoundManager;
public class Resent { public class Resent {
static { static {
INSTANCE = new Resent(); INSTANCE = new Resent();
} }
@ -18,5 +17,4 @@ public class Resent {
Resent.INSTANCE.modManager = new ModManager(); Resent.INSTANCE.modManager = new ModManager();
Resent.INSTANCE.soundManager = new SoundManager(); Resent.INSTANCE.soundManager = new SoundManager();
} }
} }

View File

@ -1,11 +1,10 @@
package dev.resent.client; package dev.resent.client;
import java.io.PrintWriter;
import dev.resent.module.base.RenderMod; import dev.resent.module.base.RenderMod;
import dev.resent.module.base.setting.BooleanSetting; import dev.resent.module.base.setting.BooleanSetting;
import dev.resent.module.base.setting.ModeSetting; import dev.resent.module.base.setting.ModeSetting;
import dev.resent.module.base.setting.NumberSetting; import dev.resent.module.base.setting.NumberSetting;
import java.io.PrintWriter;
public class SaveUtil { public class SaveUtil {
@ -81,5 +80,4 @@ public class SaveUtil {
}); });
}); });
} }
} }

View File

@ -1,14 +1,13 @@
package dev.resent.module.base; 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.annotation.Module;
import dev.resent.module.base.setting.Setting; import dev.resent.module.base.setting.Setting;
import dev.resent.util.render.RenderUtils; import dev.resent.util.render.RenderUtils;
import dev.resent.visual.ui.Theme; import dev.resent.visual.ui.Theme;
import dev.resent.visual.ui.animation.SimpleAnimation; import dev.resent.visual.ui.animation.SimpleAnimation;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
public abstract class Mod { public abstract class Mod {
@ -39,6 +38,7 @@ public abstract class Mod {
} }
public void onEnable() {} public void onEnable() {}
public void onDisable() {} public void onDisable() {}
public void toggle() { public void toggle() {
@ -80,16 +80,43 @@ public abstract class Mod {
} }
} }
public boolean isEnabled() { return enabled; } public boolean isEnabled() {
public boolean isAdmin() { return admin; } return enabled;
public boolean doesHaveSetting() { return hasSetting; } }
public String getName() { return name; }
public String getDescription() { return description; } public boolean isAdmin() {
public Category getCategory() { return category; } return admin;
}
public void setDescription(String description) { this.description = description; }
public void setName(String name) { this.name = name; } public boolean doesHaveSetting() {
public void setCategory(Category category) { this.category = category; } return hasSetting;
public void setHasSetting(boolean hasSetting) { this.hasSetting = 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;
}
} }

View File

@ -1,9 +1,5 @@
package dev.resent.module.base; 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.base.Mod.Category;
import dev.resent.module.impl.hud.ArmorHud; import dev.resent.module.impl.hud.ArmorHud;
import dev.resent.module.impl.hud.BPS; 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.NoRain;
import dev.resent.module.impl.setting.NoSwingDelay; import dev.resent.module.impl.setting.NoSwingDelay;
import dev.resent.module.impl.setting.SelfNametag; import dev.resent.module.impl.setting.SelfNametag;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
public class ModManager { public class ModManager {
@ -82,10 +81,10 @@ public class ModManager {
public static AdminSpawner adminSpawner = new AdminSpawner(); public static AdminSpawner adminSpawner = new AdminSpawner();
public static ParticleMultiplier particleMultiplier = new ParticleMultiplier(); public static ParticleMultiplier particleMultiplier = new ParticleMultiplier();
public static Hand hand; public static Hand hand;
//public static Crosshair crosshair = new Crosshair(); //public static Crosshair crosshair = new Crosshair();
public ModManager() { public ModManager() {
//Hud //Hud
//register(crosshair = new Crosshair()); //register(crosshair = new Crosshair());
register(hand = new Hand()); register(hand = new Hand());

View File

@ -1,6 +1,7 @@
package dev.resent.module.base.setting; package dev.resent.module.base.setting;
public class CustomRectSettingDraw extends Setting { public class CustomRectSettingDraw extends Setting {
public CustomRectSettingDraw(String name, String description) { public CustomRectSettingDraw(String name, String description) {
super(name, description); super(name, description);
} }

View File

@ -19,8 +19,7 @@ public final class ModeSetting extends Setting {
} }
public void setValue(final String mode) { public void setValue(final String mode) {
if (modes.contains(mode)) if (modes.contains(mode)) index = this.modes.indexOf(mode);
index = this.modes.indexOf(mode);
} }
public boolean is(String mode) { public boolean is(String mode) {
@ -44,4 +43,3 @@ public final class ModeSetting extends Setting {
} }
} }
} }

View File

@ -2,8 +2,8 @@ package dev.resent.module.impl.hud;
import dev.resent.annotation.RenderModule; import dev.resent.annotation.RenderModule;
import dev.resent.module.base.Mod.Category; 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.RenderMod;
import dev.resent.module.base.setting.BooleanSetting;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.minecraft.client.gui.GuiIngame; import net.minecraft.client.gui.GuiIngame;
import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.gui.ScaledResolution;

View File

@ -1,16 +1,20 @@
package dev.resent.module.impl.hud; package dev.resent.module.impl.hud;
import java.text.DecimalFormat;
import dev.resent.annotation.RenderModule; import dev.resent.annotation.RenderModule;
import dev.resent.module.base.Mod.Category; import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.RenderMod; 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") @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 getWidth() {
public int getHeight(){ return 13; } return mc.fontRendererObj.getStringWidth(getText()) + 4;
}
public int getHeight() {
return 13;
}
public double getBPS() { public double getBPS() {
return mc.thePlayer.getDistance(mc.thePlayer.lastTickPosX, mc.thePlayer.lastTickPosY, mc.thePlayer.lastTickPosZ) * (mc.timer.ticksPerSecond * mc.timer.timerSpeed); return mc.thePlayer.getDistance(mc.thePlayer.lastTickPosX, mc.thePlayer.lastTickPosY, mc.thePlayer.lastTickPosZ) * (mc.timer.ticksPerSecond * mc.timer.timerSpeed);
@ -23,5 +27,4 @@ public class BPS extends RenderMod{
public void draw() { public void draw() {
drawString(getText(), x + 2, y + 2); drawString(getText(), x + 2, y + 2);
} }
} }

View File

@ -1,12 +1,11 @@
package dev.resent.module.impl.hud; package dev.resent.module.impl.hud;
import java.util.ArrayList;
import java.util.List;
import dev.resent.annotation.RenderModule; import dev.resent.annotation.RenderModule;
import dev.resent.module.base.Mod.Category; import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.RenderMod; import dev.resent.module.base.RenderMod;
import dev.resent.util.misc.FuncUtils; import dev.resent.util.misc.FuncUtils;
import java.util.ArrayList;
import java.util.List;
import net.lax1dude.eaglercraft.v1_8.Mouse; import net.lax1dude.eaglercraft.v1_8.Mouse;
@RenderModule(name = "CPS", category = Category.HUD, x = 4, y = 26, description = "See your clicks per second") @RenderModule(name = "CPS", category = Category.HUD, x = 4, y = 26, description = "See your clicks per second")

View File

@ -17,5 +17,4 @@ public class ClickGui extends Mod{
public ClickGui() { public ClickGui() {
addSetting(scroll, guiTheme); addSetting(scroll, guiTheme);
} }
} }

View File

@ -2,8 +2,8 @@ package dev.resent.module.impl.hud;
import dev.resent.annotation.RenderModule; import dev.resent.annotation.RenderModule;
import dev.resent.module.base.Mod.Category; 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.RenderMod;
import dev.resent.module.base.setting.BooleanSetting;
import dev.resent.util.render.Color; import dev.resent.util.render.Color;
import dev.resent.visual.ui.Theme; import dev.resent.visual.ui.Theme;
import net.minecraft.util.BlockPos; import net.minecraft.util.BlockPos;
@ -20,11 +20,7 @@ public class Info extends RenderMod {
public static final String[] directionsF = new String[] { "\u00A79S\u00A7r", "\u00A72W\u00A7r", "\u00A74N\u00A7r", "\u00A76E\u00A7r" }; public static final String[] directionsF = new String[] { "\u00A79S\u00A7r", "\u00A72W\u00A7r", "\u00A74N\u00A7r", "\u00A76E\u00A7r" };
public int[] getPositions() { public int[] getPositions() {
int[] poses = new int[]{ int[] poses = new int[] { (int) mc.thePlayer.posX, (int) mc.thePlayer.posY, (int) mc.thePlayer.posZ };
(int)mc.thePlayer.posX,
(int)mc.thePlayer.posY,
(int)mc.thePlayer.posZ,
};
return poses; return poses;
} }

View File

@ -7,10 +7,10 @@ import dev.resent.module.base.setting.NumberSetting;
@Module(name = "ItemPhysics", category = Category.MISC, hasSetting = true, description = "Give items physics!") @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 static NumberSetting speed = new NumberSetting("Speed", "", 2, 1, 8, 1, 1);
public ItemPhysics() { public ItemPhysics() {
addSetting(speed); addSetting(speed);
} }
} }

View File

@ -1,8 +1,5 @@
package dev.resent.module.impl.hud; package dev.resent.module.impl.hud;
import java.util.ArrayList;
import java.util.List;
import dev.resent.annotation.RenderModule; import dev.resent.annotation.RenderModule;
import dev.resent.module.base.Mod.Category; import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.RenderMod; 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.misc.FuncUtils;
import dev.resent.util.render.Color; import dev.resent.util.render.Color;
import dev.resent.util.render.RenderUtils; import dev.resent.util.render.RenderUtils;
import java.util.ArrayList;
import java.util.List;
import net.lax1dude.eaglercraft.v1_8.Mouse; import net.lax1dude.eaglercraft.v1_8.Mouse;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;

View File

@ -3,7 +3,6 @@ package dev.resent.module.impl.hud;
import dev.resent.annotation.RenderModule; import dev.resent.annotation.RenderModule;
import dev.resent.module.base.Mod.Category; import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.RenderMod; import dev.resent.module.base.RenderMod;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.util.Vec3; import net.minecraft.util.Vec3;

View File

@ -1,11 +1,10 @@
package dev.resent.module.impl.misc; package dev.resent.module.impl.misc;
import java.util.ArrayList;
import dev.resent.annotation.Module; import dev.resent.annotation.Module;
import dev.resent.module.base.Mod; import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category; import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.setting.BooleanSetting; import dev.resent.module.base.setting.BooleanSetting;
import java.util.ArrayList;
import net.lax1dude.eaglercraft.v1_8.ArrayUtils; import net.lax1dude.eaglercraft.v1_8.ArrayUtils;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
@ -40,20 +39,15 @@ public class AdminRay extends Mod{
public static void start() { public static void start() {
rayBlocks.clear(); rayBlocks.clear();
if(iron.getValue()) if (iron.getValue()) rayBlocks.add(Block.getBlockFromName("iron_ore"));
rayBlocks.add(Block.getBlockFromName("iron_ore")); if (gold.getValue()) rayBlocks.add(Block.getBlockFromName("gold_ore"));
if(gold.getValue())
rayBlocks.add(Block.getBlockFromName("gold_ore"));
if (redstone.getValue()) { if (redstone.getValue()) {
rayBlocks.add(Block.getBlockFromName("redstone_ore")); rayBlocks.add(Block.getBlockFromName("redstone_ore"));
rayBlocks.add(Block.getBlockById(74)); rayBlocks.add(Block.getBlockById(74));
} }
if(lapis.getValue()) if (lapis.getValue()) rayBlocks.add(Block.getBlockFromName("lapis_ore"));
rayBlocks.add(Block.getBlockFromName("lapis_ore")); if (diamond.getValue()) rayBlocks.add(Block.getBlockFromName("diamond_ore"));
if(diamond.getValue()) if (quartz.getValue()) rayBlocks.add(Block.getBlockFromName("quartz_ore"));
rayBlocks.add(Block.getBlockFromName("diamond_ore"));
if(quartz.getValue())
rayBlocks.add(Block.getBlockFromName("quartz_ore"));
if (water.getValue()) { if (water.getValue()) {
rayBlocks.add(Block.getBlockById(8)); rayBlocks.add(Block.getBlockById(8));
rayBlocks.add(Block.getBlockById(9)); rayBlocks.add(Block.getBlockById(9));

View File

@ -11,7 +11,6 @@ import net.minecraft.tileentity.TileEntityMobSpawner;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
@Module(name = "Spawn", category = Category.HUD) @Module(name = "Spawn", category = Category.HUD)
public class AdminSpawner extends Mod { public class AdminSpawner extends Mod {
public void render() { public void render() {
@ -38,7 +37,9 @@ entity.getPos().getY()-Minecraft.getMinecraft().getRenderManager().renderPosY+0.
entity.getPos().getZ() - Minecraft.getMinecraft().getRenderManager().renderPosZ + 0.1, entity.getPos().getZ() - Minecraft.getMinecraft().getRenderManager().renderPosZ + 0.1,
entity.getPos().getX() - Minecraft.getMinecraft().getRenderManager().renderPosX + 0.9, entity.getPos().getX() - Minecraft.getMinecraft().getRenderManager().renderPosX + 0.9,
entity.getPos().getY() - Minecraft.getMinecraft().getRenderManager().renderPosY + 0.9, entity.getPos().getY() - Minecraft.getMinecraft().getRenderManager().renderPosY + 0.9,
entity.getPos().getZ()-Minecraft.getMinecraft().getRenderManager().renderPosZ+0.9)); entity.getPos().getZ() - Minecraft.getMinecraft().getRenderManager().renderPosZ + 0.9
)
);
GlStateManager.enableTexture2D(); GlStateManager.enableTexture2D();
GlStateManager.enableDepth(); GlStateManager.enableDepth();
GlStateManager.depthMask(true); GlStateManager.depthMask(true);

View File

@ -8,6 +8,7 @@ import dev.resent.visual.cape.CapeUi;
@Module(name = "Cape", category = Category.MISC, hasSetting = true) @Module(name = "Cape", category = Category.MISC, hasSetting = true)
public class Cape extends Mod { public class Cape extends Mod {
public CustomRectSettingDraw open = new CustomRectSettingDraw("Choose cape", "Select which cape you want to use") { public CustomRectSettingDraw open = new CustomRectSettingDraw("Choose cape", "Select which cape you want to use") {
@Override @Override
public void onPress() { public void onPress() {

View File

@ -8,6 +8,7 @@ import dev.resent.visual.crosshair.CrosshairUi;
@Module(name = "Crosshair", category = Category.MISC, hasSetting = true) @Module(name = "Crosshair", category = Category.MISC, hasSetting = true)
public class Crosshair extends Mod { public class Crosshair extends Mod {
public CustomRectSettingDraw open = new CustomRectSettingDraw("Choose crosshair", "Select which crosshair you want to use") { public CustomRectSettingDraw open = new CustomRectSettingDraw("Choose crosshair", "Select which crosshair you want to use") {
@Override @Override
public void onPress() { public void onPress() {

View File

@ -50,10 +50,10 @@ public class FPSOptions extends Mod{
ModManager.noParticles.setEnabled(true); ModManager.noParticles.setEnabled(true);
} }
}; };
//public BooleanSetting delay = new BooleanSetting("Chunk delay", "", false); //public BooleanSetting delay = new BooleanSetting("Chunk delay", "", false);
public FPSOptions() { public FPSOptions() {
addSetting(batchRendering, blockEffects, limit, lowTick, lightUpdates, noArmSwing, reducedWater, minSetting); addSetting(batchRendering, blockEffects, limit, lowTick, lightUpdates, noArmSwing, reducedWater, minSetting);
} }
} }

View File

@ -8,6 +8,7 @@ import dev.resent.module.base.setting.NumberSetting;
@Module(name = "Particles Mod", category = Category.MISC, hasSetting = true) @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 alwaysCrit = new BooleanSetting("Always critical", "", false);
public static BooleanSetting alwaysSharp = new BooleanSetting("Always sharpness", "", false); public static BooleanSetting alwaysSharp = new BooleanSetting("Always sharpness", "", false);
public static NumberSetting multiplier = new NumberSetting("Multiplier", "", 1, 1, 50, 1, 1); public static NumberSetting multiplier = new NumberSetting("Multiplier", "", 1, 1, 50, 1, 1);

View File

@ -16,5 +16,4 @@ public class Sprint extends Mod {
public void onDisable() { public void onDisable() {
KeyBinding.setKeyBindState(mc.gameSettings.keyBindSprint.getKeyCode(), false); KeyBinding.setKeyBindState(mc.gameSettings.keyBindSprint.getKeyCode(), false);
} }
} }

View File

@ -5,13 +5,11 @@ import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.util.Base64; import java.util.Base64;
import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem; import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip; import javax.sound.sampled.Clip;
import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.UnsupportedAudioFileException; import javax.sound.sampled.UnsupportedAudioFileException;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.ISound; import net.minecraft.client.audio.ISound;
import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.audio.PositionedSoundRecord;
@ -43,7 +41,6 @@ public class SoundManager {
Clip clip = AudioSystem.getClip(); Clip clip = AudioSystem.getClip();
clip.open(audioInputStream); clip.open(audioInputStream);
clip.start(); clip.start();
} catch (IOException ioe) { } catch (IOException ioe) {
ioe.printStackTrace(); ioe.printStackTrace();
} catch (UnsupportedAudioFileException e) { } catch (UnsupportedAudioFileException e) {

View File

@ -3,7 +3,6 @@ package dev.resent.util.misc;
import java.util.Collection; import java.util.Collection;
import java.util.Iterator; import java.util.Iterator;
import java.util.function.Predicate; import java.util.function.Predicate;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
public class FuncUtils { public class FuncUtils {

View File

@ -1,6 +1,7 @@
package dev.resent.util.misc; package dev.resent.util.misc;
public class TimerUtil { public class TimerUtil {
private static long halfSecond = 500000000; private static long halfSecond = 500000000;
private long lastTime; private long lastTime;
@ -20,7 +21,6 @@ public class TimerUtil {
if (getDeltaTime() >= halfSecond) { if (getDeltaTime() >= halfSecond) {
updateTime(); updateTime();
return true; return true;
} } else return false;
else return false;
} }
} }

View File

@ -19,12 +19,9 @@ public class RenderItemPhysics {
Item item = itemstack.getItem(); Item item = itemstack.getItem();
Block block = Block.getBlockFromItem(item); Block block = Block.getBlockFromItem(item);
if (item == null) if (item == null) {
{
return 0; return 0;
} } else {
else
{
boolean flag = p_177077_9_.isGui3d(); boolean flag = p_177077_9_.isGui3d();
int i = func_177078_a; int i = func_177078_a;
@ -43,15 +40,13 @@ public class RenderItemPhysics {
} }
if (!ModManager.itemPhysics.isEnabled()) { if (!ModManager.itemPhysics.isEnabled()) {
if (flag || Minecraft.getMinecraft().getRenderManager().options != null) if (flag || Minecraft.getMinecraft().getRenderManager().options != null) {
{
float f3 = (((float) itemIn.getAge() + p_177077_8_) / 20.0F + itemIn.hoverStart) * (180F / (float) Math.PI); 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); GlStateManager.rotate(f3, 0.0F, 1.0F, 0.0F);
} }
} }
if (!flag) if (!flag) {
{
float f6 = -0.0F * (float) (i - 1) * 0.5F; float f6 = -0.0F * (float) (i - 1) * 0.5F;
float f4 = -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; float f5 = -0.046875F * (float) (i - 1) * 0.5F;
@ -63,12 +58,8 @@ public class RenderItemPhysics {
GlStateManager.rotate(angle, 1F, 1F, 1F); GlStateManager.rotate(angle, 1F, 1F, 1F);
} }
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
return i; return i;
} }
} }
} }

View File

@ -82,8 +82,7 @@ public class RenderUtils {
double x2 = (double) (paramXEnd - radius); double x2 = (double) (paramXEnd - radius);
double y2 = (double) (paramYEnd - radius); double y2 = (double) (paramYEnd - radius);
if (popPush) if (popPush) GlStateManager.pushMatrix();
GlStateManager.pushMatrix();
GlStateManager.enableBlend(); GlStateManager.enableBlend();
GlStateManager.enableTexture2D(); GlStateManager.enableTexture2D();
GlStateManager.blendFunc(RealOpenGLEnums.GL_SRC_ALPHA, RealOpenGLEnums.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.blendFunc(RealOpenGLEnums.GL_SRC_ALPHA, RealOpenGLEnums.GL_ONE_MINUS_SRC_ALPHA);
@ -99,21 +98,16 @@ public class RenderUtils {
worldrenderer.begin(RealOpenGLEnums.GL_LINE_SMOOTH, DefaultVertexFormats.POSITION_TEX); worldrenderer.begin(RealOpenGLEnums.GL_LINE_SMOOTH, DefaultVertexFormats.POSITION_TEX);
double degree = Math.PI / 180; double degree = Math.PI / 180;
for (double i = 0; i <= 90; i += 1) for (double i = 0; i <= 90; i += 1) glVertex2d(x2 + Math.sin(i * degree) * radius, y2 + Math.cos(i * degree) * radius);
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 = 90; i <= 180; i += 1) for (double i = 180; i <= 270; i += 1) glVertex2d(x1 + Math.sin(i * degree) * radius, y1 + Math.cos(i * degree) * radius);
glVertex2d(x2 + 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 = 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(); EaglercraftGPU.glEndList();
GlStateManager.enableTexture2D(); GlStateManager.enableTexture2D();
GlStateManager.disableBlend(); GlStateManager.disableBlend();
//glDisable(GL_LINE_SMOOTH); //glDisable(GL_LINE_SMOOTH);
if (popPush) if (popPush) GlStateManager.popMatrix();
GlStateManager.popMatrix();
} }
public static void glVertex2d(double idk, double idk2) { public static void glVertex2d(double idk, double idk2) {
@ -135,7 +129,6 @@ public class RenderUtils {
} }
} }
public static void drawRoundedRect(final float paramFloat1, final float paramFloat2, final float paramFloat3, final float paramFloat4, final float paramFloat5) { public static void drawRoundedRect(final float paramFloat1, final float paramFloat2, final float paramFloat3, final float paramFloat4, final float paramFloat5) {
final int i = 18; final int i = 18;
final float f1 = 90.0f / i; final float f1 = 90.0f / i;

View File

@ -10,7 +10,7 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
public class RoundedUtil { 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) { public static void drawSmoothRoundedRect(float x, float y, float x1, float y1, float radius, int color) {
Tessellator tessellator = Tessellator.getInstance(); Tessellator tessellator = Tessellator.getInstance();
@ -29,24 +29,16 @@ public class RoundedUtil {
GlStateManager.color(red, green, blue, alpha); GlStateManager.color(red, green, blue, alpha);
worldrenderer.begin(RealOpenGLEnums.GL_POLYGON, DefaultVertexFormats.POSITION_TEX); worldrenderer.begin(RealOpenGLEnums.GL_POLYGON, DefaultVertexFormats.POSITION_TEX);
int i; int i;
for (i = 0; i <= 90; i += 3) 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);
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 = 90; i <= 180; i += 3) 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);
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 = 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(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(); tessellator.draw();
worldrenderer.begin(RealOpenGLEnums.GL_LINE_LOOP, DefaultVertexFormats.POSITION_TEX); worldrenderer.begin(RealOpenGLEnums.GL_LINE_LOOP, DefaultVertexFormats.POSITION_TEX);
for (i = 0; i <= 90; i += 3) 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);
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 = 90; i <= 180; i += 3) 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);
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 = 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(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(); tessellator.draw();
GlStateManager.enableTexture2D(); GlStateManager.enableTexture2D();
GlStateManager.disableBlend(); GlStateManager.disableBlend();
@ -55,6 +47,7 @@ public class RoundedUtil {
EaglercraftGPU.glLineWidth(1); EaglercraftGPU.glLineWidth(1);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); 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) { public static void drawRoundedRect(float x, float y, float x1, float y1, float radius, int color) {
Tessellator tessellator = Tessellator.getInstance(); Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer(); WorldRenderer worldrenderer = tessellator.getWorldRenderer();
@ -73,14 +66,10 @@ public class RoundedUtil {
GlStateManager.color(red, green, blue, alpha); GlStateManager.color(red, green, blue, alpha);
worldrenderer.begin(RealOpenGLEnums.GL_POLYGON, DefaultVertexFormats.POSITION_TEX); worldrenderer.begin(RealOpenGLEnums.GL_POLYGON, DefaultVertexFormats.POSITION_TEX);
int i; int i;
for (i = 0; i <= 90; i += 3) 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);
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 = 90; i <= 180; i += 3) 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);
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 = 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(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(); tessellator.draw();
GlStateManager.enableTexture2D(); GlStateManager.enableTexture2D();
GlStateManager.disableBlend(); GlStateManager.disableBlend();

View File

@ -56,5 +56,4 @@ public class CapeManager {
return false; return false;
} }
} }

View File

@ -56,5 +56,4 @@ public class CrosshairManager {
return false; return false;
} }
} }

View File

@ -31,7 +31,4 @@ public class PreVideo extends GuiScreen{
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()); 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); drawCenteredString(mc.fontRendererObj, "Back", width / 2, height / 2 + 51, -1);
} }
} }

View File

@ -35,8 +35,6 @@ public class Theme {
return new DecelerateAnimation(ms, endpoint); return new DecelerateAnimation(ms, endpoint);
case "Smooth step": case "Smooth step":
return new SmoothStepAnimation(ms, endpoint); return new SmoothStepAnimation(ms, endpoint);
case "None":
return null;
} }
return null; return null;

View File

@ -56,8 +56,7 @@ public abstract class Animation {
} }
public double getValue() { public double getValue() {
if(HUD.animationTheme.getValue().equals("None")) if (HUD.animationTheme.getValue().equals("None")) return 0;
return 0;
if (direction == Direction.FORWARDS) { if (direction == Direction.FORWARDS) {
if (isDone()) return endPoint; if (isDone()) return endPoint;
return (getEquation(timer.getTime()) * endPoint); return (getEquation(timer.getTime()) * endPoint);

View File

@ -1,8 +1,5 @@
package dev.resent.visual.ui.clickgui; package dev.resent.visual.ui.clickgui;
import java.io.IOException;
import java.util.Comparator;
import dev.resent.client.ClientInfo; import dev.resent.client.ClientInfo;
import dev.resent.client.Resent; import dev.resent.client.Resent;
import dev.resent.module.base.Mod; 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.Theme;
import dev.resent.visual.ui.animation.Animation; import dev.resent.visual.ui.animation.Animation;
import dev.resent.visual.ui.animation.Direction; 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.Keyboard;
import net.lax1dude.eaglercraft.v1_8.Mouse; import net.lax1dude.eaglercraft.v1_8.Mouse;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
@ -83,12 +82,10 @@ public class ClickGUI extends GuiScreen {
this.openedMod = 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) { } 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 //toggle new
if(m.getName() != "ClickGUI") if (m.getName() != "ClickGUI") m.toggle();
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") { } 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 //toggle classic
if(m.getName() != "ClickGUI") if (m.getName() != "ClickGUI") m.toggle();
m.toggle();
} }
if (xo > width / 2) { if (xo > width / 2) {
xo = 0; xo = 0;
@ -102,7 +99,6 @@ public class ClickGUI extends GuiScreen {
if (openedMod != null) { if (openedMod != null) {
int var = 0; int var = 0;
for (Setting s : this.openedMod.settings) { for (Setting s : this.openedMod.settings) {
if (s instanceof NumberSetting) { if (s instanceof NumberSetting) {
if (isMouseInside(mouseX, mouseY, width - 150 + sliderOffset, height + 41 + var, width - 141 + sliderOffset, height + 50 + var)) { if (isMouseInside(mouseX, mouseY, width - 150 + sliderOffset, height + 41 + var, width - 141 + sliderOffset, height + 50 + var)) {
draggingNumber = true; draggingNumber = true;
@ -265,7 +261,6 @@ public class ClickGUI extends GuiScreen {
} else if (draggingNumber) { } else if (draggingNumber) {
settingDrag = true; settingDrag = true;
} }
} }
if (s instanceof BooleanSetting) { if (s instanceof BooleanSetting) {
@ -304,10 +299,6 @@ public class ClickGUI extends GuiScreen {
return false; 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() { public void onGuiClosed() {
Keyboard.enableRepeatEvents(true); Keyboard.enableRepeatEvents(true);
ModManager.clickGui.setEnabled(false); ModManager.clickGui.setEnabled(false);
@ -341,20 +332,19 @@ public class ClickGUI extends GuiScreen {
for (int i = 0; i < 20; i++) { for (int i = 0; i < 20; i++) {
offset = MathHelper.clamp_int(offset + 1, 0, getListMaxScroll()); offset = MathHelper.clamp_int(offset + 1, 0, getListMaxScroll());
try { try {
if(ModManager.clickGui.scroll.getValue()) if (ModManager.clickGui.scroll.getValue()) Thread.sleep(1);
Thread.sleep(1);
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
}).start(); })
.start();
} else if (wheel > 0) { } else if (wheel > 0) {
new Thread(() -> { new Thread(() -> {
for (int i = 0; i < 20; i++) { for (int i = 0; i < 20; i++) {
offset = MathHelper.clamp_int(offset - 1, 0, getListMaxScroll()); offset = MathHelper.clamp_int(offset - 1, 0, getListMaxScroll());
try { try {
if(ModManager.clickGui.scroll.getValue()) if (ModManager.clickGui.scroll.getValue()) Thread.sleep(1);
Thread.sleep(1);
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -13,7 +13,6 @@ public class HUDConfigScreen extends GuiScreen {
parentGuiScreen = parentScreen; parentGuiScreen = parentScreen;
} }
public void initGui() { public void initGui() {
this.buttonList.add(new GuiButton(200, width / 2 - 100, height - 30, "Back")); this.buttonList.add(new GuiButton(200, width / 2 - 100, height - 30, "Back"));
} }

View File

@ -17,7 +17,6 @@ public class PreGUI extends GuiScreen {
@Override @Override
public void drawScreen(int i, int j, float var3) { public void drawScreen(int i, int j, float var3) {
opacityAnimation.setAnimation(100, 5); opacityAnimation.setAnimation(100, 5);
slideAnimation.setAnimation(200, 7); slideAnimation.setAnimation(200, 7);
@ -59,7 +58,4 @@ public class PreGUI extends GuiScreen {
super.keyTyped(parChar1, parInt1); 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);
}
} }

View File

@ -1,8 +1,5 @@
package dev.resent.visual.ui.clickgui.rewrite; package dev.resent.visual.ui.clickgui.rewrite;
import java.io.IOException;
import java.util.ArrayList;
import dev.resent.client.Resent; import dev.resent.client.Resent;
import dev.resent.module.base.Mod; import dev.resent.module.base.Mod;
import dev.resent.module.base.setting.BooleanSetting; 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.animation.SimpleAnimation;
import dev.resent.visual.ui.clickgui.rewrite.comp.Comp; import dev.resent.visual.ui.clickgui.rewrite.comp.Comp;
import dev.resent.visual.ui.clickgui.rewrite.comp.impl.CompCheck; 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.Mouse;
import net.lax1dude.eaglercraft.v1_8.internal.KeyboardConstants; import net.lax1dude.eaglercraft.v1_8.internal.KeyboardConstants;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
@ -36,15 +35,11 @@ public class ClickGuiRewrite extends GuiScreen {
public float x, y, width, height; public float x, y, width, height;
public Animation introAnimation; public Animation introAnimation;
public ScaledResolution sr; public ScaledResolution sr;
public boolean closing, isSearchFocused, iforgor, iforgor2 = true; public boolean closing, isSearchFocused, home = true, setting;
public Mod selectedMod; public Mod selectedMod;
public String searchString = ""; public String searchString = "";
public SimpleAnimation partAnimation; public SimpleAnimation partAnimation;
public int backgroundColor = new Color(18, 18, 18).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();
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 int scrollOffset = 0;
public String part = "Home"; 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); GlUtils.startScale((this.x+this.width) / 2, (this.y+this.height) / 2, introAnimation != null ? (float) introAnimation.getValue() : 1);
/* !-------------- NECESSARY ELEMENTS -----------------! */
//Navigation bar //Navigation bar
RenderUtils.drawRoundedRect(x, y, x+width-60, y+height, 32, secondaryColor); RenderUtils.drawRoundedRect(x, y, x+width-60, y+height, 32, secondaryColor);
@ -73,9 +70,10 @@ public class ClickGuiRewrite extends GuiScreen {
fr.drawString("Resent", x+80, y+36, -1, false); fr.drawString("Resent", x+80, y+36, -1, false);
GlStateManager.popMatrix(); GlStateManager.popMatrix();
if (iforgor) { if (setting) {
partAnimation.setAnimation(50, 9); partAnimation.setAnimation(50, 9);
} else if (iforgor2) { }
if (home) {
partAnimation.setAnimation(0, 9); partAnimation.setAnimation(0, 9);
} }
@ -92,7 +90,6 @@ public class ClickGuiRewrite extends GuiScreen {
//Search //Search
RenderUtils.drawRoundedRect(x+width-300, y+25, x+width-50, y+65, 9, secondaryColor); RenderUtils.drawRoundedRect(x+width-300, y+25, x+width-50, y+65, 9, secondaryColor);
mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/search.png")); mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/search.png"));
Gui.drawModalRectWithCustomSizedTexture(x+width-290, (int) y+36, 0, 0, 20, 20, 20, 20); Gui.drawModalRectWithCustomSizedTexture(x+width-290, (int) y+36, 0, 0, 20, 20, 20, 20);
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
@ -111,6 +108,8 @@ public class ClickGuiRewrite extends GuiScreen {
GlStateManager.popMatrix(); GlStateManager.popMatrix();
/* !------------- HOME/MODULE (SOON) --------------------! */
//Draw module button //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 (!m.isAdmin() && m.getName().toLowerCase().startsWith(searchString.toLowerCase()) && selectedMod == null) {
@ -134,19 +133,19 @@ public class ClickGuiRewrite extends GuiScreen {
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); fr.drawString(m.getDescription(), x+20+i, y+142+offset+scrollOffset, -1, false);
GlStateManager.popMatrix(); GlStateManager.popMatrix();
// if (isMouseInside(mouseX, mouseY, x+i+80, y+115+offset+scrollOffset, x+width-20, y+185+offset+scrollOffset)) { // 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); // fr.drawString(m.getDescription(), mousex+8, mouseY, onSurfaceColor, false);
// } // }
} }
offset += 60; offset += 60;
} }
} }
if (selectedMod != null) { /* !------------- SETTINGS ----------------! */
if (selectedMod != null) {
fr.drawString("<", x+80, y+115+offset, -1, false); 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) { for (Comp comp : comps) {
comp.drawScreen(mouseX, mouseY); comp.drawScreen(mouseX, mouseY);
@ -167,20 +166,18 @@ public class ClickGuiRewrite extends GuiScreen {
mc.displayGuiScreen(null); mc.displayGuiScreen(null);
} }
} }
} }
@Override @Override
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) { protected void mouseClicked(int mouseX, int mouseY, int mouseButton) {
if (isMouseInside(mouseX, mouseY, x+20, (int) y+120, x+40, (int) y+140)) {
if (isMouseInside(mouseX, mouseY, x+20, (int) y+170, x+40, (int) y+190)) { setting = false;
iforgor2 = false; home = true;
iforgor = true;
part = "Setting";
} else if (isMouseInside(mouseX, mouseY, x+20, (int) y+120, x+40, (int) y+140)) {
iforgor = false;
iforgor2 = true;
part = "Home"; 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)) { if (isMouseInside(mouseX, mouseY, x+width-300, y+25, x+width-50, y+65)) {
@ -194,7 +191,6 @@ public class ClickGuiRewrite extends GuiScreen {
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 (!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 (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()) { if (isMouseInside(mouseX, mouseY, x+width-60, y+140+offset+scrollOffset, x+width-40, y+160+offset+scrollOffset) && mouseButton == 0 && m.doesHaveSetting()) {
selectedMod = m; selectedMod = m;
@ -214,7 +210,6 @@ public class ClickGuiRewrite extends GuiScreen {
int settingOffset = 0; int settingOffset = 0;
for (Setting s : selectedMod.settings) { for (Setting s : selectedMod.settings) {
if (s instanceof BooleanSetting) { if (s instanceof BooleanSetting) {
comps.add(new CompCheck(x+110, y+125+settingOffset, selectedMod, s)); comps.add(new CompCheck(x+110, y+125+settingOffset, selectedMod, s));
} }
@ -227,7 +222,6 @@ public class ClickGuiRewrite extends GuiScreen {
m.toggle(); m.toggle();
} }
} }
} }
offset += 60; offset += 60;
} }
@ -243,11 +237,8 @@ public class ClickGuiRewrite extends GuiScreen {
c.mouseClicked(mouseX, mouseY, mouseButton); c.mouseClicked(mouseX, mouseY, mouseButton);
} }
} }
} }
@Override @Override
public void initGui() { public void initGui() {
sr = new ScaledResolution(mc); sr = new ScaledResolution(mc);
@ -273,23 +264,19 @@ public class ClickGuiRewrite extends GuiScreen {
} }
// Search box stuff // Search box stuff
else if (key == KeyboardConstants.KEY_BACK && isSearchFocused) { if (key == KeyboardConstants.KEY_BACK && isSearchFocused) {
if (searchString.length() != 0) { if (searchString.length() != 0) {
searchString = searchString.substring(0, searchString.length()-1); searchString = searchString.substring(0, searchString.length()-1);
} }
} else { } else if (searchString.length() <= 18 && isSearchFocused) {
if (searchString.length() <= 18 && isSearchFocused) {
String balls = ChatAllowedCharacters.filterAllowedCharacters(String.valueOf(par1)); String balls = ChatAllowedCharacters.filterAllowedCharacters(String.valueOf(par1));
if (balls != null && balls != "") { if (balls != "") {
searchString += String.valueOf(par1); searchString += String.valueOf(par1);
scrollOffset = 0; scrollOffset = 0;
} }
} }
} }
}
@Override
public void handleMouseInput() throws IOException { public void handleMouseInput() throws IOException {
int scroll = Mouse.getEventDWheel(); int scroll = Mouse.getEventDWheel();

View File

@ -17,5 +17,4 @@ public abstract class Comp {
public boolean isMouseInside(double mouseX, double mouseY, double x, double y, double width, double height) { public boolean isMouseInside(double mouseX, double mouseY, double x, double y, double width, double height) {
return (mouseX >= x && mouseX <= width) && (mouseY >= y && mouseY <= height); return (mouseX >= x && mouseX <= width) && (mouseY >= y && mouseY <= height);
} }
} }

View File

@ -3,7 +3,6 @@ package dev.resent.visual.ui.clickgui.rewrite.comp.impl;
import dev.resent.module.base.Mod; import dev.resent.module.base.Mod;
import dev.resent.module.base.setting.BooleanSetting; import dev.resent.module.base.setting.BooleanSetting;
import dev.resent.module.base.setting.Setting; import dev.resent.module.base.setting.Setting;
import dev.resent.util.misc.FuncUtils;
import dev.resent.util.render.Color; import dev.resent.util.render.Color;
import dev.resent.util.render.RenderUtils; import dev.resent.util.render.RenderUtils;
import dev.resent.visual.ui.clickgui.rewrite.comp.Comp; import dev.resent.visual.ui.clickgui.rewrite.comp.Comp;
@ -30,5 +29,4 @@ public class CompCheck extends Comp{
((BooleanSetting) setting).toggle(); ((BooleanSetting) setting).toggle();
} }
} }
} }

View File

@ -1,9 +1,8 @@
package net.minecraft.block; package net.minecraft.block;
import java.util.List;
import dev.resent.module.base.ModManager; import dev.resent.module.base.ModManager;
import dev.resent.module.impl.misc.AdminRay; import dev.resent.module.impl.misc.AdminRay;
import java.util.List;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.minecraft.block.material.MapColor; import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
@ -400,7 +399,6 @@ public class Block {
} }
public int getMixedBrightnessForBlock(IBlockAccess worldIn, BlockPos pos) { public int getMixedBrightnessForBlock(IBlockAccess worldIn, BlockPos pos) {
if (ModManager.adminRay.isEnabled()) { if (ModManager.adminRay.isEnabled()) {
return 99999; return 99999;
} }
@ -417,7 +415,6 @@ public class Block {
} }
public boolean shouldSideBeRendered(IBlockAccess iblockaccess, BlockPos blockpos, EnumFacing enumfacing) { public boolean shouldSideBeRendered(IBlockAccess iblockaccess, BlockPos blockpos, EnumFacing enumfacing) {
if (ModManager.adminRay.isEnabled()) { if (ModManager.adminRay.isEnabled()) {
return AdminRay.shouldRender(this); return AdminRay.shouldRender(this);
} }

View File

@ -1,9 +1,8 @@
package net.minecraft.block; package net.minecraft.block;
import dev.resent.module.base.ModManager;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.Set; import java.util.Set;
import dev.resent.module.base.ModManager;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;

View File

@ -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_PROJECTION;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_SMOOTH; 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.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.text.DecimalFormat; import java.text.DecimalFormat;
@ -18,17 +25,6 @@ import java.util.Collections;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.concurrent.Callable; 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.Display;
import net.lax1dude.eaglercraft.v1_8.EagRuntime; import net.lax1dude.eaglercraft.v1_8.EagRuntime;
import net.lax1dude.eaglercraft.v1_8.EagUtils; import net.lax1dude.eaglercraft.v1_8.EagUtils;
@ -166,6 +162,7 @@ import net.minecraft.world.EnumDifficulty;
import net.minecraft.world.WorldProviderEnd; import net.minecraft.world.WorldProviderEnd;
import net.minecraft.world.WorldProviderHell; import net.minecraft.world.WorldProviderHell;
import net.minecraft.world.WorldSettings; import net.minecraft.world.WorldSettings;
import org.apache.commons.lang3.Validate;
/**+ /**+
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
@ -186,6 +183,7 @@ import net.minecraft.world.WorldSettings;
* *
*/ */
public class Minecraft implements IThreadListener { public class Minecraft implements IThreadListener {
private static final Logger logger = LogManager.getLogger(); private static final Logger logger = LogManager.getLogger();
private static final ResourceLocation locationMojangPng = new ResourceLocation("textures/gui/title/mojang.png"); private static final ResourceLocation locationMojangPng = new ResourceLocation("textures/gui/title/mojang.png");
public static final boolean isRunningOnMac = false; public static final boolean isRunningOnMac = false;
@ -351,15 +349,13 @@ public class Minecraft implements IThreadListener {
logger.fatal("Reported exception thrown!", reportedexception); logger.fatal("Reported exception thrown!", reportedexception);
this.displayCrashReport(reportedexception.getCrashReport()); this.displayCrashReport(reportedexception.getCrashReport());
} catch (Throwable throwable1) { } catch (Throwable throwable1) {
CrashReport crashreport1 = this CrashReport crashreport1 = this.addGraphicsAndWorldToCrashReport(new CrashReport("Unexpected error", throwable1));
.addGraphicsAndWorldToCrashReport(new CrashReport("Unexpected error", throwable1));
this.freeMemory(); this.freeMemory();
logger.fatal("Unreported exception thrown!", throwable1); logger.fatal("Unreported exception thrown!", throwable1);
this.displayCrashReport(crashreport1); this.displayCrashReport(crashreport1);
} finally { } finally {
this.shutdownMinecraftApplet(); this.shutdownMinecraftApplet();
} }
} }
/**+ /**+
@ -377,8 +373,7 @@ public class Minecraft implements IThreadListener {
logger.info("EagRuntime Version: " + EagRuntime.getVersion()); logger.info("EagRuntime Version: " + EagRuntime.getVersion());
this.createDisplay(); this.createDisplay();
this.registerMetadataSerializers(); this.registerMetadataSerializers();
this.mcResourcePackRepository = new ResourcePackRepository(this.mcDefaultResourcePack, this.metadataSerializer_, this.mcResourcePackRepository = new ResourcePackRepository(this.mcDefaultResourcePack, this.metadataSerializer_, this.gameSettings);
this.gameSettings);
this.mcResourceManager = new SimpleReloadableResourceManager(this.metadataSerializer_); this.mcResourceManager = new SimpleReloadableResourceManager(this.metadataSerializer_);
this.mcLanguageManager = new LanguageManager(this.metadataSerializer_, this.gameSettings.language); this.mcLanguageManager = new LanguageManager(this.metadataSerializer_, this.gameSettings.language);
this.mcResourceManager.registerReloadListener(this.mcLanguageManager); this.mcResourceManager.registerReloadListener(this.mcLanguageManager);
@ -389,10 +384,8 @@ public class Minecraft implements IThreadListener {
this.mcSoundHandler = new SoundHandler(this.mcResourceManager, this.gameSettings); this.mcSoundHandler = new SoundHandler(this.mcResourceManager, this.gameSettings);
this.mcResourceManager.registerReloadListener(this.mcSoundHandler); this.mcResourceManager.registerReloadListener(this.mcSoundHandler);
this.mcMusicTicker = new MusicTicker(this); this.mcMusicTicker = new MusicTicker(this);
this.fontRendererObj = new EaglerFontRenderer(this.gameSettings, this.fontRendererObj = new EaglerFontRenderer(this.gameSettings, new ResourceLocation("textures/font/ascii.png"), this.renderEngine, false);
new ResourceLocation("textures/font/ascii.png"), this.renderEngine, false); this.uwuFont = new EaglerFontRenderer(this.gameSettings, new ResourceLocation("textures/font/uwufont.png"), this.renderEngine, false);
this.uwuFont = new EaglerFontRenderer(this.gameSettings,
new ResourceLocation("textures/font/uwufont.png"), this.renderEngine, false);
if (this.gameSettings.language != null) { if (this.gameSettings.language != null) {
this.fontRendererObj.setUnicodeFlag(this.isUnicode()); this.fontRendererObj.setUnicodeFlag(this.isUnicode());
this.fontRendererObj.setBidiFlag(this.mcLanguageManager.isCurrentLanguageBidirectional()); this.fontRendererObj.setBidiFlag(this.mcLanguageManager.isCurrentLanguageBidirectional());
@ -400,23 +393,23 @@ public class Minecraft implements IThreadListener {
this.uwuFont.setBidiFlag(this.mcLanguageManager.isCurrentLanguageBidirectional()); this.uwuFont.setBidiFlag(this.mcLanguageManager.isCurrentLanguageBidirectional());
} }
this.standardGalacticFontRenderer = new EaglerFontRenderer(this.gameSettings, this.standardGalacticFontRenderer = new EaglerFontRenderer(this.gameSettings, new ResourceLocation("textures/font/ascii_sga.png"), this.renderEngine, false);
new ResourceLocation("textures/font/ascii_sga.png"), this.renderEngine, false);
this.mcResourceManager.registerReloadListener(this.fontRendererObj); this.mcResourceManager.registerReloadListener(this.fontRendererObj);
this.mcResourceManager.registerReloadListener(this.standardGalacticFontRenderer); this.mcResourceManager.registerReloadListener(this.standardGalacticFontRenderer);
this.mcResourceManager.registerReloadListener(this.uwuFont); this.mcResourceManager.registerReloadListener(this.uwuFont);
this.mcResourceManager.registerReloadListener(new GrassColorReloadListener()); this.mcResourceManager.registerReloadListener(new GrassColorReloadListener());
this.mcResourceManager.registerReloadListener(new FoliageColorReloadListener()); this.mcResourceManager.registerReloadListener(new FoliageColorReloadListener());
AchievementList.openInventory.setStatStringFormatter(new IStatStringFormat() { AchievementList.openInventory.setStatStringFormatter(
new IStatStringFormat() {
public String formatString(String parString1) { public String formatString(String parString1) {
try { try {
return HString.format(parString1, new Object[] { GameSettings return HString.format(parString1, new Object[] { GameSettings.getKeyDisplayString(Minecraft.this.gameSettings.keyBindInventory.getKeyCode()) });
.getKeyDisplayString(Minecraft.this.gameSettings.keyBindInventory.getKeyCode()) });
} catch (Exception exception) { } catch (Exception exception) {
return "Error: " + exception.getLocalizedMessage(); return "Error: " + exception.getLocalizedMessage();
} }
} }
}); }
);
this.mouseHelper = new MouseHelper(); this.mouseHelper = new MouseHelper();
this.checkGLError("Pre startup"); this.checkGLError("Pre startup");
GlStateManager.enableTexture2D(); GlStateManager.enableTexture2D();
@ -444,8 +437,7 @@ public class Minecraft implements IThreadListener {
this.mcResourceManager.registerReloadListener(this.renderItem); this.mcResourceManager.registerReloadListener(this.renderItem);
this.entityRenderer = new EntityRenderer(this, this.mcResourceManager); this.entityRenderer = new EntityRenderer(this, this.mcResourceManager);
this.mcResourceManager.registerReloadListener(this.entityRenderer); this.mcResourceManager.registerReloadListener(this.entityRenderer);
this.blockRenderDispatcher = new BlockRendererDispatcher(this.modelManager.getBlockModelShapes(), this.blockRenderDispatcher = new BlockRendererDispatcher(this.modelManager.getBlockModelShapes(), this.gameSettings);
this.gameSettings);
this.mcResourceManager.registerReloadListener(this.blockRenderDispatcher); this.mcResourceManager.registerReloadListener(this.blockRenderDispatcher);
this.renderGlobal = new RenderGlobal(this); this.renderGlobal = new RenderGlobal(this);
this.mcResourceManager.registerReloadListener(this.renderGlobal); this.mcResourceManager.registerReloadListener(this.renderGlobal);
@ -461,8 +453,7 @@ public class Minecraft implements IThreadListener {
EaglerProfile.read(); EaglerProfile.read();
if (this.serverName != null) { if (this.serverName != null) {
this.displayGuiScreen(new GuiScreenEditProfile( this.displayGuiScreen(new GuiScreenEditProfile(new GuiConnecting(new GuiMainMenu(), this, this.serverName, this.serverPort)));
new GuiConnecting(new GuiMainMenu(), this, this.serverName, this.serverPort)));
} else { } else {
this.displayGuiScreen(new GuiScreenEditProfile(new GuiMainMenu())); this.displayGuiScreen(new GuiScreenEditProfile(new GuiMainMenu()));
} }
@ -476,16 +467,11 @@ public class Minecraft implements IThreadListener {
} }
private void registerMetadataSerializers() { private void registerMetadataSerializers() {
this.metadataSerializer_.registerMetadataSectionType(new TextureMetadataSectionSerializer(), this.metadataSerializer_.registerMetadataSectionType(new TextureMetadataSectionSerializer(), TextureMetadataSection.class);
TextureMetadataSection.class); this.metadataSerializer_.registerMetadataSectionType(new FontMetadataSectionSerializer(), FontMetadataSection.class);
this.metadataSerializer_.registerMetadataSectionType(new FontMetadataSectionSerializer(), this.metadataSerializer_.registerMetadataSectionType(new AnimationMetadataSectionSerializer(), AnimationMetadataSection.class);
FontMetadataSection.class); this.metadataSerializer_.registerMetadataSectionType(new PackMetadataSectionSerializer(), PackMetadataSection.class);
this.metadataSerializer_.registerMetadataSectionType(new AnimationMetadataSectionSerializer(), this.metadataSerializer_.registerMetadataSectionType(new LanguageMetadataSectionSerializer(), LanguageMetadataSection.class);
AnimationMetadataSection.class);
this.metadataSerializer_.registerMetadataSectionType(new PackMetadataSectionSerializer(),
PackMetadataSection.class);
this.metadataSerializer_.registerMetadataSectionType(new LanguageMetadataSectionSerializer(),
LanguageMetadataSection.class);
} }
private void initStream() { private void initStream() {
@ -518,14 +504,12 @@ public class Minecraft implements IThreadListener {
Bootstrap.printToSYSOUT(report); Bootstrap.printToSYSOUT(report);
PlatformRuntime.writeCrashReport(report); PlatformRuntime.writeCrashReport(report);
if (PlatformRuntime.getPlatformType() == EnumPlatformType.JAVASCRIPT) { if (PlatformRuntime.getPlatformType() == EnumPlatformType.JAVASCRIPT) {
System.err.println( System.err.println("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%");
"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%");
System.err.println("NATIVE BROWSER EXCEPTION:"); System.err.println("NATIVE BROWSER EXCEPTION:");
if (!PlatformRuntime.printJSExceptionIfBrowser(crashReportIn.getCrashCause())) { if (!PlatformRuntime.printJSExceptionIfBrowser(crashReportIn.getCrashCause())) {
System.err.println("<undefined>"); System.err.println("<undefined>");
} }
System.err.println( System.err.println("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%");
"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%");
} }
} }
@ -538,8 +522,7 @@ public class Minecraft implements IThreadListener {
ArrayList arraylist = Lists.newArrayList(this.defaultResourcePacks); ArrayList arraylist = Lists.newArrayList(this.defaultResourcePacks);
for (ResourcePackRepository.Entry resourcepackrepository$entry : this.mcResourcePackRepository for (ResourcePackRepository.Entry resourcepackrepository$entry : this.mcResourcePackRepository.getRepositoryEntries()) {
.getRepositoryEntries()) {
arraylist.add(resourcepackrepository$entry.getResourcePack()); arraylist.add(resourcepackrepository$entry.getResourcePack());
} }
@ -565,7 +548,6 @@ public class Minecraft implements IThreadListener {
if (this.renderGlobal != null) { if (this.renderGlobal != null) {
this.renderGlobal.loadRenderers(); this.renderGlobal.loadRenderers();
} }
} }
private void updateDisplayMode() { private void updateDisplayMode() {
@ -581,8 +563,7 @@ public class Minecraft implements IThreadListener {
int i = scaledresolution.getScaleFactor(); int i = scaledresolution.getScaleFactor();
GlStateManager.matrixMode(GL_PROJECTION); GlStateManager.matrixMode(GL_PROJECTION);
GlStateManager.loadIdentity(); GlStateManager.loadIdentity();
GlStateManager.ortho(0.0D, (double) scaledresolution.getScaledWidth(), GlStateManager.ortho(0.0D, (double) scaledresolution.getScaledWidth(), (double) scaledresolution.getScaledHeight(), 0.0D, 1000.0D, 3000.0D);
(double) scaledresolution.getScaledHeight(), 0.0D, 1000.0D, 3000.0D);
GlStateManager.matrixMode(GL_MODELVIEW); GlStateManager.matrixMode(GL_MODELVIEW);
GlStateManager.loadIdentity(); GlStateManager.loadIdentity();
GlStateManager.translate(0.0F, 0.0F, -2000.0F); GlStateManager.translate(0.0F, 0.0F, -2000.0F);
@ -594,8 +575,7 @@ public class Minecraft implements IThreadListener {
try { try {
inputstream = this.mcDefaultResourcePack.getInputStream(locationMojangPng); inputstream = this.mcDefaultResourcePack.getInputStream(locationMojangPng);
this.mojangLogo = textureManagerInstance.getDynamicTextureLocation("logo", this.mojangLogo = textureManagerInstance.getDynamicTextureLocation("logo", new DynamicTexture(ImageData.loadImageFile(inputstream)));
new DynamicTexture(ImageData.loadImageFile(inputstream)));
textureManagerInstance.bindTexture(this.mojangLogo); textureManagerInstance.bindTexture(this.mojangLogo);
} catch (IOException ioexception) { } catch (IOException ioexception) {
logger.error("Unable to load logo: " + locationMojangPng, ioexception); logger.error("Unable to load logo: " + locationMojangPng, ioexception);
@ -606,18 +586,15 @@ public class Minecraft implements IThreadListener {
Tessellator tessellator = Tessellator.getInstance(); Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer(); WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); 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) worldrenderer.pos(0.0D, (double) this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
.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, (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((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(); worldrenderer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
tessellator.draw(); tessellator.draw();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
short short1 = 256; short short1 = 256;
short short2 = 256; short short2 = 256;
this.func_181536_a((scaledresolution.getScaledWidth() - short1) / 2, this.func_181536_a((scaledresolution.getScaledWidth() - short1) / 2, (scaledresolution.getScaledHeight() - short2) / 2, 0, 0, short1, short2, 255, 255, 255, 255);
(scaledresolution.getScaledHeight() - short2) / 2, 0, 0, short1, short2, 255, 255, 255, 255);
GlStateManager.disableLighting(); GlStateManager.disableLighting();
GlStateManager.disableFog(); GlStateManager.disableFog();
GlStateManager.enableAlpha(); GlStateManager.enableAlpha();
@ -626,28 +603,17 @@ public class Minecraft implements IThreadListener {
PlatformRuntime.showMojangScreen(); PlatformRuntime.showMojangScreen();
EagUtils.sleep(200l); EagUtils.sleep(200l);
} }
public void func_181536_a(int parInt1, int parInt2, int parInt3, int parInt4, int parInt5, int parInt6, int parInt7, 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) {
int parInt8, int parInt9, int parInt10) {
float f = 0.00390625F; float f = 0.00390625F;
float f1 = 0.00390625F; float f1 = 0.00390625F;
WorldRenderer worldrenderer = Tessellator.getInstance().getWorldRenderer(); WorldRenderer worldrenderer = Tessellator.getInstance().getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
worldrenderer.pos((double) parInt1, (double) (parInt2 + parInt6), 0.0D) 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();
.tex((double) ((float) parInt3 * f), (double) ((float) (parInt4 + parInt6) * f1)) 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();
.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 + parInt5), (double) (parInt2 + parInt6), 0.0D) worldrenderer.pos((double) parInt1, (double) parInt2, 0.0D).tex((double) ((float) parInt3 * f), (double) ((float) parInt4 * f1)).color(parInt7, parInt8, parInt9, parInt10).endVertex();
.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(); Tessellator.getInstance().draw();
} }
@ -683,7 +649,6 @@ public class Minecraft implements IThreadListener {
this.mcSoundHandler.resumeSounds(); this.mcSoundHandler.resumeSounds();
this.setIngameFocus(); this.setIngameFocus();
} }
} }
/**+ /**+
@ -699,7 +664,6 @@ public class Minecraft implements IThreadListener {
logger.error("@ " + message); logger.error("@ " + message);
logger.error(i + ": " + s); logger.error(i + ": " + s);
} }
} }
} }
@ -714,9 +678,7 @@ public class Minecraft implements IThreadListener {
try { try {
this.loadWorld((WorldClient) null); this.loadWorld((WorldClient) null);
} catch (Throwable var5) { } catch (Throwable var5) {}
;
}
this.mcSoundHandler.unloadSounds(); this.mcSoundHandler.unloadSounds();
} finally { } finally {
@ -724,7 +686,6 @@ public class Minecraft implements IThreadListener {
if (!this.hasCrashed) { if (!this.hasCrashed) {
EagRuntime.exit(); EagRuntime.exit();
} }
} }
} }
@ -787,8 +748,7 @@ public class Minecraft implements IThreadListener {
} }
this.mcProfiler.endSection(); this.mcProfiler.endSection();
if (this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart if (this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart && !this.gameSettings.hideGUI) {
&& !this.gameSettings.hideGUI) {
if (!this.mcProfiler.profilingEnabled) { if (!this.mcProfiler.profilingEnabled) {
this.mcProfiler.clearProfiling(); this.mcProfiler.clearProfiling();
} }
@ -816,14 +776,19 @@ public class Minecraft implements IThreadListener {
while (getSystemTime() >= this.debugUpdateTime + 1000L) { while (getSystemTime() >= this.debugUpdateTime + 1000L) {
debugFPS = this.fpsCounter; debugFPS = this.fpsCounter;
this.debug = HString.format("%d fps (%d chunk update%s) T: %s%s%s%s", this.debug =
new Object[] { Integer.valueOf(debugFPS), Integer.valueOf(RenderChunk.renderChunksUpdated), 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" : "", RenderChunk.renderChunksUpdated != 1 ? "s" : "",
(float) this.gameSettings.limitFramerate == GameSettings.Options.FRAMERATE_LIMIT (float) this.gameSettings.limitFramerate == GameSettings.Options.FRAMERATE_LIMIT.getValueMax() ? "inf" : Integer.valueOf(this.gameSettings.limitFramerate),
.getValueMax() ? "inf" : Integer.valueOf(this.gameSettings.limitFramerate),
this.gameSettings.enableVsync ? " vsync" : "", this.gameSettings.enableVsync ? " vsync" : "",
this.gameSettings.fancyGraphics ? "" : " fast", this.gameSettings.clouds == 0 ? "" this.gameSettings.fancyGraphics ? "" : " fast",
: (this.gameSettings.clouds == 1 ? " fast-clouds" : " fancy-clouds") }); this.gameSettings.clouds == 0 ? "" : (this.gameSettings.clouds == 1 ? " fast-clouds" : " fancy-clouds")
}
);
RenderChunk.renderChunksUpdated = 0; RenderChunk.renderChunksUpdated = 0;
this.debugUpdateTime += 1000L; this.debugUpdateTime += 1000L;
this.fpsCounter = 0; this.fpsCounter = 0;
@ -863,7 +828,6 @@ public class Minecraft implements IThreadListener {
this.resize(this.displayWidth, this.displayHeight); this.resize(this.displayWidth, this.displayHeight);
} }
} }
} }
public int getLimitFramerate() { public int getLimitFramerate() {
@ -878,9 +842,7 @@ public class Minecraft implements IThreadListener {
try { try {
System.gc(); System.gc();
this.loadWorld((WorldClient) null); this.loadWorld((WorldClient) null);
} catch (Throwable var2) { } catch (Throwable var2) {}
;
}
System.gc(); System.gc();
} }
@ -902,17 +864,14 @@ public class Minecraft implements IThreadListener {
} }
} else { } else {
--keyCount; --keyCount;
if (keyCount < list.size() if (keyCount < list.size() && !((Profiler.Result) list.get(keyCount)).field_76331_c.equals("unspecified")) {
&& !((Profiler.Result) list.get(keyCount)).field_76331_c.equals("unspecified")) {
if (this.debugProfilerName.length() > 0) { if (this.debugProfilerName.length() > 0) {
this.debugProfilerName = this.debugProfilerName + "."; this.debugProfilerName = this.debugProfilerName + ".";
} }
this.debugProfilerName = this.debugProfilerName this.debugProfilerName = this.debugProfilerName + ((Profiler.Result) list.get(keyCount)).field_76331_c;
+ ((Profiler.Result) list.get(keyCount)).field_76331_c;
} }
} }
} }
} }
@ -940,14 +899,10 @@ public class Minecraft implements IThreadListener {
int j = this.displayHeight - short1 * 2; int j = this.displayHeight - short1 * 2;
GlStateManager.enableBlend(); GlStateManager.enableBlend();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
worldrenderer.pos((double) ((float) i - (float) short1 * 1.1F), 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();
(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) worldrenderer.pos((double) ((float) i + (float) short1 * 1.1F), (double) (j + short1 * 2), 0.0D).color(0, 0, 0, 100).endVertex();
.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();
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(); tessellator.draw();
GlStateManager.disableBlend(); GlStateManager.disableBlend();
double d0 = 0.0D; double d0 = 0.0D;
@ -963,26 +918,21 @@ public class Minecraft implements IThreadListener {
worldrenderer.pos((double) i, (double) j, 0.0D).color(j1, k1, l1, 255).endVertex(); worldrenderer.pos((double) i, (double) j, 0.0D).color(j1, k1, l1, 255).endVertex();
for (int i2 = l; i2 >= 0; --i2) { for (int i2 = l; i2 >= 0; --i2) {
float f = (float) ((d0 + profiler$result1.field_76332_a * (double) i2 / (double) l) float f = (float) ((d0 + profiler$result1.field_76332_a * (double) i2 / (double) l) * 3.141 * 2.0D / 100.0D);
* 3.141 * 2.0D / 100.0D);
float f1 = MathHelper.sin(f) * (float) short1; float f1 = MathHelper.sin(f) * (float) short1;
float f2 = MathHelper.cos(f) * (float) short1 * 0.5F; 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) worldrenderer.pos((double) ((float) i + f1), (double) ((float) j - f2), 0.0D).color(j1, k1, l1, 255).endVertex();
.endVertex();
} }
tessellator.draw(); tessellator.draw();
worldrenderer.begin(5, DefaultVertexFormats.POSITION_COLOR); worldrenderer.begin(5, DefaultVertexFormats.POSITION_COLOR);
for (int l2 = l; l2 >= 0; --l2) { for (int l2 = l; l2 >= 0; --l2) {
float f3 = (float) ((d0 + profiler$result1.field_76332_a * (double) l2 / (double) l) float f3 = (float) ((d0 + profiler$result1.field_76332_a * (double) l2 / (double) l) * 3.141 * 2.0D / 100.0D);
* 3.141 * 2.0D / 100.0D);
float f4 = MathHelper.sin(f3) * (float) short1; float f4 = MathHelper.sin(f3) * (float) short1;
float f5 = MathHelper.cos(f3) * (float) short1 * 0.5F; float f5 = MathHelper.cos(f3) * (float) short1 * 0.5F;
worldrenderer.pos((double) ((float) i + f4), (double) ((float) j - f5), 0.0D) worldrenderer.pos((double) ((float) i + f4), (double) ((float) j - f5), 0.0D).color(j1 >> 1, k1 >> 1, l1 >> 1, 255).endVertex();
.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();
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(); tessellator.draw();
@ -1004,8 +954,7 @@ public class Minecraft implements IThreadListener {
int k2 = 16777215; int k2 = 16777215;
this.fontRendererObj.drawStringWithShadow(s, (float) (i - short1), (float) (j - short1 / 2 - 16), k2); this.fontRendererObj.drawStringWithShadow(s, (float) (i - short1), (float) (j - short1 / 2 - 16), k2);
this.fontRendererObj.drawStringWithShadow(s = decimalformat.format(profiler$result.field_76330_b) + "%", this.fontRendererObj.drawStringWithShadow(s = decimalformat.format(profiler$result.field_76330_b) + "%", (float) (i + short1 - this.fontRendererObj.getStringWidth(s)), (float) (j - short1 / 2 - 16), k2);
(float) (i + short1 - this.fontRendererObj.getStringWidth(s)), (float) (j - short1 / 2 - 16), k2);
for (int j2 = 0; j2 < list.size(); ++j2) { for (int j2 = 0; j2 < list.size(); ++j2) {
Profiler.Result profiler$result2 = (Profiler.Result) list.get(j2); Profiler.Result profiler$result2 = (Profiler.Result) list.get(j2);
@ -1017,18 +966,10 @@ public class Minecraft implements IThreadListener {
} }
s1 = s1 + profiler$result2.field_76331_c; s1 = s1 + profiler$result2.field_76331_c;
this.fontRendererObj.drawStringWithShadow(s1, (float) (i - short1), this.fontRendererObj.drawStringWithShadow(s1, (float) (i - short1), (float) (j + short1 / 2 + j2 * 8 + 20), profiler$result2.func_76329_a());
(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( 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());
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());
} }
} }
} }
@ -1083,15 +1024,12 @@ public class Minecraft implements IThreadListener {
} }
if (this.leftClickCounter <= 0 && !this.thePlayer.isUsingItem()) { if (this.leftClickCounter <= 0 && !this.thePlayer.isUsingItem()) {
if (leftClick && this.objectMouseOver != null if (leftClick && this.objectMouseOver != null && this.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
&& this.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
BlockPos blockpos = this.objectMouseOver.getBlockPos(); BlockPos blockpos = this.objectMouseOver.getBlockPos();
if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air && this.playerController.onPlayerDamageBlock(blockpos, this.objectMouseOver.sideHit)) {
&& this.playerController.onPlayerDamageBlock(blockpos, this.objectMouseOver.sideHit)) {
this.effectRenderer.addBlockHitEffects(blockpos, this.objectMouseOver.sideHit); this.effectRenderer.addBlockHitEffects(blockpos, this.objectMouseOver.sideHit);
this.thePlayer.swingItem(); this.thePlayer.swingItem();
} }
} else { } else {
this.playerController.resetBlockRemoving(); this.playerController.resetBlockRemoving();
} }
@ -1106,7 +1044,6 @@ public class Minecraft implements IThreadListener {
if (this.playerController.isNotCreative()) { if (this.playerController.isNotCreative()) {
this.leftClickCounter = 10; this.leftClickCounter = 10;
} }
} else { } else {
switch (this.objectMouseOver.typeOfHit) { switch (this.objectMouseOver.typeOfHit) {
case ENTITY: case ENTITY:
@ -1124,7 +1061,6 @@ public class Minecraft implements IThreadListener {
this.leftClickCounter = 10; this.leftClickCounter = 10;
} }
} }
} }
} }
} }
@ -1142,11 +1078,9 @@ public class Minecraft implements IThreadListener {
} else { } else {
switch (this.objectMouseOver.typeOfHit) { switch (this.objectMouseOver.typeOfHit) {
case ENTITY: case ENTITY:
if (this.playerController.func_178894_a(this.thePlayer, this.objectMouseOver.entityHit, if (this.playerController.func_178894_a(this.thePlayer, this.objectMouseOver.entityHit, this.objectMouseOver)) {
this.objectMouseOver)) {
flag = false; flag = false;
} else if (this.playerController.interactWithEntitySendPacket(this.thePlayer, } else if (this.playerController.interactWithEntitySendPacket(this.thePlayer, this.objectMouseOver.entityHit)) {
this.objectMouseOver.entityHit)) {
flag = false; flag = false;
} }
break; break;
@ -1154,8 +1088,7 @@ public class Minecraft implements IThreadListener {
BlockPos blockpos = this.objectMouseOver.getBlockPos(); BlockPos blockpos = this.objectMouseOver.getBlockPos();
if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air) { if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air) {
int i = itemstack != null ? itemstack.stackSize : 0; int i = itemstack != null ? itemstack.stackSize : 0;
if (this.playerController.onPlayerRightClick(this.thePlayer, this.theWorld, itemstack, blockpos, if (this.playerController.onPlayerRightClick(this.thePlayer, this.theWorld, itemstack, blockpos, this.objectMouseOver.sideHit, this.objectMouseOver.hitVec)) {
this.objectMouseOver.sideHit, this.objectMouseOver.hitVec)) {
flag = false; flag = false;
this.thePlayer.swingItem(); this.thePlayer.swingItem();
} }
@ -1175,12 +1108,10 @@ public class Minecraft implements IThreadListener {
if (flag) { if (flag) {
ItemStack itemstack1 = this.thePlayer.inventory.getCurrentItem(); ItemStack itemstack1 = this.thePlayer.inventory.getCurrentItem();
if (itemstack1 != null if (itemstack1 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, itemstack1)) {
&& this.playerController.sendUseItem(this.thePlayer, this.theWorld, itemstack1)) {
this.entityRenderer.itemRenderer.resetEquippedProgress2(); this.entityRenderer.itemRenderer.resetEquippedProgress2();
} }
} }
} }
} }
@ -1248,8 +1179,7 @@ public class Minecraft implements IThreadListener {
this.displayInGameMenu(); this.displayInGameMenu();
} }
} }
} else if (this.currentScreen != null && this.currentScreen instanceof GuiSleepMP } else if (this.currentScreen != null && this.currentScreen instanceof GuiSleepMP && !this.thePlayer.isPlayerSleeping()) {
&& !this.thePlayer.isPlayerSleeping()) {
this.displayGuiScreen((GuiScreen) null); this.displayGuiScreen((GuiScreen) null);
} }
@ -1268,11 +1198,14 @@ public class Minecraft implements IThreadListener {
} catch (Throwable throwable1) { } catch (Throwable throwable1) {
CrashReport crashreport = CrashReport.makeCrashReport(throwable1, "Updating screen events"); CrashReport crashreport = CrashReport.makeCrashReport(throwable1, "Updating screen events");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Affected screen"); CrashReportCategory crashreportcategory = crashreport.makeCategory("Affected screen");
crashreportcategory.addCrashSectionCallable("Screen name", new Callable<String>() { crashreportcategory.addCrashSectionCallable(
"Screen name",
new Callable<String>() {
public String call() throws Exception { public String call() throws Exception {
return Minecraft.this.currentScreen.getClass().getName(); return Minecraft.this.currentScreen.getClass().getName();
} }
}); }
);
throw new ReportedException(crashreport); throw new ReportedException(crashreport);
} }
@ -1282,11 +1215,14 @@ public class Minecraft implements IThreadListener {
} catch (Throwable throwable) { } catch (Throwable throwable) {
CrashReport crashreport1 = CrashReport.makeCrashReport(throwable, "Ticking screen"); CrashReport crashreport1 = CrashReport.makeCrashReport(throwable, "Ticking screen");
CrashReportCategory crashreportcategory1 = crashreport1.makeCategory("Affected screen"); CrashReportCategory crashreportcategory1 = crashreport1.makeCategory("Affected screen");
crashreportcategory1.addCrashSectionCallable("Screen name", new Callable<String>() { crashreportcategory1.addCrashSectionCallable(
"Screen name",
new Callable<String>() {
public String call() throws Exception { public String call() throws Exception {
return Minecraft.this.currentScreen.getClass().getName(); return Minecraft.this.currentScreen.getClass().getName();
} }
}); }
);
throw new ReportedException(crashreport1); throw new ReportedException(crashreport1);
} }
} }
@ -1315,8 +1251,7 @@ public class Minecraft implements IThreadListener {
if (this.ingameGUI.getSpectatorGui().func_175262_a()) { if (this.ingameGUI.getSpectatorGui().func_175262_a()) {
this.ingameGUI.getSpectatorGui().func_175259_b(-j); this.ingameGUI.getSpectatorGui().func_175259_b(-j);
} else { } else {
float f = MathHelper.clamp_float( float f = MathHelper.clamp_float(this.thePlayer.capabilities.getFlySpeed() + (float) j * 0.005F, 0.0F, 0.2F);
this.thePlayer.capabilities.getFlySpeed() + (float) j * 0.005F, 0.0F, 0.2F);
this.thePlayer.capabilities.setFlySpeed(f); this.thePlayer.capabilities.setFlySpeed(f);
} }
} else { } else {
@ -1400,33 +1335,22 @@ public class Minecraft implements IThreadListener {
this.refreshResources(); this.refreshResources();
} }
if (k == 17 && Keyboard.isKeyDown(61)) { if (k == 17 && Keyboard.isKeyDown(61)) {}
;
}
if (k == 18 && Keyboard.isKeyDown(61)) { if (k == 18 && Keyboard.isKeyDown(61)) {}
;
}
if (k == 47 && Keyboard.isKeyDown(61)) { if (k == 47 && Keyboard.isKeyDown(61)) {}
;
}
if (k == 38 && Keyboard.isKeyDown(61)) { if (k == 38 && Keyboard.isKeyDown(61)) {}
;
}
if (k == 22 && Keyboard.isKeyDown(61)) { if (k == 22 && Keyboard.isKeyDown(61)) {}
;
}
if (k == 20 && Keyboard.isKeyDown(61)) { if (k == 20 && Keyboard.isKeyDown(61)) {
this.refreshResources(); this.refreshResources();
} }
if (k == 33 && Keyboard.isKeyDown(61)) { if (k == 33 && Keyboard.isKeyDown(61)) {
this.gameSettings.setOptionValue(GameSettings.Options.RENDER_DISTANCE, this.gameSettings.setOptionValue(GameSettings.Options.RENDER_DISTANCE, GuiScreen.isShiftKeyDown() ? -1 : 1);
GuiScreen.isShiftKeyDown() ? -1 : 1);
} }
if (k == 30 && Keyboard.isKeyDown(61)) { if (k == 30 && Keyboard.isKeyDown(61)) {
@ -1508,8 +1432,7 @@ public class Minecraft implements IThreadListener {
if (this.playerController.isRidingHorse()) { if (this.playerController.isRidingHorse()) {
this.thePlayer.sendHorseInventory(); this.thePlayer.sendHorseInventory();
} else { } else {
this.getNetHandler().addToSendQueue( this.getNetHandler().addToSendQueue(new C16PacketClientStatus(C16PacketClientStatus.EnumState.OPEN_INVENTORY_ACHIEVEMENT));
new C16PacketClientStatus(C16PacketClientStatus.EnumState.OPEN_INVENTORY_ACHIEVEMENT));
this.displayGuiScreen(new GuiInventory(this.thePlayer)); this.displayGuiScreen(new GuiInventory(this.thePlayer));
} }
} }
@ -1533,17 +1456,11 @@ public class Minecraft implements IThreadListener {
this.playerController.onStoppedUsingItem(this.thePlayer); this.playerController.onStoppedUsingItem(this.thePlayer);
} }
while (this.gameSettings.keyBindAttack.isPressed()) { while (this.gameSettings.keyBindAttack.isPressed()) {}
;
}
while (this.gameSettings.keyBindUseItem.isPressed()) { while (this.gameSettings.keyBindUseItem.isPressed()) {}
;
}
while (this.gameSettings.keyBindPickBlock.isPressed()) { while (this.gameSettings.keyBindPickBlock.isPressed()) {}
;
}
} else { } else {
while (this.gameSettings.keyBindAttack.isPressed()) { while (this.gameSettings.keyBindAttack.isPressed()) {
this.clickMouse(); this.clickMouse();
@ -1558,13 +1475,11 @@ public class Minecraft implements IThreadListener {
} }
} }
if (this.gameSettings.keyBindUseItem.isKeyDown() && this.rightClickDelayTimer == 0 if (this.gameSettings.keyBindUseItem.isKeyDown() && this.rightClickDelayTimer == 0 && !this.thePlayer.isUsingItem()) {
&& !this.thePlayer.isUsingItem()) {
this.rightClickMouse(); this.rightClickMouse();
} }
this.sendClickBlockToController( this.sendClickBlockToController(this.currentScreen == null && this.gameSettings.keyBindAttack.isKeyDown() && this.inGameHasFocus);
this.currentScreen == null && this.gameSettings.keyBindAttack.isKeyDown() && this.inGameHasFocus);
} }
if (this.theWorld != null) { if (this.theWorld != null) {
@ -1624,8 +1539,7 @@ public class Minecraft implements IThreadListener {
this.mcProfiler.endStartSection("animateTick"); this.mcProfiler.endStartSection("animateTick");
if (!this.isGamePaused && this.theWorld != null) { if (!this.isGamePaused && this.theWorld != null) {
this.theWorld.doVoidFogParticles(MathHelper.floor_double(this.thePlayer.posX), this.theWorld.doVoidFogParticles(MathHelper.floor_double(this.thePlayer.posX), MathHelper.floor_double(this.thePlayer.posY), MathHelper.floor_double(this.thePlayer.posZ));
MathHelper.floor_double(this.thePlayer.posY), MathHelper.floor_double(this.thePlayer.posZ));
} }
this.mcProfiler.endStartSection("particles"); this.mcProfiler.endStartSection("particles");
@ -1749,7 +1663,6 @@ public class Minecraft implements IThreadListener {
if (this.currentScreen instanceof GuiGameOver) { if (this.currentScreen instanceof GuiGameOver) {
this.displayGuiScreen((GuiScreen) null); this.displayGuiScreen((GuiScreen) null);
} }
} }
/**+ /**+
@ -1805,14 +1718,11 @@ public class Minecraft implements IThreadListener {
tileentity = this.theWorld.getTileEntity(blockpos); tileentity = this.theWorld.getTileEntity(blockpos);
} }
Block block1 = object instanceof ItemBlock && !block.isFlowerPot() Block block1 = object instanceof ItemBlock && !block.isFlowerPot() ? Block.getBlockFromItem((Item) object) : block;
? Block.getBlockFromItem((Item) object)
: block;
i = block1.getDamageValue(this.theWorld, blockpos); i = block1.getDamageValue(this.theWorld, blockpos);
flag1 = ((Item) object).getHasSubtypes(); flag1 = ((Item) object).getHasSubtypes();
} else { } else {
if (this.objectMouseOver.typeOfHit != MovingObjectPosition.MovingObjectType.ENTITY if (this.objectMouseOver.typeOfHit != MovingObjectPosition.MovingObjectType.ENTITY || this.objectMouseOver.entityHit == null || !flag) {
|| this.objectMouseOver.entityHit == null || !flag) {
return; return;
} }
@ -1877,7 +1787,6 @@ public class Minecraft implements IThreadListener {
int j = this.thePlayer.inventoryContainer.inventorySlots.size() - 9 + inventoryplayer.currentItem; int j = this.thePlayer.inventoryContainer.inventorySlots.size() - 9 + inventoryplayer.currentItem;
this.playerController.sendSlotPacket(inventoryplayer.getStackInSlot(inventoryplayer.currentItem), j); this.playerController.sendSlotPacket(inventoryplayer.getStackInSlot(inventoryplayer.currentItem), j);
} }
} }
} }
@ -1907,33 +1816,61 @@ public class Minecraft implements IThreadListener {
* type), and the worldInfo to the crash report * type), and the worldInfo to the crash report
*/ */
public CrashReport addGraphicsAndWorldToCrashReport(CrashReport theCrash) { public CrashReport addGraphicsAndWorldToCrashReport(CrashReport theCrash) {
theCrash.getCategory().addCrashSectionCallable("Launched Version", new Callable<String>() { theCrash
.getCategory()
.addCrashSectionCallable(
"Launched Version",
new Callable<String>() {
public String call() throws Exception { public String call() throws Exception {
return Minecraft.this.launchedVersion; return Minecraft.this.launchedVersion;
} }
}); }
theCrash.getCategory().addCrashSectionCallable("LWJGL", new Callable<String>() { );
theCrash
.getCategory()
.addCrashSectionCallable(
"LWJGL",
new Callable<String>() {
public String call() { public String call() {
return EagRuntime.getVersion(); return EagRuntime.getVersion();
} }
});
theCrash.getCategory().addCrashSectionCallable("OpenGL", new Callable<String>() {
public String call() {
return EaglercraftGPU.glGetString(7937) + " GL version " + EaglercraftGPU.glGetString(7938) + ", "
+ EaglercraftGPU.glGetString(7936);
} }
}); );
theCrash.getCategory().addCrashSectionCallable("Is Modded", new Callable<String>() { theCrash
.getCategory()
.addCrashSectionCallable(
"OpenGL",
new Callable<String>() {
public String call() {
return EaglercraftGPU.glGetString(7937) + " GL version " + EaglercraftGPU.glGetString(7938) + ", " + EaglercraftGPU.glGetString(7936);
}
}
);
theCrash
.getCategory()
.addCrashSectionCallable(
"Is Modded",
new Callable<String>() {
public String call() throws Exception { public String call() throws Exception {
return "Definitely Not; You're an eagler"; return "Definitely Not; You're an eagler";
} }
}); }
theCrash.getCategory().addCrashSectionCallable("Type", new Callable<String>() { );
theCrash
.getCategory()
.addCrashSectionCallable(
"Type",
new Callable<String>() {
public String call() throws Exception { public String call() throws Exception {
return "Client (map_client.txt)"; return "Client (map_client.txt)";
} }
}); }
theCrash.getCategory().addCrashSectionCallable("Resource Packs", new Callable<String>() { );
theCrash
.getCategory()
.addCrashSectionCallable(
"Resource Packs",
new Callable<String>() {
public String call() throws Exception { public String call() throws Exception {
StringBuilder stringbuilder = new StringBuilder(); StringBuilder stringbuilder = new StringBuilder();
@ -1950,18 +1887,28 @@ public class Minecraft implements IThreadListener {
return stringbuilder.toString(); return stringbuilder.toString();
} }
}); }
theCrash.getCategory().addCrashSectionCallable("Current Language", new Callable<String>() { );
theCrash
.getCategory()
.addCrashSectionCallable(
"Current Language",
new Callable<String>() {
public String call() throws Exception { public String call() throws Exception {
return Minecraft.this.mcLanguageManager.getCurrentLanguage().toString(); return Minecraft.this.mcLanguageManager.getCurrentLanguage().toString();
} }
});
theCrash.getCategory().addCrashSectionCallable("Profiler Position", new Callable<String>() {
public String call() throws Exception {
return Minecraft.this.mcProfiler.profilingEnabled ? Minecraft.this.mcProfiler.getNameOfLastSection()
: "N/A (disabled)";
} }
}); );
theCrash
.getCategory()
.addCrashSectionCallable(
"Profiler Position",
new Callable<String>() {
public String call() throws Exception {
return Minecraft.this.mcProfiler.profilingEnabled ? Minecraft.this.mcProfiler.getNameOfLastSection() : "N/A (disabled)";
}
}
);
if (this.theWorld != null) { if (this.theWorld != null) {
this.theWorld.addWorldInfoToCrashReport(theCrash); this.theWorld.addWorldInfoToCrashReport(theCrash);
} }
@ -1977,13 +1924,14 @@ public class Minecraft implements IThreadListener {
} }
public ListenableFuture<Object> scheduleResourcesRefresh() { public ListenableFuture<Object> scheduleResourcesRefresh() {
return this.addScheduledTask(new Runnable() { return this.addScheduledTask(
new Runnable() {
public void run() { public void run() {
Minecraft.this.loadingScreen.eaglerShow(I18n.format("resourcePack.load.refreshing"), Minecraft.this.loadingScreen.eaglerShow(I18n.format("resourcePack.load.refreshing"), I18n.format("resourcePack.load.pleaseWait"));
I18n.format("resourcePack.load.pleaseWait"));
Minecraft.this.refreshResources(); Minecraft.this.refreshResources();
} }
}); }
);
} }
private String func_181538_aA() { private String func_181538_aA() {
@ -2020,9 +1968,7 @@ public class Minecraft implements IThreadListener {
return false; return false;
} }
public static void stopIntegratedServer() { public static void stopIntegratedServer() {}
}
/**+ /**+
* Gets the system time in milliseconds. * Gets the system time in milliseconds.
@ -2075,22 +2021,19 @@ public class Minecraft implements IThreadListener {
} }
public MusicTicker.MusicType getAmbientMusicType() { public MusicTicker.MusicType getAmbientMusicType() {
return this.thePlayer != null ? (this.thePlayer.worldObj.provider instanceof WorldProviderHell return this.thePlayer != null
? (
this.thePlayer.worldObj.provider instanceof WorldProviderHell
? MusicTicker.MusicType.NETHER ? MusicTicker.MusicType.NETHER
: (this.thePlayer.worldObj.provider instanceof WorldProviderEnd : (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))
? (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; : MusicTicker.MusicType.MENU;
} }
public void dispatchKeypresses() { public void dispatchKeypresses() {
int i = Keyboard.getEventKey() == 0 ? Keyboard.getEventCharacter() : Keyboard.getEventKey(); int i = Keyboard.getEventKey() == 0 ? Keyboard.getEventCharacter() : Keyboard.getEventKey();
if (i != 0 && !Keyboard.isRepeatEvent()) { if (i != 0 && !Keyboard.isRepeatEvent()) {
if (!(this.currentScreen instanceof GuiControls) if (!(this.currentScreen instanceof GuiControls) || ((GuiControls) this.currentScreen).time <= getSystemTime() - 20L) {
|| ((GuiControls) this.currentScreen).time <= getSystemTime() - 20L) {
if (Keyboard.getEventKeyState()) { if (Keyboard.getEventKeyState()) {
if (i == this.gameSettings.keyBindScreenshot.getKeyCode()) { if (i == this.gameSettings.keyBindScreenshot.getKeyCode()) {
this.ingameGUI.getChatGUI().printChatMessage(ScreenShotHelper.saveScreenshot()); this.ingameGUI.getChatGUI().printChatMessage(ScreenShotHelper.saveScreenshot());

View File

@ -82,15 +82,13 @@ public class GuiButton extends Gui {
FontRenderer fontrenderer = mc.fontRendererObj; FontRenderer fontrenderer = mc.fontRendererObj;
mc.getTextureManager().bindTexture(buttonTextures); mc.getTextureManager().bindTexture(buttonTextures);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
&& mouseY < this.yPosition + this.height;
int i = this.getHoverState(this.hovered); int i = this.getHoverState(this.hovered);
GlStateManager.enableBlend(); GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(RealOpenGLEnums.GL_SRC_ALPHA, RealOpenGLEnums.GL_ONE_MINUS_SRC_ALPHA, 1, 0); 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); 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.yPosition, 0, 46 + i * 20, this.width / 2, this.height);
this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + i * 20, this.width / 2, this.height);
46 + i * 20, this.width / 2, this.height);
this.mouseDragged(mc, mouseX, mouseY); this.mouseDragged(mc, mouseX, mouseY);
int j = 14737632; int j = 14737632;
if (!this.enabled) { if (!this.enabled) {
@ -103,7 +101,6 @@ public class GuiButton extends Gui {
} }
} }
/**+ /**+
* Fired when the mouse button is dragged. Equivalent of * Fired when the mouse button is dragged. Equivalent of
* MouseListener.mouseDragged(MouseEvent e). * MouseListener.mouseDragged(MouseEvent e).

View File

@ -1,10 +1,8 @@
package net.minecraft.client.gui; package net.minecraft.client.gui;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import dev.resent.util.misc.GlUtils; import dev.resent.util.misc.GlUtils;
import dev.resent.visual.ui.animation.SimpleAnimation; import dev.resent.visual.ui.animation.SimpleAnimation;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
import net.lax1dude.eaglercraft.v1_8.Keyboard; import net.lax1dude.eaglercraft.v1_8.Keyboard;
@ -284,8 +282,7 @@ public class GuiChat extends GuiScreen {
GlUtils.startTranslate(0, 29 - (int) animation.getValue()); GlUtils.startTranslate(0, 29 - (int) animation.getValue());
drawRect(2, this.height - 14, this.width - 2, this.height - 2, Integer.MIN_VALUE); drawRect(2, this.height - 14, this.width - 2, this.height - 2, Integer.MIN_VALUE);
this.inputField.drawTextBox(); this.inputField.drawTextBox();
if (this.inputField.isTypingPassword) if (this.inputField.isTypingPassword) this.mc.fontRendererObj.drawStringWithShadow("Password Hidden", 2, this.height - 25, 16770425);
this.mc.fontRendererObj.drawStringWithShadow("Password Hidden", 2, this.height - 25, 16770425);
GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
IChatComponent ichatcomponent = this.mc.ingameGUI.getChatGUI().getChatComponent(Mouse.getX(), Mouse.getY()); IChatComponent ichatcomponent = this.mc.ingameGUI.getChatGUI().getChatComponent(Mouse.getX(), Mouse.getY());

View File

@ -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_ONE_MINUS_SRC_COLOR;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_SRC_ALPHA; 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.base.Predicate;
import com.google.common.collect.Iterables; import com.google.common.collect.Iterables;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import dev.resent.client.Resent; import dev.resent.client.Resent;
import dev.resent.module.base.RenderMod; import dev.resent.module.base.RenderMod;
import dev.resent.util.misc.W; import dev.resent.util.misc.W;
import dev.resent.visual.crosshair.CrosshairManager; import dev.resent.visual.crosshair.CrosshairManager;
import dev.resent.visual.ui.animation.SimpleAnimation; 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.EaglercraftRandom;
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerTextureAtlasSprite; import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerTextureAtlasSprite;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
@ -303,7 +301,10 @@ public class GuiIngame extends Gui {
this.overlayPlayerList.renderPlayerlist(i, scoreboard, scoreobjective1); this.overlayPlayerList.renderPlayerlist(i, scoreboard, scoreobjective1);
} }
Resent.INSTANCE.modManager.modules.stream().filter(m -> m.isEnabled() && m instanceof RenderMod).forEach(m -> { Resent.INSTANCE.modManager.modules
.stream()
.filter(m -> m.isEnabled() && m instanceof RenderMod)
.forEach(m -> {
if (!Minecraft.getMinecraft().gameSettings.showDebugInfo && m.getName() != "CPS") { if (!Minecraft.getMinecraft().gameSettings.showDebugInfo && m.getName() != "CPS") {
((RenderMod) m).draw(); ((RenderMod) m).draw();
} }
@ -319,8 +320,7 @@ public class GuiIngame extends Gui {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
if (CrosshairManager.crosshairLocation == null) { if (CrosshairManager.crosshairLocation == null) {
if(CrosshairManager.read() != null) if (CrosshairManager.read() != null) CrosshairManager.forceLoad(CrosshairManager.read());
CrosshairManager.forceLoad(CrosshairManager.read());
this.mc.getTextureManager().bindTexture(icons); this.mc.getTextureManager().bindTexture(icons);
} }
@ -343,8 +343,7 @@ public class GuiIngame extends Gui {
float f = this.zLevel; float f = this.zLevel;
this.zLevel = -90.0F; this.zLevel = -90.0F;
this.drawTexturedModalRect(i - 91, sr.getScaledHeight() - 22, 0, 0, 182, 22); this.drawTexturedModalRect(i - 91, sr.getScaledHeight() - 22, 0, 0, 182, 22);
this.drawTexturedModalRect(i - 91 - 1 + entityplayer.inventory.currentItem * 20, this.drawTexturedModalRect(i - 91 - 1 + entityplayer.inventory.currentItem * 20, sr.getScaledHeight() - 22 - 1, 0, 22, 24, 22);
sr.getScaledHeight() - 22 - 1, 0, 22, 24, 22);
this.zLevel = f; this.zLevel = f;
GlStateManager.enableRescaleNormal(); GlStateManager.enableRescaleNormal();
GlStateManager.enableBlend(); GlStateManager.enableBlend();

View File

@ -563,7 +563,6 @@ public abstract class GuiScreen extends Gui implements GuiYesNoCallback {
return (mouseX >= x && mouseX <= width) && (mouseY >= y && mouseY <= height); return (mouseX >= x && mouseX <= width) && (mouseY >= y && mouseY <= height);
} }
/**+ /**+
* Returns true if either windows ctrl key is down or if either * Returns true if either windows ctrl key is down or if either
* mac meta key is down * mac meta key is down

View File

@ -453,10 +453,7 @@ public class GuiTextField extends Gui {
k = s.length(); k = s.length();
} }
if (s.length() > 0) { if (s.length() > 0) {
String s1 = flag ? s.substring(0, j) : s; String s1 = flag ? s.substring(0, j) : s;
String s2 = s1; String s2 = s1;
@ -486,16 +483,10 @@ public class GuiTextField extends Gui {
s2 += "*"; s2 += "*";
} }
} }
} else {
}
else {
isTypingPassword = false; isTypingPassword = false;
} }
j1 = this.fontRendererInstance.drawStringWithShadow(s2, (float) l, (float) i1, i); j1 = this.fontRendererInstance.drawStringWithShadow(s2, (float) l, (float) i1, i);
} }

View File

@ -2,11 +2,9 @@ package net.minecraft.client.model;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_COMPILE; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_COMPILE;
import java.util.List;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import dev.resent.module.base.ModManager; 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.EaglercraftGPU;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer; import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
@ -142,7 +140,6 @@ public class ModelRenderer {
private boolean compiledState; private boolean compiledState;
public void render(float parFloat1) { public void render(float parFloat1) {
boolean batchRendering = ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.batchRendering.getValue(); boolean batchRendering = ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.batchRendering.getValue();
if (compiledState != batchRendering) { if (compiledState != batchRendering) {

View File

@ -75,7 +75,6 @@ public class TexturedQuad {
f2 = -f2; f2 = -f2;
} }
boolean batchRendering = ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.batchRendering.getValue(); boolean batchRendering = ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.batchRendering.getValue();
this.drawOnSelf = !renderer.isDrawing; this.drawOnSelf = !renderer.isDrawing;
if (this.drawOnSelf || !batchRendering) { if (this.drawOnSelf || !batchRendering) {

View File

@ -287,18 +287,15 @@ public class PlayerControllerMP {
try { try {
this.netClientHandler.getNetworkManager().processReceivedPackets(); this.netClientHandler.getNetworkManager().processReceivedPackets();
} catch (IOException ex) { } catch (IOException ex) {
EaglercraftNetworkManager.logger EaglercraftNetworkManager.logger.fatal("Unhandled IOException was thrown " + "while processing multiplayer packets!");
.fatal("Unhandled IOException was thrown " + "while processing multiplayer packets!");
EaglercraftNetworkManager.logger.fatal(ex); EaglercraftNetworkManager.logger.fatal(ex);
EaglercraftNetworkManager.logger.fatal("Disconnecting..."); EaglercraftNetworkManager.logger.fatal("Disconnecting...");
this.netClientHandler.getNetworkManager() this.netClientHandler.getNetworkManager().closeChannel(new ChatComponentText("Exception thrown: " + ex.toString()));
.closeChannel(new ChatComponentText("Exception thrown: " + ex.toString()));
} }
this.netClientHandler.getSkinCache().flush(); this.netClientHandler.getSkinCache().flush();
} else { } else {
this.netClientHandler.getNetworkManager().checkDisconnected(); this.netClientHandler.getNetworkManager().checkDisconnected();
} }
} }
private boolean isHittingPosition(BlockPos pos) { private boolean isHittingPosition(BlockPos pos) {

View File

@ -1,9 +1,7 @@
package net.minecraft.client.multiplayer; package net.minecraft.client.multiplayer;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import dev.resent.module.base.ModManager; import dev.resent.module.base.ModManager;
import java.util.Set; import java.util.Set;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;

View File

@ -4,9 +4,7 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import dev.resent.module.base.ModManager; import dev.resent.module.base.ModManager;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -359,8 +357,7 @@ public class EffectRenderer {
} }
public void addBlockDestroyEffects(BlockPos pos, IBlockState state) { public void addBlockDestroyEffects(BlockPos pos, IBlockState state) {
if(ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.blockEffects.getValue()) if (ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.blockEffects.getValue()) return;
return;
if (state.getBlock().getMaterial() != Material.air) { if (state.getBlock().getMaterial() != Material.air) {
state = state.getBlock().getActualState(state, this.worldObj, pos); state = state.getBlock().getActualState(state, this.worldObj, pos);
@ -383,8 +380,7 @@ public class EffectRenderer {
* Adds block hit particles for the specified block * Adds block hit particles for the specified block
*/ */
public void addBlockHitEffects(BlockPos pos, EnumFacing side) { public void addBlockHitEffects(BlockPos pos, EnumFacing side) {
if(ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.blockEffects.getValue()) if (ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.blockEffects.getValue()) return;
return;
IBlockState iblockstate = this.worldObj.getBlockState(pos); IBlockState iblockstate = this.worldObj.getBlockState(pos);
Block block = iblockstate.getBlock(); Block block = iblockstate.getBlock();

View File

@ -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.Predicate;
import com.google.common.base.Predicates; import com.google.common.base.Predicates;
import dev.resent.client.Resent; import dev.resent.client.Resent;
import dev.resent.module.base.ModManager; import dev.resent.module.base.ModManager;
import dev.resent.module.base.RenderMod; import dev.resent.module.base.RenderMod;
@ -660,13 +659,11 @@ public class EntityRenderer implements IResourceManagerReloadListener {
} }
public void enableLightmap() { public void enableLightmap() {
if(ModManager.fpsOptions.lightUpdates.getValue() || ModManager.fullbright.isEnabled()) if (ModManager.fpsOptions.lightUpdates.getValue() || ModManager.fullbright.isEnabled()) return;
return;
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit); GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.enableTexture2D(); GlStateManager.enableTexture2D();
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit); GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
} }
/**+ /**+

View File

@ -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_ONE_MINUS_SRC_ALPHA;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_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 com.google.common.collect.Lists;
import dev.resent.module.base.ModManager; 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.internal.buffer.FloatBuffer;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger; import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
@ -404,8 +402,7 @@ public abstract class RendererLivingEntity<T extends EntityLivingBase> extends R
} }
} }
if(Minecraft.isGuiEnabled() && !entitylivingbase.isInvisibleToPlayer(Minecraft.getMinecraft().thePlayer) || ModManager.selfNametag.isEnabled()) if (Minecraft.isGuiEnabled() && !entitylivingbase.isInvisibleToPlayer(Minecraft.getMinecraft().thePlayer) || ModManager.selfNametag.isEnabled()) return true;
return true;
return Minecraft.isGuiEnabled() && entitylivingbase != this.renderManager.livingPlayer && !entitylivingbase.isInvisibleToPlayer(Minecraft.getMinecraft().thePlayer) && entitylivingbase.riddenByEntity == null; return Minecraft.isGuiEnabled() && entitylivingbase != this.renderManager.livingPlayer && !entitylivingbase.isInvisibleToPlayer(Minecraft.getMinecraft().thePlayer) && entitylivingbase.riddenByEntity == null;
} }

View File

@ -39,8 +39,7 @@ public class LayerCape implements LayerRenderer<AbstractClientPlayer> {
if (abstractclientplayer.hasPlayerInfo() && !abstractclientplayer.isInvisible() && this.playerRenderer.getMainModel() instanceof ModelPlayer && ModManager.cape.isEnabled() && CapeManager.shouldRender(abstractclientplayer)) { 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); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
if (CapeManager.capeLocation == null) { if (CapeManager.capeLocation == null) {
if(CapeManager.read() != null) if (CapeManager.read() != null) CapeManager.forceLoad(CapeManager.read());
CapeManager.forceLoad(CapeManager.read());
this.playerRenderer.bindTexture(new ResourceLocation("eagler:gui/unnamed.png")); this.playerRenderer.bindTexture(new ResourceLocation("eagler:gui/unnamed.png"));
} else { } else {
this.playerRenderer.bindTexture(CapeManager.capeLocation); this.playerRenderer.bindTexture(CapeManager.capeLocation);

View File

@ -4,7 +4,6 @@ import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import dev.resent.client.Resent; import dev.resent.client.Resent;
import dev.resent.module.base.ModManager; import dev.resent.module.base.ModManager;
import java.io.BufferedReader; import java.io.BufferedReader;

View File

@ -802,8 +802,7 @@ public abstract class Entity {
* sprinting and not in water. * sprinting and not in water.
*/ */
public void spawnRunningParticles() { public void spawnRunningParticles() {
if(!this.onGround) if (!this.onGround) return;
return;
if (this.isSprinting() && !this.isInWater()) { if (this.isSprinting() && !this.isInWater()) {
this.createRunningParticles(); this.createRunningParticles();
} }

View File

@ -2,11 +2,9 @@ package net.minecraft.entity.player;
import com.google.common.base.Charsets; import com.google.common.base.Charsets;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import dev.resent.client.Resent; import dev.resent.client.Resent;
import dev.resent.module.base.ModManager; import dev.resent.module.base.ModManager;
import dev.resent.module.impl.misc.ParticleMultiplier; import dev.resent.module.impl.misc.ParticleMultiplier;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;

View File

@ -485,7 +485,6 @@ public class MathHelper {
} }
static { static {
for (int j = 0; j < 4096; ++j) { for (int j = 0; j < 4096; ++j) {
SIN_TABLE_FAST[j] = (float) Math.sin(((float) j + 0.5f) / 4096.0f * ((float) Math.PI * 2f)); SIN_TABLE_FAST[j] = (float) Math.sin(((float) j + 0.5f) / 4096.0f * ((float) Math.PI * 2f));
} }

View File

@ -3,7 +3,6 @@ package net.minecraft.world;
import com.google.common.base.Predicate; import com.google.common.base.Predicate;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import dev.resent.module.base.ModManager; import dev.resent.module.base.ModManager;
import dev.resent.util.misc.W; import dev.resent.util.misc.W;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -1,12 +1,34 @@
package net.lax1dude.eaglercraft.v1_8.internal; 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.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.function.Consumer; 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.Async;
import org.teavm.interop.AsyncCallback; import org.teavm.interop.AsyncCallback;
import org.teavm.jso.JSBody; 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.webaudio.MediaStream;
import org.teavm.jso.webgl.WebGLFramebuffer; 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. * Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
* *
@ -159,7 +156,6 @@ public class PlatformRuntime {
logger.info("Decompressing: {}", logURL); logger.info("Decompressing: {}", logURL);
try { try {
EPKLoader.loadEPK(epkFileData, epkFiles[i].path, PlatformAssets.assets); EPKLoader.loadEPK(epkFileData, epkFiles[i].path, PlatformAssets.assets);
} catch (Throwable t) { } catch (Throwable t) {
@ -173,7 +169,6 @@ public class PlatformRuntime {
logger.info("Initializing sound engine..."); logger.info("Initializing sound engine...");
enableScreen(); enableScreen();
PlatformInput.pressAnyKeyScreen(); PlatformInput.pressAnyKeyScreen();
@ -304,7 +299,10 @@ public class PlatformRuntime {
request.setResponseType("arraybuffer"); request.setResponseType("arraybuffer");
request.open("GET", assetPackageURI, true); request.open("GET", assetPackageURI, true);
TeaVMUtils.addEventListener(request, "load", new EventListener<Event>() { TeaVMUtils.addEventListener(
request,
"load",
new EventListener<Event>() {
@Override @Override
public void handleEvent(Event evt) { public void handleEvent(Event evt) {
int stat = request.getStatus(); int stat = request.getStatus();
@ -314,22 +312,26 @@ public class PlatformRuntime {
cb.complete(null); cb.complete(null);
} }
} }
}); }
);
TeaVMUtils.addEventListener(request, "progress", new EventListener<Event>() { TeaVMUtils.addEventListener(
request,
"progress",
new EventListener<Event>() {
@Override @Override
public void handleEvent(Event evt) { public void handleEvent(Event evt) {
try { try {
int epkSize = Integer.parseInt(request.getResponseHeader("content-length")); int epkSize = Integer.parseInt(request.getResponseHeader("content-length"));
Event event = evt; Event event = evt;
setBarProgress(event, epkSize); setBarProgress(event, epkSize);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
}); }
);
TeaVMUtils.addEventListener( TeaVMUtils.addEventListener(
request, request,
@ -611,8 +613,10 @@ public class PlatformRuntime {
mediaRec = null; mediaRec = null;
} }
} }
@JSBody(params = {}, script = "showMojang();") @JSBody(params = {}, script = "showMojang();")
public static native void showMojangScreen(); public static native void showMojangScreen();
@JSBody(params = {}, script = "die2();") @JSBody(params = {}, script = "die2();")
public static native void removeLoadScreen(); public static native void removeLoadScreen();
} }

View File

@ -1,5 +1,6 @@
package net.lax1dude.eaglercraft.v1_8.internal.teavm; package net.lax1dude.eaglercraft.v1_8.internal.teavm;
import dev.resent.client.ClientInfo;
import java.io.PrintStream; import java.io.PrintStream;
import net.lax1dude.eaglercraft.v1_8.EagRuntime; import net.lax1dude.eaglercraft.v1_8.EagRuntime;
import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion; 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.dom.html.HTMLElement;
import org.teavm.jso.webgl.WebGLRenderingContext; import org.teavm.jso.webgl.WebGLRenderingContext;
import dev.resent.client.ClientInfo;
/** /**
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved. * Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
* *