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

@ -130,7 +130,7 @@ public class PlatformAudio {
public void errorMessage(String parString1, String parString2, int parInt1) { public void errorMessage(String parString1, String parString2, int parInt1) {
if (!parString2.isEmpty()) { if (!parString2.isEmpty()) {
// stfu pls // stfu pls
//logger.error("Error in class \"{}\"!", parString1); //logger.error("Error in class \"{}\"!", parString1);
//logger.error(parString2); //logger.error(parString2);
} }

View File

@ -470,11 +470,11 @@ public class PlatformRuntime {
// //
} }
public static void showMojangScreen(){ public static void showMojangScreen() {
// //
} }
public static void removeLoadScreen(){ public static void removeLoadScreen() {
// //
} }
} }

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

@ -4,22 +4,22 @@ import dev.resent.util.render.Color;
public class ClientInfo { public class ClientInfo {
public static final String name = "Resent"; public static final String name = "Resent";
public static final String version = "3.6"; public static final String version = "3.6";
public static final String author = "Nitwit"; public static final String author = "Nitwit";
public static final String release = Release.STABLE.name; public static final String release = Release.STABLE.name;
public static final int primaryColor = new Color(66, 66, 66).getRGB(); public static final int primaryColor = new Color(66, 66, 66).getRGB();
public static final int secondaryColor = new Color(117, 117, 117).getRGB(); public static final int secondaryColor = new Color(117, 117, 117).getRGB();
public enum Release { public enum Release {
BETA("Beta"), BETA("Beta"),
STABLE("Stable"); STABLE("Stable");
String name; String name;
Release(String name) {
this.name = name;
}
}
Release(String 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 {
@ -29,9 +28,9 @@ public class SaveUtil {
if (s instanceof BooleanSetting) { if (s instanceof BooleanSetting) {
printwriter.println(m.getName() + "_boolsetting_" + s.name + ":" + ((BooleanSetting) s).getValue()); printwriter.println(m.getName() + "_boolsetting_" + s.name + ":" + ((BooleanSetting) s).getValue());
} }
if(s instanceof NumberSetting){ if (s instanceof NumberSetting) {
NumberSetting ss = ((NumberSetting)s); NumberSetting ss = ((NumberSetting) s);
printwriter.println(m.getName() + "_numsetting_" + s.name + ":" + String.valueOf(ss.getValue()).substring(0, (String.valueOf(ss.getValue()).length())-2)); printwriter.println(m.getName() + "_numsetting_" + s.name + ":" + String.valueOf(ss.getValue()).substring(0, (String.valueOf(ss.getValue()).length()) - 2));
} }
}); });
}); });
@ -73,13 +72,12 @@ public class SaveUtil {
((BooleanSetting) se).setValue(astring[1].equals("true")); ((BooleanSetting) se).setValue(astring[1].equals("true"));
} }
} }
if(se instanceof NumberSetting){ if (se instanceof NumberSetting) {
if(astring[0].equals(m.getName()+"_numsetting_"+se.name)){ if (astring[0].equals(m.getName() + "_numsetting_" + se.name)) {
((NumberSetting)se).value = Integer.parseInt(astring[1]); ((NumberSetting) se).value = Integer.parseInt(astring[1]);
} }
} }
}); });
}); });
} }
} }

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 {
@ -19,7 +18,7 @@ public abstract class Mod {
private boolean enabled; private boolean enabled;
private boolean hasSetting; private boolean hasSetting;
private boolean admin; private boolean admin;
public SimpleAnimation toggleAnimation = new SimpleAnimation(0); public SimpleAnimation toggleAnimation = new SimpleAnimation(0);
public List<Setting> settings = new ArrayList<>(); public List<Setting> settings = new ArrayList<>();
@ -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 Category getCategory() { return category; }
public void setDescription(String description) { this.description = description; } public boolean isAdmin() {
public void setName(String name) { this.name = name; } return admin;
public void setCategory(Category category) { this.category = category; } }
public void setHasSetting(boolean hasSetting) { this.hasSetting = hasSetting; }
public boolean doesHaveSetting() {
return hasSetting;
}
public String getName() {
return name;
}
public String getDescription() {
return description;
}
public Category getCategory() {
return category;
}
public void setDescription(String description) {
this.description = description;
}
public void setName(String name) {
this.name = name;
}
public void setCategory(Category category) {
this.category = category;
}
public void setHasSetting(boolean hasSetting) {
this.hasSetting = hasSetting;
}
} }

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 {
@ -79,13 +78,13 @@ public class ModManager {
public static ItemPhysics itemPhysics = new ItemPhysics(); public static ItemPhysics itemPhysics = new ItemPhysics();
public static FPSOptions fpsOptions = new FPSOptions(); public static FPSOptions fpsOptions = new FPSOptions();
public static AdminRay adminRay = new AdminRay(); public static AdminRay adminRay = new AdminRay();
public static AdminSpawner adminSpawner =new AdminSpawner(); public static AdminSpawner adminSpawner = new AdminSpawner();
public static ParticleMultiplier particleMultiplier = new ParticleMultiplier(); public static 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());
@ -129,9 +128,9 @@ public class ModManager {
} }
public ArrayList<Mod> modsInCategory(Category c) { public ArrayList<Mod> modsInCategory(Category c) {
if(c == null) { if (c == null) {
return (ArrayList<Mod>) modules; return (ArrayList<Mod>) modules;
} }
ArrayList<Mod> inCat = (ArrayList<Mod>) this.modules.stream().filter(m -> m.getCategory() == c).collect(Collectors.toList()); ArrayList<Mod> inCat = (ArrayList<Mod>) this.modules.stream().filter(m -> m.getCategory() == c).collect(Collectors.toList());

View File

@ -54,7 +54,7 @@ public abstract class RenderMod extends Mod {
Gui.drawRect(this.x, this.y, this.x + this.getWidth(), this.y + this.getHeight(), hovered ? 0x50FFFFFF : 0x40FFFFFF); Gui.drawRect(this.x, this.y, this.x + this.getWidth(), this.y + this.getHeight(), hovered ? 0x50FFFFFF : 0x40FFFFFF);
RenderUtils.drawRectOutline(this.x, this.y, this.x + this.getWidth(), this.y + this.getHeight(), -1); RenderUtils.drawRectOutline(this.x, this.y, this.x + this.getWidth(), this.y + this.getHeight(), -1);
mc.fontRendererObj.drawStringWithShadow(getName(), this.x, this.y - 10, new Color(255,255,255).getRGB()); mc.fontRendererObj.drawStringWithShadow(getName(), this.x, this.y - 10, new Color(255, 255, 255).getRGB());
final boolean mouseOverX = (mouseX >= this.getX() && mouseX <= this.getX() + this.getWidth()); final boolean mouseOverX = (mouseX >= this.getX() && mouseX <= this.getX() + this.getWidth());
final boolean mouseOverY = (mouseY >= this.getY() && mouseY <= this.getY() + this.getHeight()); final boolean mouseOverY = (mouseY >= this.getY() && mouseY <= this.getY() + this.getHeight());

View File

@ -1,9 +1,10 @@
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);
} }
public void onPress(){ } public void onPress() {}
} }

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

@ -41,7 +41,7 @@ public class NumberSetting extends Setting {
return value; return value;
} }
public float getInitialValue(){ public float getInitialValue() {
return initValue; return initValue;
} }

View File

@ -18,5 +18,5 @@ public class Setting {
this.gameSetting = gameSetting; this.gameSetting = gameSetting;
} }
public void draw(int x, int y){ } public void draw(int x, int y) {}
} }

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,27 +1,30 @@
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);
} }
public String getText(){ public String getText() {
return "[BPS: " + new DecimalFormat("0.##").format(getBPS()) + "]"; return "[BPS: " + new DecimalFormat("0.##").format(getBPS()) + "]";
} }
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

@ -8,14 +8,13 @@ import dev.resent.module.base.setting.ModeSetting;
import dev.resent.module.base.setting.NumberSetting; import dev.resent.module.base.setting.NumberSetting;
@Module(name = "ClickGUI", category = Category.HUD, hasSetting = true, description = "Customize Resent's UI") @Module(name = "ClickGUI", category = Category.HUD, hasSetting = true, description = "Customize Resent's UI")
public class ClickGui extends Mod{ public class ClickGui extends Mod {
public BooleanSetting scroll = new BooleanSetting("Smooth scroll", "", false); public BooleanSetting scroll = new BooleanSetting("Smooth scroll", "", false);
public ModeSetting guiTheme = new ModeSetting("Gui theme", "New", "New", "Classic revised"); public ModeSetting guiTheme = new ModeSetting("Gui theme", "New", "New", "Classic revised");
public NumberSetting test = new NumberSetting("Test, ignore!", "", 50, 1, 200, 5, 5); public NumberSetting test = new NumberSetting("Test, ignore!", "", 50, 1, 200, 5, 5);
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;
@ -19,18 +19,14 @@ public class Info extends RenderMod {
public BooleanSetting direction = new BooleanSetting("Direction", "", true); public BooleanSetting direction = new BooleanSetting("Direction", "", true);
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;
} }
public int getWidth() { public int getWidth() {
return 5 + mc.fontRendererObj.getStringWidth(" X: Biome:" + mc.theWorld.getBiomeGenForCoords(new BlockPos(getPositions()[0], getPositions()[1], getPositions()[2])).biomeName + Math.max(getPositions()[0], Math.max(getPositions()[1], getPositions()[2]))); return 5 + mc.fontRendererObj.getStringWidth(" X: Biome:" + mc.theWorld.getBiomeGenForCoords(new BlockPos(getPositions()[0], getPositions()[1], getPositions()[2])).biomeName + Math.max(getPositions()[0], Math.max(getPositions()[1], getPositions()[2])));
} }
public int getHeight() { public int getHeight() {
@ -46,9 +42,9 @@ public class Info extends RenderMod {
drawString(" Y: " + getPositions()[1], this.x + 5, this.y + 24); drawString(" Y: " + getPositions()[1], this.x + 5, this.y + 24);
drawString(" Z: " + getPositions()[2], this.x + 5, this.y + 34); drawString(" Z: " + getPositions()[2], this.x + 5, this.y + 34);
if (direction.getValue()){ if (direction.getValue()) {
drawString(" Dir: ", this.x + 5 + mc.fontRendererObj.getStringWidth(" X: " + getPositions()[0]), this.y + 14); drawString(" Dir: ", this.x + 5 + mc.fontRendererObj.getStringWidth(" X: " + getPositions()[0]), this.y + 14);
mc.fontRendererObj.drawString(directionsF[rot], this.x+5+mc.fontRendererObj.getStringWidth(" X: Dir: " + getPositions()[0]), this.y + 14, -1, Theme.getTextShadow()); mc.fontRendererObj.drawString(directionsF[rot], this.x + 5 + mc.fontRendererObj.getStringWidth(" X: Dir: " + getPositions()[0]), this.y + 14, -1, Theme.getTextShadow());
} }
drawString(" Biome: " + mc.theWorld.getBiomeGenForCoords(new BlockPos(getPositions()[0], getPositions()[1], getPositions()[2])).biomeName, this.x + 5, this.y + 44); drawString(" Biome: " + mc.theWorld.getBiomeGenForCoords(new BlockPos(getPositions()[0], getPositions()[1], getPositions()[2])).biomeName, this.x + 5, this.y + 44);
} }

View File

@ -6,11 +6,11 @@ import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.setting.NumberSetting; 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,104 +1,98 @@
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;
import net.minecraft.client.settings.KeyBinding; import net.minecraft.client.settings.KeyBinding;
@Module(name = "Ray", category = Category.MISC, hasSetting = true) @Module(name = "Ray", category = Category.MISC, hasSetting = true)
public class AdminRay extends Mod{ public class AdminRay extends Mod {
public static ArrayList<Block> rayBlocks = new ArrayList<>(); public static ArrayList<Block> rayBlocks = new ArrayList<>();
public static BooleanSetting iron = new BooleanSetting("Iron", "", false); public static BooleanSetting iron = new BooleanSetting("Iron", "", false);
public static BooleanSetting diamond = new BooleanSetting("Diamond", "", true); public static BooleanSetting diamond = new BooleanSetting("Diamond", "", true);
public static BooleanSetting gold = new BooleanSetting("Gold", "", false); public static BooleanSetting gold = new BooleanSetting("Gold", "", false);
public static BooleanSetting redstone = new BooleanSetting("Redstone", "", false); public static BooleanSetting redstone = new BooleanSetting("Redstone", "", false);
public static BooleanSetting lapis = new BooleanSetting("Lapis", "", false); public static BooleanSetting lapis = new BooleanSetting("Lapis", "", false);
public static BooleanSetting quartz = new BooleanSetting("Quartz", "", false); public static BooleanSetting quartz = new BooleanSetting("Quartz", "", false);
public static BooleanSetting water = new BooleanSetting("Water", "", false); public static BooleanSetting water = new BooleanSetting("Water", "", false);
public AdminRay(){ public AdminRay() {
addSetting(iron, diamond, gold, redstone, lapis, quartz, water); addSetting(iron, diamond, gold, redstone, lapis, quartz, water);
} }
@Override @Override
public boolean isAdmin(){ public boolean isAdmin() {
return true; return true;
} }
public static boolean shouldRender(Block block){ public static boolean shouldRender(Block block) {
return rayBlocks.contains(block); return rayBlocks.contains(block);
} }
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()) if (redstone.getValue()) {
rayBlocks.add(Block.getBlockFromName("gold_ore")); rayBlocks.add(Block.getBlockFromName("redstone_ore"));
if(redstone.getValue()){ rayBlocks.add(Block.getBlockById(74));
rayBlocks.add(Block.getBlockFromName("redstone_ore")); }
rayBlocks.add(Block.getBlockById(74)); if (lapis.getValue()) rayBlocks.add(Block.getBlockFromName("lapis_ore"));
} if (diamond.getValue()) rayBlocks.add(Block.getBlockFromName("diamond_ore"));
if(lapis.getValue()) if (quartz.getValue()) rayBlocks.add(Block.getBlockFromName("quartz_ore"));
rayBlocks.add(Block.getBlockFromName("lapis_ore")); if (water.getValue()) {
if(diamond.getValue()) rayBlocks.add(Block.getBlockById(8));
rayBlocks.add(Block.getBlockFromName("diamond_ore")); rayBlocks.add(Block.getBlockById(9));
if(quartz.getValue()) }
rayBlocks.add(Block.getBlockFromName("quartz_ore"));
if(water.getValue()){
rayBlocks.add(Block.getBlockById(8));
rayBlocks.add(Block.getBlockById(9));
}
rayBlocks.add(Block.getBlockById(10)); rayBlocks.add(Block.getBlockById(10));
rayBlocks.add(Block.getBlockById(11)); rayBlocks.add(Block.getBlockById(11));
rayBlocks.add(Block.getBlockFromName("fire")); rayBlocks.add(Block.getBlockFromName("fire"));
rayBlocks.add(Block.getBlockFromName("mob_spawner")); rayBlocks.add(Block.getBlockFromName("mob_spawner"));
rayBlocks.add(Block.getBlockFromName("end_portal_frame")); rayBlocks.add(Block.getBlockFromName("end_portal_frame"));
rayBlocks.add(Block.getBlockFromName("enchanting_table")); rayBlocks.add(Block.getBlockFromName("enchanting_table"));
rayBlocks.add(Block.getBlockFromName("bookshelf")); rayBlocks.add(Block.getBlockFromName("bookshelf"));
} }
public static void updateGameSetting(){ public static void updateGameSetting() {
Minecraft mc = Minecraft.getMinecraft(); Minecraft mc = Minecraft.getMinecraft();
mc.gameSettings.keyBindings = mc.gameSettings.keyBindings =
(KeyBinding[]) ArrayUtils.addAll( (KeyBinding[]) ArrayUtils.addAll(
new KeyBinding[] { new KeyBinding[] {
mc.gameSettings.keyBindAttack, mc.gameSettings.keyBindAttack,
mc.gameSettings.keyBindUseItem, mc.gameSettings.keyBindUseItem,
mc.gameSettings.keyBindForward, mc.gameSettings.keyBindForward,
mc.gameSettings.keyBindLeft, mc.gameSettings.keyBindLeft,
mc.gameSettings.keyBindBack, mc.gameSettings.keyBindBack,
mc.gameSettings.keyBindRight, mc.gameSettings.keyBindRight,
mc.gameSettings.keyBindJump, mc.gameSettings.keyBindJump,
mc.gameSettings.keyBindSneak, mc.gameSettings.keyBindSneak,
mc.gameSettings.keyBindSprint, mc.gameSettings.keyBindSprint,
mc.gameSettings.keyBindDrop, mc.gameSettings.keyBindDrop,
mc.gameSettings.keyBindInventory, mc.gameSettings.keyBindInventory,
mc.gameSettings.keyBindChat, mc.gameSettings.keyBindChat,
mc.gameSettings.keyBindPlayerList, mc.gameSettings.keyBindPlayerList,
mc.gameSettings.keyBindPickBlock, mc.gameSettings.keyBindPickBlock,
mc.gameSettings.keyBindCommand, mc.gameSettings.keyBindCommand,
mc.gameSettings.keyBindScreenshot, mc.gameSettings.keyBindScreenshot,
mc.gameSettings.keyBindTogglePerspective, mc.gameSettings.keyBindTogglePerspective,
mc.gameSettings.keyBindSmoothCamera, mc.gameSettings.keyBindSmoothCamera,
mc.gameSettings.keyBindZoomCamera, mc.gameSettings.keyBindZoomCamera,
mc.gameSettings.keyBindFunction, mc.gameSettings.keyBindFunction,
mc.gameSettings.keyBindClose, mc.gameSettings.keyBindClose,
mc.gameSettings.keyBindClickGui, mc.gameSettings.keyBindClickGui,
mc.gameSettings.keyBindFreelook, mc.gameSettings.keyBindFreelook,
mc.gameSettings.keyBindAdminX mc.gameSettings.keyBindAdminX
}, },
mc.gameSettings.keyBindsHotbar mc.gameSettings.keyBindsHotbar
); );
} }
} }

View File

@ -11,42 +11,43 @@ 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() {
for(Object o: mc.theWorld.loadedTileEntityList) { for (Object o : mc.theWorld.loadedTileEntityList) {
if(o instanceof TileEntityMobSpawner && this.isEnabled()) { if (o instanceof TileEntityMobSpawner && this.isEnabled()) {
box(((TileEntityMobSpawner)o)); box(((TileEntityMobSpawner) o));
} }
} }
} }
public static void box(TileEntityMobSpawner entity){ public static void box(TileEntityMobSpawner entity) {
GlStateManager.blendFunc(770, 771); GlStateManager.blendFunc(770, 771);
GlStateManager.enableBlend(); GlStateManager.enableBlend();
EaglercraftGPU.glLineWidth(4.0F); EaglercraftGPU.glLineWidth(4.0F);
GlStateManager.disableTexture2D(); GlStateManager.disableTexture2D();
GlStateManager.disableDepth(); GlStateManager.disableDepth();
GlStateManager.depthMask(false); GlStateManager.depthMask(false);
GlStateManager.color(1F, 0.5F, 0.5F, 0.5F); GlStateManager.color(1F, 0.5F, 0.5F, 0.5F);
Minecraft.getMinecraft().getRenderManager(); Minecraft.getMinecraft().getRenderManager();
RenderGlobal.func_181561_a( RenderGlobal.func_181561_a(
new AxisAlignedBB( new AxisAlignedBB(
entity.getPos().getX()-Minecraft.getMinecraft().getRenderManager().renderPosX+0.1, entity.getPos().getX() - Minecraft.getMinecraft().getRenderManager().renderPosX + 0.1,
entity.getPos().getY()-Minecraft.getMinecraft().getRenderManager().renderPosY+0.1, entity.getPos().getY() - Minecraft.getMinecraft().getRenderManager().renderPosY + 0.1,
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.enableDepth(); );
GlStateManager.depthMask(true); GlStateManager.enableTexture2D();
GlStateManager.disableBlend(); GlStateManager.enableDepth();
} GlStateManager.depthMask(true);
GlStateManager.disableBlend();
}
@Override @Override
public boolean isAdmin(){ public boolean isAdmin() {
return true; return true;
} }
} }

View File

@ -7,15 +7,16 @@ import dev.resent.module.base.setting.CustomRectSettingDraw;
import dev.resent.visual.cape.CapeUi; 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() {
mc.displayGuiScreen(new CapeUi()); mc.displayGuiScreen(new CapeUi());
} }
}; };
public Cape(){ public Cape() {
addSetting(open); addSetting(open);
} }
} }

View File

@ -7,15 +7,16 @@ import dev.resent.module.base.setting.CustomRectSettingDraw;
import dev.resent.visual.crosshair.CrosshairUi; 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() {
mc.displayGuiScreen(new CrosshairUi()); mc.displayGuiScreen(new CrosshairUi());
} }
}; };
public Crosshair(){ public Crosshair() {
addSetting(open); addSetting(open);
} }
} }

View File

@ -11,7 +11,7 @@ import net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums;
import net.minecraft.client.settings.GameSettings; import net.minecraft.client.settings.GameSettings;
@Module(name = "FPS Options", category = Category.MISC, hasSetting = true, description = "Increase FPS") @Module(name = "FPS Options", category = Category.MISC, hasSetting = true, description = "Increase FPS")
public class FPSOptions extends Mod{ public class FPSOptions extends Mod {
public BooleanSetting batchRendering = new BooleanSetting("Batch rendering", "", true); public BooleanSetting batchRendering = new BooleanSetting("Batch rendering", "", true);
public BooleanSetting blockEffects = new BooleanSetting("Remove block effects", "", true); public BooleanSetting blockEffects = new BooleanSetting("Remove block effects", "", true);
@ -20,9 +20,9 @@ public class FPSOptions extends Mod{
public BooleanSetting lightUpdates = new BooleanSetting("No light updates", "", true); public BooleanSetting lightUpdates = new BooleanSetting("No light updates", "", true);
public BooleanSetting noArmSwing = new BooleanSetting("No limb swing", "", false); public BooleanSetting noArmSwing = new BooleanSetting("No limb swing", "", false);
public BooleanSetting reducedWater = new BooleanSetting("Reduced water lag", "", true); public BooleanSetting reducedWater = new BooleanSetting("Reduced water lag", "", true);
public CustomRectSettingDraw minSetting = new CustomRectSettingDraw("Minimal settings", ""){ public CustomRectSettingDraw minSetting = new CustomRectSettingDraw("Minimal settings", "") {
@Override @Override
public void onPress(){ public void onPress() {
GameSettings gameSettings = mc.gameSettings; GameSettings gameSettings = mc.gameSettings;
GlStateManager.enableTexture2D(); GlStateManager.enableTexture2D();
@ -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

@ -7,12 +7,13 @@ import dev.resent.module.base.setting.BooleanSetting;
import dev.resent.module.base.setting.NumberSetting; 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);
public ParticleMultiplier(){ public ParticleMultiplier() {
addSetting(alwaysCrit, alwaysSharp, multiplier); addSetting(alwaysCrit, alwaysSharp, multiplier);
} }
} }

View File

@ -14,9 +14,9 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@Module(name = "Reach circle", category = Category.MISC) @Module(name = "Reach circle", category = Category.MISC)
public class ReachCircle extends Mod{ public class ReachCircle extends Mod {
public void uwu(float partialTicks){ public void uwu(float partialTicks) {
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
mc.entityRenderer.disableLightmap(); mc.entityRenderer.disableLightmap();
GlStateManager.disableTexture2D(); GlStateManager.disableTexture2D();
@ -26,7 +26,7 @@ public class ReachCircle extends Mod{
//PlatformOpenGL._wglEnable(2848); //PlatformOpenGL._wglEnable(2848);
GlStateManager.depthMask(false); GlStateManager.depthMask(false);
for(Entity entity : mc.theWorld.loadedEntityList){ for (Entity entity : mc.theWorld.loadedEntityList) {
if (((EntityLivingBase) entity).canEntityBeSeen(mc.thePlayer) && !entity.isInvisible() && entity instanceof EntityPlayer) { if (((EntityLivingBase) entity).canEntityBeSeen(mc.thePlayer) && !entity.isInvisible() && entity instanceof EntityPlayer) {
double posX = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * partialTicks - mc.getRenderManager().viewerPosX; double posX = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * partialTicks - mc.getRenderManager().viewerPosX;
double posY = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * partialTicks - mc.getRenderManager().viewerPosY; double posY = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * partialTicks - mc.getRenderManager().viewerPosY;
@ -43,7 +43,7 @@ public class ReachCircle extends Mod{
GlStateManager.enableTexture2D(); GlStateManager.enableTexture2D();
mc.entityRenderer.enableLightmap(); mc.entityRenderer.enableLightmap();
GlStateManager.popMatrix(); GlStateManager.popMatrix();
} }
public void circle(double x, double y, double z, double rad) { public void circle(double x, double y, double z, double rad) {
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();

View File

@ -9,12 +9,11 @@ import net.minecraft.client.settings.KeyBinding;
@Module(name = "ToggleSprint", category = Category.MISC) @Module(name = "ToggleSprint", category = Category.MISC)
public class Sprint extends Mod { public class Sprint extends Mod {
public static void onUpdate(){ public static void onUpdate() {
KeyBinding.setKeyBindState(Minecraft.getMinecraft().gameSettings.keyBindSprint.getKeyCode(), true); KeyBinding.setKeyBindState(Minecraft.getMinecraft().gameSettings.keyBindSprint.getKeyCode(), true);
} }
public void onDisable() { public void onDisable() {
KeyBinding.setKeyBindState(mc.gameSettings.keyBindSprint.getKeyCode(), false); KeyBinding.setKeyBindState(mc.gameSettings.keyBindSprint.getKeyCode(), false);
} }
} }

View File

@ -4,4 +4,4 @@ import dev.resent.annotation.Module;
import dev.resent.module.base.Mod; import dev.resent.module.base.Mod;
@Module(name = "Left hand", description = "Render your hand on the left") @Module(name = "Left hand", description = "Render your hand on the left")
public class Hand extends Mod{ } public class Hand extends Mod {}

View File

@ -5,4 +5,4 @@ import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category; import dev.resent.module.base.Mod.Category;
@Module(name = "Self nametag", category = Category.MISC) @Module(name = "Self nametag", category = Category.MISC)
public class SelfNametag extends Mod{ } public class SelfNametag extends Mod {}

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;
@ -22,7 +20,7 @@ public class SoundManager {
FileOutputStream fos = null; FileOutputStream fos = null;
File temp; File temp;
public void playSound(String base64) throws UnsupportedEncodingException{ public void playSound(String base64) throws UnsupportedEncodingException {
byte[] byteArray = Base64.getDecoder().decode(new String(base64).getBytes("UTF-8")); byte[] byteArray = Base64.getDecoder().decode(new String(base64).getBytes("UTF-8"));
this.playSound(byteArray); this.playSound(byteArray);
} }
@ -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) {
@ -62,7 +59,7 @@ public class SoundManager {
} }
// <3 // <3
public void playDemo(){ public void playDemo() {
ISound sound = PositionedSoundRecord.create(new ResourceLocation("minecraft:music.res"), 1); ISound sound = PositionedSoundRecord.create(new ResourceLocation("minecraft:music.res"), 1);
Minecraft.getMinecraft().getSoundHandler().stopSounds(); Minecraft.getMinecraft().getSoundHandler().stopSounds();
Minecraft.getMinecraft().getSoundHandler().playSound(sound); Minecraft.getMinecraft().getSoundHandler().playSound(sound);

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,14 +1,15 @@
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;
private long getDeltaTime(){ private long getDeltaTime() {
return (System.nanoTime()-lastTime); return (System.nanoTime() - lastTime);
} }
private void updateTime(){ private void updateTime() {
this.lastTime = System.nanoTime(); this.lastTime = System.nanoTime();
} }
@ -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,56 +19,47 @@ 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;
if(ModManager.itemPhysics.isEnabled()) { if (ModManager.itemPhysics.isEnabled()) {
if(block != null) { if (block != null) {
GlStateManager.translate((float)p_177077_2_, (float)p_177077_4_ + 0.15F, (float)p_177077_6_); GlStateManager.translate((float) p_177077_2_, (float) p_177077_4_ + 0.15F, (float) p_177077_6_);
}else { } else {
GlStateManager.translate((float)p_177077_2_, (float)p_177077_4_ + 0.02F, (float)p_177077_6_); GlStateManager.translate((float) p_177077_2_, (float) p_177077_4_ + 0.02F, (float) p_177077_6_);
GlStateManager.rotate(-90F, 1F, 0F, 0F); GlStateManager.rotate(-90F, 1F, 0F, 0F);
} }
}else { } else {
float f1 = MathHelper.sin(((float)itemIn.getAge() + p_177077_8_) / 10.0F + itemIn.hoverStart) * 0.1F + 0.1F; float f1 = MathHelper.sin(((float) itemIn.getAge() + p_177077_8_) / 10.0F + itemIn.hoverStart) * 0.1F + 0.1F;
float f2 = p_177077_9_.getItemCameraTransforms().getTransform(ItemCameraTransforms.TransformType.GROUND).scale.y; float f2 = p_177077_9_.getItemCameraTransforms().getTransform(ItemCameraTransforms.TransformType.GROUND).scale.y;
GlStateManager.translate((float)p_177077_2_, (float)p_177077_4_ + f1 + 0.25F * f2, (float)p_177077_6_); GlStateManager.translate((float) p_177077_2_, (float) p_177077_4_ + f1 + 0.25F * f2, (float) p_177077_6_);
} }
if(!ModManager.itemPhysics.isEnabled()) { if (!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;
GlStateManager.translate(f6, f4, f5); GlStateManager.translate(f6, f4, f5);
} }
if(ModManager.itemPhysics.isEnabled() && !itemIn.onGround) { if (ModManager.itemPhysics.isEnabled() && !itemIn.onGround) {
float angle = System.currentTimeMillis() % (360 * 20) / (float) (4.5 - ItemPhysics.speed.getValue()/2); float angle = System.currentTimeMillis() % (360 * 20) / (float) (4.5 - ItemPhysics.speed.getValue() / 2);
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

@ -77,20 +77,19 @@ public class RenderUtils {
paramYEnd = z; paramYEnd = z;
} }
double x1 = (double)(paramXStart + radius); double x1 = (double) (paramXStart + radius);
double y1 = (double)(paramYStart + radius); double y1 = (double) (paramYStart + radius);
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);
EaglercraftGPU.glLineWidth(1); EaglercraftGPU.glLineWidth(1);
//glEnable(GL_LINE_SMOOTH); //glEnable(GL_LINE_SMOOTH);
GlStateManager.color(red, green, blue, alpha); GlStateManager.color(red, green, blue, alpha);
Tessellator tessellator = Tessellator.getInstance(); Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer(); WorldRenderer worldrenderer = tessellator.getWorldRenderer();
@ -99,24 +98,19 @@ 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) {
Tessellator tessellator = Tessellator.getInstance(); Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer(); WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.pos(idk, idk2, 0); worldrenderer.pos(idk, idk2, 0);
@ -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();
@ -54,10 +46,11 @@ public class RoundedUtil {
GlStateManager.scale(2.0D, 2.0D, 2.0D); GlStateManager.scale(2.0D, 2.0D, 2.0D);
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();
GlStateManager.scale(0.5D, 0.5D, 0.5D); GlStateManager.scale(0.5D, 0.5D, 0.5D);
x *= 2.0D; x *= 2.0D;
y *= 2.0D; y *= 2.0D;
@ -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();
@ -88,9 +77,9 @@ public class RoundedUtil {
GlStateManager.scale(2.0D, 2.0D, 2.0D); GlStateManager.scale(2.0D, 2.0D, 2.0D);
GlStateManager.enableBlend(); GlStateManager.enableBlend();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
} }
public static void glVertex2d(double idk, double idk2){ public static void glVertex2d(double idk, double idk2) {
Tessellator tessellator = Tessellator.getInstance(); Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer(); WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.pos(idk, idk2, 0); worldrenderer.pos(idk, idk2, 0);

View File

@ -11,15 +11,15 @@ public class CapeManager {
public static ResourceLocation capeLocation; public static ResourceLocation capeLocation;
public static void displayChooser(){ public static void displayChooser() {
EagRuntime.displayFileChooser("image/png", "png"); EagRuntime.displayFileChooser("image/png", "png");
} }
public static ResourceLocation getCapeLocation(){ public static ResourceLocation getCapeLocation() {
return capeLocation; return capeLocation;
} }
public static void free(){ public static void free() {
Minecraft.getMinecraft().getTextureManager().deleteTexture(capeLocation); Minecraft.getMinecraft().getTextureManager().deleteTexture(capeLocation);
capeLocation = null; capeLocation = null;
} }
@ -28,33 +28,32 @@ public class CapeManager {
EagRuntime.setStorage("cape", texture); EagRuntime.setStorage("cape", texture);
} }
public static byte[] read(){ public static byte[] read() {
if(EagRuntime.getStorage("cape") != null){ if (EagRuntime.getStorage("cape") != null) {
return EagRuntime.getStorage("cape"); return EagRuntime.getStorage("cape");
} }
return null; return null;
} }
public static void forceLoad(byte[] texture){ public static void forceLoad(byte[] texture) {
try{ try {
ImageData loadedCape = ImageData.loadImageFile(texture); ImageData loadedCape = ImageData.loadImageFile(texture);
if(loadedCape != null){ if (loadedCape != null) {
CapeManager.capeLocation = Minecraft.getMinecraft().getTextureManager().getDynamicTextureLocation("uploadedcape", new DynamicTexture(loadedCape)); CapeManager.capeLocation = Minecraft.getMinecraft().getTextureManager().getDynamicTextureLocation("uploadedcape", new DynamicTexture(loadedCape));
Minecraft.getMinecraft().displayGuiScreen(null); Minecraft.getMinecraft().displayGuiScreen(null);
//Minecraft.getMinecraft().getTextureManager().bindTexture(CapeManager.capeLocation); //Minecraft.getMinecraft().getTextureManager().bindTexture(CapeManager.capeLocation);
} }
}catch(Exception e){ } catch (Exception e) {
System.out.println(e); System.out.println(e);
} }
} }
public static boolean shouldRender(AbstractClientPlayer player){ public static boolean shouldRender(AbstractClientPlayer player) {
if(player == Minecraft.getMinecraft().thePlayer){ if (player == Minecraft.getMinecraft().thePlayer) {
return true; return true;
} }
return false; return false;
} }
} }

View File

@ -25,14 +25,14 @@ public class CapeUi extends GuiScreen {
super.drawScreen(mx, my, par3); super.drawScreen(mx, my, par3);
} }
public void updateScreen(){ public void updateScreen() {
if (EagRuntime.fileChooserHasResult()) { if (EagRuntime.fileChooserHasResult()) {
CapeManager.free(); CapeManager.free();
FileChooserResult result = EagRuntime.getFileChooserResult(); FileChooserResult result = EagRuntime.getFileChooserResult();
if (result != null) { if (result != null) {
ImageData loadedCape = ImageData.loadImageFile(result.fileData); ImageData loadedCape = ImageData.loadImageFile(result.fileData);
if(loadedCape != null){ if (loadedCape != null) {
for(int i = 0; 1 > i; i++){ for (int i = 0; 1 > i; i++) {
CapeManager.write(result.fileData); CapeManager.write(result.fileData);
} }
CapeManager.capeLocation = Minecraft.getMinecraft().getTextureManager().getDynamicTextureLocation("uploadedcape", new DynamicTexture(loadedCape)); CapeManager.capeLocation = Minecraft.getMinecraft().getTextureManager().getDynamicTextureLocation("uploadedcape", new DynamicTexture(loadedCape));
@ -48,7 +48,7 @@ public class CapeUi extends GuiScreen {
protected void actionPerformed(GuiButton par1GuiButton) { protected void actionPerformed(GuiButton par1GuiButton) {
if (par1GuiButton.id == 200) { if (par1GuiButton.id == 200) {
mc.displayGuiScreen(null); mc.displayGuiScreen(null);
}else if(par1GuiButton.id == 1){ } else if (par1GuiButton.id == 1) {
CapeManager.displayChooser(); CapeManager.displayChooser();
} }
} }

View File

@ -11,15 +11,15 @@ public class CrosshairManager {
public static ResourceLocation crosshairLocation; public static ResourceLocation crosshairLocation;
public static void displayChooser(){ public static void displayChooser() {
EagRuntime.displayFileChooser("image/png", "png"); EagRuntime.displayFileChooser("image/png", "png");
} }
public static ResourceLocation getCrosshairLocation(){ public static ResourceLocation getCrosshairLocation() {
return crosshairLocation; return crosshairLocation;
} }
public static void free(){ public static void free() {
Minecraft.getMinecraft().getTextureManager().deleteTexture(crosshairLocation); Minecraft.getMinecraft().getTextureManager().deleteTexture(crosshairLocation);
crosshairLocation = null; crosshairLocation = null;
} }
@ -28,33 +28,32 @@ public class CrosshairManager {
EagRuntime.setStorage("crosshair", texture); EagRuntime.setStorage("crosshair", texture);
} }
public static byte[] read(){ public static byte[] read() {
if(EagRuntime.getStorage("crosshair") != null){ if (EagRuntime.getStorage("crosshair") != null) {
return EagRuntime.getStorage("crosshair"); return EagRuntime.getStorage("crosshair");
} }
return null; return null;
} }
public static void forceLoad(byte[] texture){ public static void forceLoad(byte[] texture) {
try{ try {
ImageData loadedCrosshair = ImageData.loadImageFile(texture); ImageData loadedCrosshair = ImageData.loadImageFile(texture);
if(loadedCrosshair != null){ if (loadedCrosshair != null) {
CrosshairManager.crosshairLocation = Minecraft.getMinecraft().getTextureManager().getDynamicTextureLocation("uploadedcrosshair", new DynamicTexture(loadedCrosshair)); CrosshairManager.crosshairLocation = Minecraft.getMinecraft().getTextureManager().getDynamicTextureLocation("uploadedcrosshair", new DynamicTexture(loadedCrosshair));
Minecraft.getMinecraft().displayGuiScreen(null); Minecraft.getMinecraft().displayGuiScreen(null);
//Minecraft.getMinecraft().getTextureManager().bindTexture(CrosshairManager.crosshairLocation); //Minecraft.getMinecraft().getTextureManager().bindTexture(CrosshairManager.crosshairLocation);
} }
}catch(Exception e){ } catch (Exception e) {
System.out.println(e); System.out.println(e);
} }
} }
public static boolean shouldRender(AbstractClientPlayer player){ public static boolean shouldRender(AbstractClientPlayer player) {
if(player == Minecraft.getMinecraft().thePlayer){ if (player == Minecraft.getMinecraft().thePlayer) {
return true; return true;
} }
return false; return false;
} }
} }

View File

@ -25,14 +25,14 @@ public class CrosshairUi extends GuiScreen {
super.drawScreen(mx, my, par3); super.drawScreen(mx, my, par3);
} }
public void updateScreen(){ public void updateScreen() {
if (EagRuntime.fileChooserHasResult()) { if (EagRuntime.fileChooserHasResult()) {
CrosshairManager.free(); CrosshairManager.free();
FileChooserResult result = EagRuntime.getFileChooserResult(); FileChooserResult result = EagRuntime.getFileChooserResult();
if (result != null) { if (result != null) {
ImageData loadedCrosshair = ImageData.loadImageFile(result.fileData); ImageData loadedCrosshair = ImageData.loadImageFile(result.fileData);
if(loadedCrosshair != null){ if (loadedCrosshair != null) {
for(int i = 0; 1 > i; i++){ for (int i = 0; 1 > i; i++) {
CrosshairManager.write(result.fileData); CrosshairManager.write(result.fileData);
} }
CrosshairManager.crosshairLocation = Minecraft.getMinecraft().getTextureManager().getDynamicTextureLocation("uploadedcrosshair", new DynamicTexture(loadedCrosshair)); CrosshairManager.crosshairLocation = Minecraft.getMinecraft().getTextureManager().getDynamicTextureLocation("uploadedcrosshair", new DynamicTexture(loadedCrosshair));
@ -48,7 +48,7 @@ public class CrosshairUi extends GuiScreen {
protected void actionPerformed(GuiButton par1GuiButton) { protected void actionPerformed(GuiButton par1GuiButton) {
if (par1GuiButton.id == 200) { if (par1GuiButton.id == 200) {
mc.displayGuiScreen(null); mc.displayGuiScreen(null);
}else if(par1GuiButton.id == 1){ } else if (par1GuiButton.id == 1) {
CrosshairManager.displayChooser(); CrosshairManager.displayChooser();
} }
} }

View File

@ -6,32 +6,29 @@ import net.minecraft.client.gui.GuiOptions;
import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiVideoSettings; import net.minecraft.client.gui.GuiVideoSettings;
public class PreVideo extends GuiScreen{ public class PreVideo extends GuiScreen {
public GuiScreen uwu; public GuiScreen uwu;
public PreVideo(GuiScreen from) {
uwu = from;
}
@Override
protected void mouseClicked(int parInt1, int parInt2, int parInt3) {
if(isMouseInside(parInt1, parInt2, width/2-50, height/2+40, width/2+50, height/2+70)) {
this.mc.displayGuiScreen(new GuiOptions(uwu, mc.gameSettings));
}else {
this.mc.displayGuiScreen(new GuiVideoSettings(this, mc.gameSettings));
}
}
@Override
public void drawScreen(int i, int j, float var3) {
this.drawDefaultBackground();
drawCenteredString(mc.fontRendererObj, "Don't use Auto gui scale! Resent looks best with normal or large gui scales.", width/2, height/2, -1);
drawCenteredString(mc.fontRendererObj, "Press anywhere to continue. Or, go", width/2, height/2+19, -1);
RenderUtils.drawRoundedRect(width/2-50, height/2+40, width/2+50, height/2+70, 4, isMouseInside(i, j, width/2-50, height/2+40, width/2+50, height/2+70) ? new Color(40, 40, 40).getRGB() : new Color(21, 21, 21).getRGB());
drawCenteredString(mc.fontRendererObj, "Back", width/2, height/2+51, -1);
}
public PreVideo(GuiScreen from) {
uwu = from;
}
@Override
protected void mouseClicked(int parInt1, int parInt2, int parInt3) {
if (isMouseInside(parInt1, parInt2, width / 2 - 50, height / 2 + 40, width / 2 + 50, height / 2 + 70)) {
this.mc.displayGuiScreen(new GuiOptions(uwu, mc.gameSettings));
} else {
this.mc.displayGuiScreen(new GuiVideoSettings(this, mc.gameSettings));
}
}
@Override
public void drawScreen(int i, int j, float var3) {
this.drawDefaultBackground();
drawCenteredString(mc.fontRendererObj, "Don't use Auto gui scale! Resent looks best with normal or large gui scales.", width / 2, height / 2, -1);
drawCenteredString(mc.fontRendererObj, "Press anywhere to continue. Or, go", width / 2, height / 2 + 19, -1);
RenderUtils.drawRoundedRect(width / 2 - 50, height / 2 + 40, width / 2 + 50, height / 2 + 70, 4, isMouseInside(i, j, width / 2 - 50, height / 2 + 40, width / 2 + 50, height / 2 + 70) ? new Color(40, 40, 40).getRGB() : new Color(21, 21, 21).getRGB());
drawCenteredString(mc.fontRendererObj, "Back", width / 2, height / 2 + 51, -1);
}
} }

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

@ -39,6 +39,6 @@ public class SimpleAnimation {
} }
public boolean isDone() { public boolean isDone() {
return lastValue >= value-1; return lastValue >= value - 1;
} }
} }

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;
@ -53,12 +52,12 @@ public class ClickGUI extends GuiScreen {
int xo = 0; int xo = 0;
int off = 0; int off = 0;
if(isMouseInside(mouseX, mouseY, x, height+14, x+20, height+25)) { if (isMouseInside(mouseX, mouseY, x, height + 14, x + 20, height + 25)) {
selectedCategory = null; selectedCategory = null;
}else if(isMouseInside(mouseX, mouseY, x+24, height+14, x+46, height+25)) { } else if (isMouseInside(mouseX, mouseY, x + 24, height + 14, x + 46, height + 25)) {
selectedCategory = Category.HUD; selectedCategory = Category.HUD;
}else if(isMouseInside(mouseX, mouseY, x+50, height+14, x+74, height+25)) { } else if (isMouseInside(mouseX, mouseY, x + 50, height + 14, x + 74, height + 25)) {
selectedCategory = Category.MISC; selectedCategory = Category.MISC;
} }
if (isMouseInside(mouseX, mouseY, sr.getScaledWidth() / 2 - fr.getStringWidth("Edit Layout") / 2 - 5, sr.getScaledHeight() - y - 9, sr.getScaledWidth() / 2 - fr.getStringWidth("Edit Layout") / 2 + 5 + fr.getStringWidth("Edit Layout"), sr.getScaledHeight() - y + 5) && mouseButton == 0) { if (isMouseInside(mouseX, mouseY, sr.getScaledWidth() / 2 - fr.getStringWidth("Edit Layout") / 2 - 5, sr.getScaledHeight() - y - 9, sr.getScaledWidth() / 2 - fr.getStringWidth("Edit Layout") / 2 + 5 + fr.getStringWidth("Edit Layout"), sr.getScaledHeight() - y + 5) && mouseButton == 0) {
@ -67,66 +66,63 @@ public class ClickGUI extends GuiScreen {
} }
Resent.INSTANCE.modManager.modsInCategory(selectedCategory).sort(Comparator.comparingInt(m -> fr.getStringWidth(m.getName()))); Resent.INSTANCE.modManager.modsInCategory(selectedCategory).sort(Comparator.comparingInt(m -> fr.getStringWidth(m.getName())));
for (Mod m : Resent.INSTANCE.modManager.modsInCategory(selectedCategory) ) { for (Mod m : Resent.INSTANCE.modManager.modsInCategory(selectedCategory)) {
if(!m.isAdmin() || EntityRenderer.test){ if (!m.isAdmin() || EntityRenderer.test) {
int fh = 9; int fh = 9;
if (isMouseInside(mouseX, mouseY, this.x + 90 + xo - 1 + 10, height - 2 - fh * -(off) + 51 - 1 - offset, this.x + 90 + xo - 1 + 21, height + 30 - fh * (-off) + 30 - 1 + 2 - 1 - offset) && m.doesHaveSetting() && openedMod == null) { if (isMouseInside(mouseX, mouseY, this.x + 90 + xo - 1 + 10, height - 2 - fh * -(off) + 51 - 1 - offset, this.x + 90 + xo - 1 + 21, height + 30 - fh * (-off) + 30 - 1 + 2 - 1 - offset) && m.doesHaveSetting() && openedMod == null) {
// Open settings // Open settings
this.openedMod = m; this.openedMod = m;
} else if (isMouseInside(mouseX, mouseY, x - 9 + 2, height + 27 + 9 + 2, x - 9 + 6 + fr.getStringWidth("<"), height + 33 + 9 + 2 + fr.getStringWidth("<")) && mouseButton == 0) { } else if (isMouseInside(mouseX, mouseY, x - 9 + 2, height + 27 + 9 + 2, x - 9 + 6 + fr.getStringWidth("<"), height + 33 + 9 + 2 + fr.getStringWidth("<")) && mouseButton == 0) {
// Close settings // Close settings
this.openedMod = null; this.openedMod = null;
} else if (isMouseInside(mouseX, mouseY, width + 15, height - 10, width + 25, height + 7)) { } else if (isMouseInside(mouseX, mouseY, width + 15, height - 10, width + 25, height + 7)) {
// Close ui // Close ui
mc.displayGuiScreen(null); mc.displayGuiScreen(null);
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") m.toggle();
if(m.getName() != "ClickGUI") }
m.toggle(); if (xo > width / 2) {
} xo = 0;
if (xo > width / 2) { off += 5;
xo = 0; } else {
off += 5; xo += 100;
} else { }
xo += 100;
}
} }
} }
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;
} }
} }
if (s instanceof BooleanSetting) { if (s instanceof BooleanSetting) {
if (isMouseInside(mouseX, mouseY, this.x + 11, height - 9 + 50 + var, this.x + 19, height - 9 + 50 + 9 + var - 1) && mouseButton == 0) { if (isMouseInside(mouseX, mouseY, this.x + 11, height - 9 + 50 + var, this.x + 19, height - 9 + 50 + 9 + var - 1) && mouseButton == 0) {
((BooleanSetting)s).toggle(); ((BooleanSetting) s).toggle();
} }
} }
if (s instanceof ModeSetting) { if (s instanceof ModeSetting) {
if(isMouseInside(mouseX, mouseY, this.x+360, height+40+var, this.x+370, height+50+var) && mouseButton == 0) { if (isMouseInside(mouseX, mouseY, this.x + 360, height + 40 + var, this.x + 370, height + 50 + var) && mouseButton == 0) {
((ModeSetting)s).cycle(false); ((ModeSetting) s).cycle(false);
} }
if(isMouseInside(mouseX, mouseY, this.x+458, height+40+var, this.x+470, height+50+var) && mouseButton == 0) { if (isMouseInside(mouseX, mouseY, this.x + 458, height + 40 + var, this.x + 470, height + 50 + var) && mouseButton == 0) {
((ModeSetting)s).cycle(true); ((ModeSetting) s).cycle(true);
} }
} }
if(s instanceof CustomRectSettingDraw){ if (s instanceof CustomRectSettingDraw) {
if(isMouseInside(mouseX, mouseY, x+21, height+41+var, x+27+fr.getStringWidth(s.name), height+var+53)){ if (isMouseInside(mouseX, mouseY, x + 21, height + 41 + var, x + 27 + fr.getStringWidth(s.name), height + var + 53)) {
((CustomRectSettingDraw)s).onPress(); ((CustomRectSettingDraw) s).onPress();
} }
} }
@ -148,10 +144,10 @@ public class ClickGUI extends GuiScreen {
int off = 0; int off = 0;
if (close) { if (close) {
if(introAnimation == null) { if (introAnimation == null) {
mc.displayGuiScreen(null); mc.displayGuiScreen(null);
return; return;
} }
introAnimation.setDirection(Direction.BACKWARDS); introAnimation.setDirection(Direction.BACKWARDS);
if (introAnimation.isDone(Direction.BACKWARDS)) { if (introAnimation.isDone(Direction.BACKWARDS)) {
@ -166,7 +162,7 @@ public class ClickGUI extends GuiScreen {
fr.drawString(ClientInfo.name + " Client " + ClientInfo.version, x + 8, height - 2, -1); fr.drawString(ClientInfo.name + " Client " + ClientInfo.version, x + 8, height - 2, -1);
//RenderUtils.drawRectOutline(sr.getScaledWidth() / 2 - fr.getStringWidth("Edit Layout") / 2 - 5, sr.getScaledHeight() - y - 9, sr.getScaledWidth() / 2 - fr.getStringWidth("Edit Layout") / 2 + 5 + fr.getStringWidth("Edit Layout"), sr.getScaledHeight() - y + 5, -1); //RenderUtils.drawRectOutline(sr.getScaledWidth() / 2 - fr.getStringWidth("Edit Layout") / 2 - 5, sr.getScaledHeight() - y - 9, sr.getScaledWidth() / 2 - fr.getStringWidth("Edit Layout") / 2 + 5 + fr.getStringWidth("Edit Layout"), sr.getScaledHeight() - y + 5, -1);
drawRect( drawRect(
sr.getScaledWidth() / 2 - fr.getStringWidth("Edit Layout") / 2 - 4, sr.getScaledWidth() / 2 - fr.getStringWidth("Edit Layout") / 2 - 4,
sr.getScaledHeight() - y - 9 + 1, sr.getScaledHeight() - y - 9 + 1,
sr.getScaledWidth() / 2 - fr.getStringWidth("Edit Layout") / 2 + 5 + fr.getStringWidth("Edit Layout") - 1, sr.getScaledWidth() / 2 - fr.getStringWidth("Edit Layout") / 2 + 5 + fr.getStringWidth("Edit Layout") - 1,
@ -180,12 +176,12 @@ public class ClickGUI extends GuiScreen {
fr.drawString("X", width + 18, height - 2, -1); fr.drawString("X", width + 18, height - 2, -1);
//categories //categories
drawRect(x+0.8d, height+14, x+20, height+25, isMouseInside(mouseX, mouseY, x, height+14, x+20, height+25) ? new Color(150, 150, 150, 65).getRGB() : new Color(211, 211, 211, 65).getRGB()); drawRect(x + 0.8d, height + 14, x + 20, height + 25, isMouseInside(mouseX, mouseY, x, height + 14, x + 20, height + 25) ? new Color(150, 150, 150, 65).getRGB() : new Color(211, 211, 211, 65).getRGB());
drawRect(x+23d, height+14, x+47, height+25, isMouseInside(mouseX, mouseY, x+24, height+14, x+46, height+25) ? new Color(150, 150, 150, 65).getRGB() : new Color(211, 211, 211, 65).getRGB()); drawRect(x + 23d, height + 14, x + 47, height + 25, isMouseInside(mouseX, mouseY, x + 24, height + 14, x + 46, height + 25) ? new Color(150, 150, 150, 65).getRGB() : new Color(211, 211, 211, 65).getRGB());
drawRect(x+50, height+14, x+75, height+25, isMouseInside(mouseX, mouseY, x+50, height+14, x+74, height+25) ? new Color(150, 150, 150, 65).getRGB() : new Color(211, 211, 211, 65).getRGB()); drawRect(x + 50, height + 14, x + 75, height + 25, isMouseInside(mouseX, mouseY, x + 50, height + 14, x + 74, height + 25) ? new Color(150, 150, 150, 65).getRGB() : new Color(211, 211, 211, 65).getRGB());
fr.drawStringWithShadow("All", x+5f, height+16, -1); fr.drawStringWithShadow("All", x + 5f, height + 16, -1);
fr.drawStringWithShadow("Hud", x+26.5f, height+16, -1); fr.drawStringWithShadow("Hud", x + 26.5f, height + 16, -1);
fr.drawStringWithShadow("Misc", x+53, height+16, -1); fr.drawStringWithShadow("Misc", x + 53, height + 16, -1);
//white line //white line
drawRect(x - 8, height + 29, width + 33, height + 30, -1); drawRect(x - 8, height + 29, width + 33, height + 30, -1);
@ -195,26 +191,26 @@ public class ClickGUI extends GuiScreen {
for (Mod m : Resent.INSTANCE.modManager.modsInCategory(selectedCategory)) { for (Mod m : Resent.INSTANCE.modManager.modsInCategory(selectedCategory)) {
if (this.openedMod == null && !m.isAdmin() || this.openedMod == null && EntityRenderer.test) { if (this.openedMod == null && !m.isAdmin() || this.openedMod == null && EntityRenderer.test) {
int fh = 9; int fh = 9;
if (height - 2 - fh * -(off) + 50 - 2 - offset > height + 29 && height + 40 - fh * (-off) + 30 +15 - offset < y + 20 && (introAnimation != null ? introAnimation.isDone() : true)) { if (height - 2 - fh * -(off) + 50 - 2 - offset > height + 29 && height + 40 - fh * (-off) + 30 + 15 - offset < y + 20 && (introAnimation != null ? introAnimation.isDone() : true)) {
// Enabled outline // Enabled outline
m.toggleAnimation.setAnimation(m.isEnabled() ? 20 : 0, 7); m.toggleAnimation.setAnimation(m.isEnabled() ? 20 : 0, 7);
if(ModManager.clickGui.guiTheme.getValue() == "New"){ if (ModManager.clickGui.guiTheme.getValue() == "New") {
RenderUtils.drawRoundedRect(this.x+48+xo, height-2-fh*-(off)+70-1-offset, this.x+80+xo, height+30-fh*-off+30+2-offset+17, 6, new Color(97, 97, 97).getRGB(), true); RenderUtils.drawRoundedRect(this.x + 48 + xo, height - 2 - fh * -(off) + 70 - 1 - offset, this.x + 80 + xo, height + 30 - fh * -off + 30 + 2 - offset + 17, 6, new Color(97, 97, 97).getRGB(), true);
RenderUtils.drawRoundedRect(this.x+48+xo, height-2-fh*-(off)+70-1-offset, this.x+60+xo+m.toggleAnimation.getValue(), height+30-fh*-off+30+2-offset+17, 6, Color.green.getRGB(), true); RenderUtils.drawRoundedRect(this.x + 48 + xo, height - 2 - fh * -(off) + 70 - 1 - offset, this.x + 60 + xo + m.toggleAnimation.getValue(), height + 30 - fh * -off + 30 + 2 - offset + 17, 6, Color.green.getRGB(), true);
RenderUtils.drawRoundedRect(this.x+48+xo+m.toggleAnimation.getValue(), height-2-fh*-(off)+70-1-offset, this.x+60+xo+m.toggleAnimation.getValue(), height+30-fh*-off+30+2-offset+17, 6, -1, true); RenderUtils.drawRoundedRect(this.x + 48 + xo + m.toggleAnimation.getValue(), height - 2 - fh * -(off) + 70 - 1 - offset, this.x + 60 + xo + m.toggleAnimation.getValue(), height + 30 - fh * -off + 30 + 2 - offset + 17, 6, -1, true);
}else if(ModManager.clickGui.guiTheme.getValue() == "Classic revised"){ } else if (ModManager.clickGui.guiTheme.getValue() == "Classic revised") {
RenderUtils.drawRoundedRect(this.x + 10 + xo - 2 + 10, height - 2 - fh * -(off) + 50 - 2 - offset, this.x + 90 + xo + 22, height + 30 - fh * (-off) + 30 + 2 - offset, 4, m.isEnabled() ? Color.GREEN.getRGB() : Color.RED.getRGB(), true); RenderUtils.drawRoundedRect(this.x + 10 + xo - 2 + 10, height - 2 - fh * -(off) + 50 - 2 - offset, this.x + 90 + xo + 22, height + 30 - fh * (-off) + 30 + 2 - offset, 4, m.isEnabled() ? Color.GREEN.getRGB() : Color.RED.getRGB(), true);
} }
if(ModManager.clickGui.guiTheme.getValue().equals("New")) { if (ModManager.clickGui.guiTheme.getValue().equals("New")) {
drawRect( drawRect(
this.x + 10 + xo - 1 + 10, this.x + 10 + xo - 1 + 10,
height - 2 - fh * -(off) + 50 - 1 - offset, height - 2 - fh * -(off) + 50 - 1 - offset,
this.x + 90 + xo - 1 + 22, this.x + 90 + xo - 1 + 22,
height + 85 - fh * (-off) - offset, height + 85 - fh * (-off) - offset,
/*isMouseInside(mouseX, mouseY, this.x + 10 + xo - 1 + 10, height - 2 - fh * -(off) + 50 - 1 - offset, this.x + 90 + xo - 1 + 22, height + 30 - fh * (-off) + 30 - 1 + 2 - offset) ? new Color(105, 105, 105, 65).getRGB() :*/ new Color(211, 211, 211, 65).getRGB() /*isMouseInside(mouseX, mouseY, this.x + 10 + xo - 1 + 10, height - 2 - fh * -(off) + 50 - 1 - offset, this.x + 90 + xo - 1 + 22, height + 30 - fh * (-off) + 30 - 1 + 2 - offset) ? new Color(105, 105, 105, 65).getRGB() :*/new Color(211, 211, 211, 65).getRGB()
); );
} }
if (m.doesHaveSetting()) { if (m.doesHaveSetting()) {
@ -232,56 +228,55 @@ public class ClickGUI extends GuiScreen {
fr.drawStringWithShadow(ClientInfo.name + " - " + openedMod.getName(), sr.getScaledWidth() / 2 - (fr.getStringWidth("Resent - " + openedMod.getName()) / 2), height + 29 - 9 - 2, -1); fr.drawStringWithShadow(ClientInfo.name + " - " + openedMod.getName(), sr.getScaledWidth() / 2 - (fr.getStringWidth("Resent - " + openedMod.getName()) / 2), height + 29 - 9 - 2, -1);
for (Setting s : openedMod.settings) { for (Setting s : openedMod.settings) {
if(s instanceof CustomRectSettingDraw){ if (s instanceof CustomRectSettingDraw) {
drawRect(x+21, height+41+var, x+27+fr.getStringWidth(s.name), height+var+53, isMouseInside(mouseX, mouseY, x+21, height+39+var, x+26+fr.getStringWidth(s.name), height+var+51) ? new Color(150, 150, 150).getRGB() : new Color(211, 211, 211).getRGB()); drawRect(x + 21, height + 41 + var, x + 27 + fr.getStringWidth(s.name), height + var + 53, isMouseInside(mouseX, mouseY, x + 21, height + 39 + var, x + 26 + fr.getStringWidth(s.name), height + var + 51) ? new Color(150, 150, 150).getRGB() : new Color(211, 211, 211).getRGB());
//RenderUtils.drawRectOutline(x+21, height+41+var, x+27+fr.getStringWidth(s.name), height+var+53, -1); //RenderUtils.drawRectOutline(x+21, height+41+var, x+27+fr.getStringWidth(s.name), height+var+53, -1);
fr.drawStringWithShadow(s.name, this.x + 24, height +43 + var, -1); fr.drawStringWithShadow(s.name, this.x + 24, height + 43 + var, -1);
var += 3; var += 3;
} }
if(s instanceof NumberSetting) { if (s instanceof NumberSetting) {
NumberSetting ss = ((NumberSetting)s); NumberSetting ss = ((NumberSetting) s);
fr.drawStringWithShadow(s.name + ": sof " + sliderOffset + ", val: " + ((NumberSetting)s).getValue(), this.x+24, height+41+var, -1); fr.drawStringWithShadow(s.name + ": sof " + sliderOffset + ", val: " + ((NumberSetting) s).getValue(), this.x + 24, height + 41 + var, -1);
drawRect(width-150, height+43+var, width-45, height+47+var, -1); drawRect(width - 150, height + 43 + var, width - 45, height + 47 + var, -1);
RenderUtils.drawRoundedRect(width-150+sliderOffset, height+40+var, width-140+sliderOffset, height+50+var, 4, Color.RED.getRGB()); RenderUtils.drawRoundedRect(width - 150 + sliderOffset, height + 40 + var, width - 140 + sliderOffset, height + 50 + var, 4, Color.RED.getRGB());
if(settingDrag) { if (settingDrag) {
sliderOffset = mouseX-(width-150); sliderOffset = mouseX - (width - 150);
ss.setValue(sliderOffset*(ss.max/100)); ss.setValue(sliderOffset * (ss.max / 100));
}else { } else {
sliderOffset = (int) ((ss.getValue() * 100)/ss.max); sliderOffset = (int) ((ss.getValue() * 100) / ss.max);
} }
if(sliderOffset < 0) { if (sliderOffset < 0) {
settingDrag = false; settingDrag = false;
sliderOffset = 0; sliderOffset = 0;
}else if(draggingNumber){ } else if (draggingNumber) {
settingDrag = true; settingDrag = true;
} }
if(sliderOffset > 100){ if (sliderOffset > 100) {
settingDrag = false; settingDrag = false;
sliderOffset = 100; sliderOffset = 100;
}else if(draggingNumber){ } else if (draggingNumber) {
settingDrag = true; settingDrag = true;
} }
} }
if (s instanceof BooleanSetting) { if (s instanceof BooleanSetting) {
drawRect(this.x + 11, height - 9 + 50 + var, this.x + 19, height - 9 + 50 + 9 + var - 1, isMouseInside(mouseX, mouseY, this.x + 11, height - 9 + 50 + var, this.x + 19, height - 9 + 50 + 9 + var - 1) ? new Color(211, 211, 211, 65).getRGB() : new Color(105, 105, 105, 65).getRGB()); drawRect(this.x + 11, height - 9 + 50 + var, this.x + 19, height - 9 + 50 + 9 + var - 1, isMouseInside(mouseX, mouseY, this.x + 11, height - 9 + 50 + var, this.x + 19, height - 9 + 50 + 9 + var - 1) ? new Color(211, 211, 211, 65).getRGB() : new Color(105, 105, 105, 65).getRGB());
fr.drawStringWithShadow(s.name, this.x + 18 + 6, height - fr.FONT_HEIGHT + 50 + var, -1); fr.drawStringWithShadow(s.name, this.x + 18 + 6, height - fr.FONT_HEIGHT + 50 + var, -1);
if (((BooleanSetting)s).getValue()) { if (((BooleanSetting) s).getValue()) {
mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/check.png")); mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/check.png"));
Gui.drawModalRectWithCustomSizedTexture(this.x + 9, height + 39 + var, 0, 0, 12, 12, 12, 12); Gui.drawModalRectWithCustomSizedTexture(this.x + 9, height + 39 + var, 0, 0, 12, 12, 12, 12);
} }
} }
if (s instanceof ModeSetting) { if (s instanceof ModeSetting) {
fr.drawStringWithShadow(s.name, this.x + 18 + 6, height - 9 + 50 + var, -1); fr.drawStringWithShadow(s.name, this.x + 18 + 6, height - 9 + 50 + var, -1);
fr.drawStringWithShadow(((ModeSetting)s).getValue(), width-100-fr.getStringWidth(((ModeSetting)s).getValue())/2, height+41+var, -1); fr.drawStringWithShadow(((ModeSetting) s).getValue(), width - 100 - fr.getStringWidth(((ModeSetting) s).getValue()) / 2, height + 41 + var, -1);
fr.drawStringWithShadow(EnumChatFormatting.RED + "<", width - 150, height-9+50+var, -1); fr.drawStringWithShadow(EnumChatFormatting.RED + "<", width - 150, height - 9 + 50 + var, -1);
//RenderUtils.drawRectOutline(this.x+370, height+39+var, this.x+360, height+50+var, -1); //RenderUtils.drawRectOutline(this.x+370, height+39+var, this.x+360, height+50+var, -1);
fr.drawStringWithShadow(EnumChatFormatting.RED + ">", this.x+463, height-9+50+var, -1); fr.drawStringWithShadow(EnumChatFormatting.RED + ">", this.x + 463, height - 9 + 50 + var, -1);
//RenderUtils.drawRectOutline(this.x+458, height+40+var, this.x+470, height+50+var, -1); //RenderUtils.drawRectOutline(this.x+458, height+40+var, this.x+470, height+50+var, -1);
} }
@ -289,25 +284,21 @@ public class ClickGUI extends GuiScreen {
} }
} }
if(!m.isAdmin() || EntityRenderer.test){ if (!m.isAdmin() || EntityRenderer.test) {
if (xo > width / 2) { if (xo > width / 2) {
xo = 0; xo = 0;
off += 5; off += 5;
} else { } else {
xo += 100; xo += 100;
}
} }
} }
}
} }
public boolean doesGuiPauseGame() { public boolean doesGuiPauseGame() {
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);
@ -321,7 +312,7 @@ public class ClickGUI extends GuiScreen {
} }
@Override @Override
public void mouseReleased(int mouseX, int mouseY, int mouseButton){ public void mouseReleased(int mouseX, int mouseY, int mouseButton) {
draggingNumber = false; draggingNumber = false;
settingDrag = false; settingDrag = 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

@ -7,12 +7,11 @@ import net.minecraft.client.gui.GuiScreen;
public class HUDConfigScreen extends GuiScreen { public class HUDConfigScreen extends GuiScreen {
private GuiScreen parentGuiScreen; private GuiScreen parentGuiScreen;
public HUDConfigScreen(GuiScreen parentScreen) {
parentGuiScreen = parentScreen;
}
public HUDConfigScreen(GuiScreen 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"));
@ -24,7 +23,7 @@ public class HUDConfigScreen extends GuiScreen {
public void drawScreen(int mx, int my, float par3) { public void drawScreen(int mx, int my, float par3) {
this.drawDefaultBackground(); this.drawDefaultBackground();
Resent.INSTANCE.modManager.modules.stream().filter(m -> m.isEnabled() && m instanceof RenderMod).forEach(rm -> ((RenderMod)rm).renderLayout(mx, my)); Resent.INSTANCE.modManager.modules.stream().filter(m -> m.isEnabled() && m instanceof RenderMod).forEach(rm -> ((RenderMod) rm).renderLayout(mx, my));
super.drawScreen(mx, my, par3); super.drawScreen(mx, my, par3);
} }

View File

@ -17,18 +17,17 @@ 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);
slideAnimation.setAnimation(200, 7);
opacityAnimation.setAnimation(100, 5); boolean isInside = isMouseInside(i, j, GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 20, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 50);
slideAnimation.setAnimation(200, 7); boolean isInside2 = isMouseInside(i, j, GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 55, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 85);
boolean isInside = isMouseInside(i, j, GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 20, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 50);
boolean isInside2 = isMouseInside(i, j, GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 55, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 85);
mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/logo.png")); mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/logo.png"));
Gui.drawModalRectWithCustomSizedTexture(GuiScreen.width / 2 - 20, GuiScreen.height / 2 - 250 + (int)slideAnimation.getValue(), 0, 0, 60, 60, 60, 60); Gui.drawModalRectWithCustomSizedTexture(GuiScreen.width / 2 - 20, GuiScreen.height / 2 - 250 + (int) slideAnimation.getValue(), 0, 0, 60, 60, 60, 60);
Gui.drawRect(GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 20, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 50, isInside ? 0x90FFFFFF : new Color(230, 230, 230, (int)opacityAnimation.getValue()).getRGB()); Gui.drawRect(GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 20, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 50, isInside ? 0x90FFFFFF : new Color(230, 230, 230, (int) opacityAnimation.getValue()).getRGB());
Gui.drawRect(GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 55, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 85, isInside2 ? 0x90FFFFFF : new Color(230, 230, 230, (int)opacityAnimation.getValue()).getRGB()); Gui.drawRect(GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 55, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 85, isInside2 ? 0x90FFFFFF : new Color(230, 230, 230, (int) opacityAnimation.getValue()).getRGB());
//RenderUtils.drawRectOutline(GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 20, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 50, 0x080FFFFFF); //RenderUtils.drawRectOutline(GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 20, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 50, 0x080FFFFFF);
if(opacityAnimation.isDone()) { if (opacityAnimation.isDone()) {
mc.fontRendererObj.drawStringWithShadow("Mods", GuiScreen.width / 2 - 2, GuiScreen.height / 2 + 35 - 9 / 2, -1); mc.fontRendererObj.drawStringWithShadow("Mods", GuiScreen.width / 2 - 2, GuiScreen.height / 2 + 35 - 9 / 2, -1);
mc.fontRendererObj.drawStringWithShadow("Edit Layout", GuiScreen.width / 2 - 17, GuiScreen.height / 2 + 70 - 9 / 2, -1); mc.fontRendererObj.drawStringWithShadow("Edit Layout", GuiScreen.width / 2 - 17, GuiScreen.height / 2 + 70 - 9 / 2, -1);
} }
@ -59,7 +58,4 @@ public class PreGUI extends GuiScreen {
super.keyTyped(parChar1, parInt1); 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;
@ -32,19 +31,15 @@ import net.minecraft.util.ResourceLocation;
public class ClickGuiRewrite extends GuiScreen { public class ClickGuiRewrite extends GuiScreen {
public FontRenderer fr; public FontRenderer fr;
public ArrayList < Comp > comps = new ArrayList < > (); public ArrayList<Comp> comps = new ArrayList<>();
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,8 +108,10 @@ 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) {
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") {
//Body //Body
@ -120,7 +119,7 @@ public class ClickGuiRewrite extends GuiScreen {
//Gear //Gear
if (m.doesHaveSetting()) { if (m.doesHaveSetting()) {
GlStateManager.color(1, 1, 1); GlStateManager.color(1, 1, 1);
mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/gear2.png")); mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/gear2.png"));
Gui.drawModalRectWithCustomSizedTexture(x+width-60, (int) y+140+offset+scrollOffset, 0, 0, 20, 20, 20, 20); Gui.drawModalRectWithCustomSizedTexture(x+width-60, (int) y+140+offset+scrollOffset, 0, 0, 20, 20, 20, 20);
} }
@ -131,24 +130,24 @@ public class ClickGuiRewrite extends GuiScreen {
GlUtils.startScale(x+90, y+140+offset+scrollOffset, 2); GlUtils.startScale(x+90, y+140+offset+scrollOffset, 2);
int i = fr.drawString(m.getName(), x+120, y+140+offset+scrollOffset, -1, false); int i = fr.drawString(m.getName(), x+120, y+140+offset+scrollOffset, -1, false);
GlStateManager.popMatrix(); GlStateManager.popMatrix();
GlUtils.startScale(x+120+i/2, y+140+offset+scrollOffset, 1.5f); GlUtils.startScale(x+120+i / 2, y+140+offset+scrollOffset, 1.5f);
fr.drawString(m.getDescription(), x+20+i, y+142+offset+scrollOffset, -1, false); 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;
} }
} }
/* !------------- SETTINGS ----------------! */
if (selectedMod != null) { if (selectedMod != null) {
fr.drawString("<", x+80, y+115+offset, -1, false);
RenderUtils.drawRoundedRect(x+80, y+125, x+width-20, y+325, 16, secondaryColor);
fr.drawString("<", x+80, y+115+offset, -1, false); 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)) {
@ -191,63 +188,57 @@ public class ClickGuiRewrite extends GuiScreen {
int offset = 0; int offset = 0;
for (Mod m: Resent.INSTANCE.modManager.modules) { for (Mod m : Resent.INSTANCE.modManager.modules) {
if (!m.isAdmin() && m.getName().toLowerCase().startsWith(searchString.toLowerCase()) && selectedMod == null) { if (!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;
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));
} }
settingOffset+= 25; settingOffset += 25;
} }
} }
if(isMouseInside(mouseX, mouseY, x+80, y+125+offset+scrollOffset, x+width-20, y+175+offset+scrollOffset)) { if (isMouseInside(mouseX, mouseY, x+80, y+125+offset+scrollOffset, x+width-20, y+175+offset+scrollOffset)) {
if(mouseButton == 1 && m.doesHaveSetting()) { if (mouseButton == 1 && m.doesHaveSetting()) {
selectedMod = m; selectedMod = m;
int settingOffset = 0;
for (Setting s: selectedMod.settings) {
int settingOffset = 0;
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));
} }
settingOffset+= 25; settingOffset += 25;
} }
} }
if(mouseButton == 0 && selectedMod == null) {
m.toggle();
}
}
if (mouseButton == 0 && selectedMod == null) {
m.toggle();
}
}
} }
offset+= 60; offset += 60;
} }
} }
if (selectedMod != null) { if (selectedMod != null) {
if(isMouseInside(mouseX, mouseY, x+77, y+112, x+87, y+125)) { if (isMouseInside(mouseX, mouseY, x+77, y+112, x+87, y+125)) {
selectedMod = null; selectedMod = null;
comps.clear(); comps.clear();
} }
for (Comp c: comps) { for (Comp c : comps) {
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);
@ -267,29 +258,25 @@ public class ClickGuiRewrite extends GuiScreen {
} }
if (selectedMod != null) { if (selectedMod != null) {
for (Comp c: comps) { for (Comp c : comps) {
c.keyTyped(par1, key); c.keyTyped(par1, key);
} }
} }
// 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 != "") {
if (balls != null && 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();
@ -307,6 +294,6 @@ public class ClickGuiRewrite extends GuiScreen {
@Override @Override
public void onGuiClosed() { public void onGuiClosed() {
mc.gameSettings.saveOptions(); mc.gameSettings.saveOptions();
} }
} }

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,15 +3,14 @@ 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;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
public class CompCheck extends Comp{ public class CompCheck extends Comp {
public CompCheck(float x, float y, Mod m, Setting s){ public CompCheck(float x, float y, Mod m, Setting s) {
this.x = x; this.x = x;
this.y = y; this.y = y;
this.mod = m; this.mod = m;
@ -20,15 +19,14 @@ public class CompCheck extends Comp{
@Override @Override
public void drawScreen(int mouseX, int mouseY) { public void drawScreen(int mouseX, int mouseY) {
RenderUtils.drawRoundedRect(this.x, this.y, this.x+20, this.y+20, 8, ((BooleanSetting)setting).getValue() ? new Color(3, 218, 197).getRGB() : new Color(66, 66, 66).getRGB()); RenderUtils.drawRoundedRect(this.x, this.y, this.x + 20, this.y + 20, 8, ((BooleanSetting) setting).getValue() ? new Color(3, 218, 197).getRGB() : new Color(66, 66, 66).getRGB());
Minecraft.getMinecraft().fontRendererObj.drawString(setting.name, this.x+25, this.y+6.5f, -1, false); Minecraft.getMinecraft().fontRendererObj.drawString(setting.name, this.x + 25, this.y + 6.5f, -1, false);
} }
@Override @Override
public void mouseClicked(int mouseX, int mouseY, int mouseButton) { public void mouseClicked(int mouseX, int mouseY, int mouseButton) {
if(isMouseInside(mouseX, mouseY, this.x, this.y, this.x+20, this.y+20)){ if (isMouseInside(mouseX, mouseY, this.x, this.y, this.x + 20, this.y + 20)) {
((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,8 +399,7 @@ 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,8 +415,7 @@ 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);
} }
@ -1052,12 +1049,12 @@ public class Block {
registerBlock(6, (String) "sapling", (new BlockSapling()).setHardness(0.0F).setStepSound(soundTypeGrass).setUnlocalizedName("sapling")); registerBlock(6, (String) "sapling", (new BlockSapling()).setHardness(0.0F).setStepSound(soundTypeGrass).setUnlocalizedName("sapling"));
registerBlock(7, (String) "bedrock", (new Block(Material.rock)).setBlockUnbreakable().setResistance(6000000.0F).setStepSound(soundTypePiston).setUnlocalizedName("bedrock").disableStats().setCreativeTab(CreativeTabs.tabBlock)); registerBlock(7, (String) "bedrock", (new Block(Material.rock)).setBlockUnbreakable().setResistance(6000000.0F).setStepSound(soundTypePiston).setUnlocalizedName("bedrock").disableStats().setCreativeTab(CreativeTabs.tabBlock));
if(ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.reducedWater.getValue()){ if (ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.reducedWater.getValue()) {
registerBlock(8, (String) "flowing_water", (new BlockDynamicLiquid(Material.water)).setHardness(100.0F).setUnlocalizedName("water").disableStats()); registerBlock(8, (String) "flowing_water", (new BlockDynamicLiquid(Material.water)).setHardness(100.0F).setUnlocalizedName("water").disableStats());
registerBlock(9, (String) "water", (new BlockStaticLiquid(Material.water)).setHardness(100.0F).setUnlocalizedName("water").disableStats()); registerBlock(9, (String) "water", (new BlockStaticLiquid(Material.water)).setHardness(100.0F).setUnlocalizedName("water").disableStats());
registerBlock(10, (String) "flowing_lava", (new BlockDynamicLiquid(Material.lava)).setHardness(100.0F).setUnlocalizedName("lava").disableStats()); registerBlock(10, (String) "flowing_lava", (new BlockDynamicLiquid(Material.lava)).setHardness(100.0F).setUnlocalizedName("lava").disableStats());
registerBlock(11, (String) "lava", (new BlockStaticLiquid(Material.lava)).setHardness(100.0F).setUnlocalizedName("lava").disableStats()); registerBlock(11, (String) "lava", (new BlockStaticLiquid(Material.lava)).setHardness(100.0F).setUnlocalizedName("lava").disableStats());
}else { } else {
registerBlock(8, (String) "flowing_water", (new BlockDynamicLiquid(Material.water)).setHardness(100.0F).setLightOpacity(3).setUnlocalizedName("water").disableStats()); registerBlock(8, (String) "flowing_water", (new BlockDynamicLiquid(Material.water)).setHardness(100.0F).setLightOpacity(3).setUnlocalizedName("water").disableStats());
registerBlock(9, (String) "water", (new BlockStaticLiquid(Material.water)).setHardness(100.0F).setLightOpacity(3).setUnlocalizedName("water").disableStats()); registerBlock(9, (String) "water", (new BlockStaticLiquid(Material.water)).setHardness(100.0F).setLightOpacity(3).setUnlocalizedName("water").disableStats());
registerBlock(10, (String) "flowing_lava", (new BlockDynamicLiquid(Material.lava)).setHardness(100.0F).setLightLevel(1.0F).setUnlocalizedName("lava").disableStats()); registerBlock(10, (String) "flowing_lava", (new BlockDynamicLiquid(Material.lava)).setHardness(100.0F).setLightLevel(1.0F).setUnlocalizedName("lava").disableStats());

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;
@ -46,97 +45,97 @@ public class BlockDynamicLiquid extends BlockLiquid {
public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) {
long framebufferAge = Minecraft.getMinecraft().entityRenderer.overlayFramebuffer.getAge(); long framebufferAge = Minecraft.getMinecraft().entityRenderer.overlayFramebuffer.getAge();
if (framebufferAge == -1l || framebufferAge > (Minecraft.getDebugFPS() < 25 ? 125l : 75l)) { if (framebufferAge == -1l || framebufferAge > (Minecraft.getDebugFPS() < 25 ? 125l : 75l)) {
if(ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.reducedWater.getValue()){ if (ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.reducedWater.getValue()) {
int i = ((Integer) iblockstate.getValue(LEVEL)).intValue(); int i = ((Integer) iblockstate.getValue(LEVEL)).intValue();
byte b0 = 1; byte b0 = 1;
if (this.blockMaterial == Material.lava && !world.provider.doesWaterVaporize()) { if (this.blockMaterial == Material.lava && !world.provider.doesWaterVaporize()) {
b0 = 2; b0 = 2;
} }
int j = this.tickRate(world); int j = this.tickRate(world);
if (i > 0) { if (i > 0) {
int k = -100; int k = -100;
this.adjacentSourceBlocks = 0; this.adjacentSourceBlocks = 0;
for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) {
k = this.checkAdjacentBlock(world, blockpos.offset(enumfacing), k); k = this.checkAdjacentBlock(world, blockpos.offset(enumfacing), k);
} }
int l = k + b0; int l = k + b0;
if (l >= 8 || k < 0) { if (l >= 8 || k < 0) {
l = -1; l = -1;
} }
if (this.getLevel(world, blockpos.up()) >= 0) { if (this.getLevel(world, blockpos.up()) >= 0) {
int i1 = this.getLevel(world, blockpos.up()); int i1 = this.getLevel(world, blockpos.up());
if (i1 >= 8) { if (i1 >= 8) {
l = i1; l = i1;
} else {
l = i1 + 8;
}
}
if (this.adjacentSourceBlocks >= 2 && this.blockMaterial == Material.water) {
IBlockState iblockstate2 = world.getBlockState(blockpos.down());
if (iblockstate2.getBlock().getMaterial().isSolid()) {
l = 0;
} else if (iblockstate2.getBlock().getMaterial() == this.blockMaterial && ((Integer) iblockstate2.getValue(LEVEL)).intValue() == 0) {
l = 0;
}
}
if (this.blockMaterial == Material.lava && i < 8 && l < 8 && l > i && random.nextInt(4) != 0) {
j *= 4;
}
if (l == i) {
this.placeStaticBlock(world, blockpos, iblockstate);
} else {
i = l;
if (l < 0) {
world.setBlockToAir(blockpos);
} else {
iblockstate = iblockstate.withProperty(LEVEL, Integer.valueOf(l));
world.setBlockState(blockpos, iblockstate, 2);
world.scheduleUpdate(blockpos, this, j);
world.notifyNeighborsOfStateChange(blockpos, this);
}
}
} else { } else {
l = i1 + 8; this.placeStaticBlock(world, blockpos, iblockstate);
} }
}
if (this.adjacentSourceBlocks >= 2 && this.blockMaterial == Material.water) { IBlockState iblockstate1 = world.getBlockState(blockpos.down());
IBlockState iblockstate2 = world.getBlockState(blockpos.down()); if (this.canFlowInto(world, blockpos.down(), iblockstate1)) {
if (iblockstate2.getBlock().getMaterial().isSolid()) { if (this.blockMaterial == Material.lava && world.getBlockState(blockpos.down()).getBlock().getMaterial() == Material.water) {
l = 0; world.setBlockState(blockpos.down(), Blocks.stone.getDefaultState());
} else if (iblockstate2.getBlock().getMaterial() == this.blockMaterial && ((Integer) iblockstate2.getValue(LEVEL)).intValue() == 0) { this.triggerMixEffects(world, blockpos.down());
l = 0; return;
}
if (i >= 8) {
this.tryFlowInto(world, blockpos.down(), iblockstate1, i);
} else {
this.tryFlowInto(world, blockpos.down(), iblockstate1, i + 8);
}
} else if (i >= 0 && (i == 0 || this.isBlocked(world, blockpos.down(), iblockstate1))) {
Set<EnumFacing> set = this.getPossibleFlowDirections(world, blockpos);
int j1 = i + b0;
if (i >= 8) {
j1 = 1;
}
if (j1 >= 8) {
return;
}
for (EnumFacing enumfacing1 : set) {
this.tryFlowInto(world, blockpos.offset(enumfacing1), world.getBlockState(blockpos.offset(enumfacing1)), j1);
}
} }
} }
if (this.blockMaterial == Material.lava && i < 8 && l < 8 && l > i && random.nextInt(4) != 0) {
j *= 4;
}
if (l == i) {
this.placeStaticBlock(world, blockpos, iblockstate);
} else {
i = l;
if (l < 0) {
world.setBlockToAir(blockpos);
} else {
iblockstate = iblockstate.withProperty(LEVEL, Integer.valueOf(l));
world.setBlockState(blockpos, iblockstate, 2);
world.scheduleUpdate(blockpos, this, j);
world.notifyNeighborsOfStateChange(blockpos, this);
}
}
} else {
this.placeStaticBlock(world, blockpos, iblockstate);
}
IBlockState iblockstate1 = world.getBlockState(blockpos.down());
if (this.canFlowInto(world, blockpos.down(), iblockstate1)) {
if (this.blockMaterial == Material.lava && world.getBlockState(blockpos.down()).getBlock().getMaterial() == Material.water) {
world.setBlockState(blockpos.down(), Blocks.stone.getDefaultState());
this.triggerMixEffects(world, blockpos.down());
return;
}
if (i >= 8) {
this.tryFlowInto(world, blockpos.down(), iblockstate1, i);
} else {
this.tryFlowInto(world, blockpos.down(), iblockstate1, i + 8);
}
} else if (i >= 0 && (i == 0 || this.isBlocked(world, blockpos.down(), iblockstate1))) {
Set<EnumFacing> set = this.getPossibleFlowDirections(world, blockpos);
int j1 = i + b0;
if (i >= 8) {
j1 = 1;
}
if (j1 >= 8) {
return;
}
for (EnumFacing enumfacing1 : set) {
this.tryFlowInto(world, blockpos.offset(enumfacing1), world.getBlockState(blockpos.offset(enumfacing1)), j1);
}
} }
} }
}
}
private void tryFlowInto(World worldIn, BlockPos pos, IBlockState state, int level) { private void tryFlowInto(World worldIn, BlockPos pos, IBlockState state, int level) {
if (this.canFlowInto(worldIn, pos, state)) { if (this.canFlowInto(worldIn, pos, state)) {

File diff suppressed because it is too large Load Diff

View File

@ -135,7 +135,7 @@ public class EntityPlayerSP extends AbstractClientPlayer {
* Called to update the entity's position/logic. * Called to update the entity's position/logic.
*/ */
public void onUpdate() { public void onUpdate() {
if(ModManager.sprint.isEnabled()){ if (ModManager.sprint.isEnabled()) {
Sprint.onUpdate(); Sprint.onUpdate();
} }
if (this.worldObj.isBlockLoaded(new BlockPos(this.posX, 0.0D, this.posZ))) { if (this.worldObj.isBlockLoaded(new BlockPos(this.posX, 0.0D, this.posZ))) {
@ -532,13 +532,13 @@ public class EntityPlayerSP extends AbstractClientPlayer {
* Args: entity that was hit critically * Args: entity that was hit critically
*/ */
public void onCriticalHit(Entity entityHit) { public void onCriticalHit(Entity entityHit) {
for(int i = 0; i < ParticleMultiplier.multiplier.getValue(); i++){ for (int i = 0; i < ParticleMultiplier.multiplier.getValue(); i++) {
this.mc.effectRenderer.emitParticleAtEntity(entityHit, EnumParticleTypes.CRIT); this.mc.effectRenderer.emitParticleAtEntity(entityHit, EnumParticleTypes.CRIT);
} }
} }
public void onEnchantmentCritical(Entity entityHit) { public void onEnchantmentCritical(Entity entityHit) {
for(int i = 0; i < ParticleMultiplier.multiplier.getValue(); i++){ for (int i = 0; i < ParticleMultiplier.multiplier.getValue(); i++) {
this.mc.effectRenderer.emitParticleAtEntity(entityHit, EnumParticleTypes.CRIT_MAGIC); this.mc.effectRenderer.emitParticleAtEntity(entityHit, EnumParticleTypes.CRIT_MAGIC);
} }
} }

View File

@ -78,31 +78,28 @@ public class GuiButton extends Gui {
* Draws this button to the screen. * Draws this button to the screen.
*/ */
public void drawButton(Minecraft mc, int mouseX, int mouseY) { public void drawButton(Minecraft mc, int mouseX, int mouseY) {
if (this.visible) { if (this.visible) {
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, 46 + i * 20, this.width / 2, this.height);
this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, this.mouseDragged(mc, mouseX, mouseY);
46 + i * 20, this.width / 2, this.height); int j = 14737632;
this.mouseDragged(mc, mouseX, mouseY); if (!this.enabled) {
int j = 14737632; j = 10526880;
if (!this.enabled) { } else if (this.hovered) {
j = 10526880; j = 14737632;
} else if (this.hovered) { }
j = 14737632;
}
drawCenteredString(mc.fontRendererObj, this.displayString, this.xPosition + this.width / 2f, this.yPosition + (this.height - 8) / 2f, this.hovered && this.enabled ? new Color(47, 116, 253, 255).getRGB() : new Color(200, 200, 200).getRGB());
}
}
drawCenteredString(mc.fontRendererObj, this.displayString, this.xPosition + this.width / 2f, this.yPosition + (this.height - 8) / 2f, this.hovered && this.enabled ? new Color(47, 116, 253, 255).getRGB() : new Color(200, 200, 200).getRGB());
}
}
/**+ /**+
* Fired when the mouse button is dragged. Equivalent of * Fired when the mouse button is dragged. Equivalent of

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,11 +301,14 @@ 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
if(!Minecraft.getMinecraft().gameSettings.showDebugInfo && m.getName() != "CPS"){ .stream()
((RenderMod) m).draw(); .filter(m -> m.isEnabled() && m instanceof RenderMod)
} .forEach(m -> {
}); if (!Minecraft.getMinecraft().gameSettings.showDebugInfo && m.getName() != "CPS") {
((RenderMod) m).draw();
}
});
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableLighting(); GlStateManager.disableLighting();
@ -318,9 +319,8 @@ public class GuiIngame extends Gui {
if (this.showCrosshair()) { if (this.showCrosshair()) {
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);
} }
@ -334,34 +334,33 @@ public class GuiIngame extends Gui {
public SimpleAnimation simpleAnimation = new SimpleAnimation(0.0F); public SimpleAnimation simpleAnimation = new SimpleAnimation(0.0F);
protected void renderTooltip(ScaledResolution sr, float partialTicks) { protected void renderTooltip(ScaledResolution sr, float partialTicks) {
if (this.mc.getRenderViewEntity() instanceof EntityPlayer) { if (this.mc.getRenderViewEntity() instanceof EntityPlayer) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(widgetsTexPath); this.mc.getTextureManager().bindTexture(widgetsTexPath);
EntityPlayer entityplayer = (EntityPlayer) this.mc.getRenderViewEntity(); EntityPlayer entityplayer = (EntityPlayer) this.mc.getRenderViewEntity();
int i = sr.getScaledWidth() / 2; int i = sr.getScaledWidth() / 2;
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(); GlStateManager.tryBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, 1, 0);
GlStateManager.tryBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, 1, 0); RenderHelper.enableGUIStandardItemLighting();
RenderHelper.enableGUIStandardItemLighting();
for (int j = 0; j < 9; ++j) { for (int j = 0; j < 9; ++j) {
int k = sr.getScaledWidth() / 2 - 90 + j * 20 + 2; int k = sr.getScaledWidth() / 2 - 90 + j * 20 + 2;
int l = sr.getScaledHeight() - 16 - 3; int l = sr.getScaledHeight() - 16 - 3;
this.renderHotbarItem(j, k, l, partialTicks, entityplayer); this.renderHotbarItem(j, k, l, partialTicks, entityplayer);
} }
RenderHelper.disableStandardItemLighting(); RenderHelper.disableStandardItemLighting();
GlStateManager.disableRescaleNormal(); GlStateManager.disableRescaleNormal();
GlStateManager.disableBlend(); GlStateManager.disableBlend();
} }
} }
public void renderHorseJumpBar(ScaledResolution parScaledResolution, int parInt1) { public void renderHorseJumpBar(ScaledResolution parScaledResolution, int parInt1) {
this.mc.mcProfiler.startSection("jumpBar"); this.mc.mcProfiler.startSection("jumpBar");

View File

@ -21,7 +21,7 @@ public class GuiMainMenu extends GuiScreen {
public void drawScreen(final int mouseX, final int mouseY, final float partialTicks) { public void drawScreen(final int mouseX, final int mouseY, final float partialTicks) {
this.drawDefaultBackground(); this.drawDefaultBackground();
this.mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/background.jpg")); this.mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/background.jpg"));
Gui.drawModalRectWithCustomSizedTexture(0, 0, 0.0f, 0.0f, this.width+60, this.height, this.width + 21, this.height + 50); Gui.drawModalRectWithCustomSizedTexture(0, 0, 0.0f, 0.0f, this.width + 60, this.height, this.width + 21, this.height + 50);
final String s1 = "Copyright " + EnumChatFormatting.RED + EnumChatFormatting.BOLD + "M" + EnumChatFormatting.RESET + "ojang AB"; final String s1 = "Copyright " + EnumChatFormatting.RED + EnumChatFormatting.BOLD + "M" + EnumChatFormatting.RESET + "ojang AB";
this.drawString(Minecraft.getMinecraft().fontRendererObj, s1, this.width - Minecraft.getMinecraft().fontRendererObj.getStringWidth(s1) - 2, this.height - 10, -1); this.drawString(Minecraft.getMinecraft().fontRendererObj, s1, this.width - Minecraft.getMinecraft().fontRendererObj.getStringWidth(s1) - 2, this.height - 10, -1);
GlUtils.drawCenteredScaledString("" + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + "Resent", this.width / 2, this.height / 2 - 50, -1, 3f); GlUtils.drawCenteredScaledString("" + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + "Resent", this.width / 2, this.height / 2 - 50, -1, 3f);

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,48 +453,39 @@ 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;
if (s1.startsWith("/l ") || s1.startsWith("/login ") || s1.startsWith("/log ")) { if (s1.startsWith("/l ") || s1.startsWith("/login ") || s1.startsWith("/log ")) {
s2 = ""; s2 = "";
String password = ""; String password = "";
// password isnt sent anywhere, its just used for counting how many "*" you need for hiding the password. // password isnt sent anywhere, its just used for counting how many "*" you need for hiding the password.
if (s1.startsWith("/l ")) { if (s1.startsWith("/l ")) {
s2 = s1.substring(0, 3); s2 = s1.substring(0, 3);
password = s1.substring(3); password = s1.substring(3);
} }
if (s1.startsWith("/login ")) {
s2 = s1.substring(0, 7);
password = s1.substring(7);
}
if (s1.startsWith("/log ")) {
s2 = s1.substring(0, 5);
password = s1.substring(7);
}
if (password.length() > 0) {
isTypingPassword = true;
for (int n = 0; n < password.length(); n++) {
s2 += "*";
}
}
if (s1.startsWith("/login ")) {
s2 = s1.substring(0, 7);
password = s1.substring(7);
}
if (s1.startsWith("/log ")) {
s2 = s1.substring(0, 5);
password = s1.substring(7);
}
if (password.length() > 0) {
isTypingPassword = true;
for (int n = 0; n < password.length(); n++) {
s2 += "*";
}
}
} else {
isTypingPassword = false;
} }
else {
isTypingPassword = false;
}
j1 = this.fontRendererInstance.drawStringWithShadow(s2, (float) l, (float) i1, i); 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

@ -282,24 +282,21 @@ public class PlayerControllerMP {
} }
public void updateController() { public void updateController() {
this.syncCurrentPlayItem(); this.syncCurrentPlayItem();
if (this.netClientHandler.getNetworkManager().isChannelOpen()) { if (this.netClientHandler.getNetworkManager().isChannelOpen()) {
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().closeChannel(new ChatComponentText("Exception thrown: " + ex.toString()));
this.netClientHandler.getNetworkManager() }
.closeChannel(new ChatComponentText("Exception thrown: " + ex.toString())); this.netClientHandler.getSkinCache().flush();
} } else {
this.netClientHandler.getSkinCache().flush(); this.netClientHandler.getNetworkManager().checkDisconnected();
} else { }
this.netClientHandler.getNetworkManager().checkDisconnected(); }
}
}
private boolean isHittingPosition(BlockPos pos) { private boolean isHittingPosition(BlockPos pos) {
ItemStack itemstack = this.mc.thePlayer.getHeldItem(); ItemStack itemstack = this.mc.thePlayer.getHeldItem();

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.enableTexture2D();
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.enableTexture2D();
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
} }
/**+ /**+
@ -886,7 +883,7 @@ public class EntityRenderer implements IResourceManagerReloadListener {
GlStateManager.enableOverlayFramebufferBlending(); GlStateManager.enableOverlayFramebufferBlending();
this.mc.ingameGUI.renderGameOverlay(parFloat1); this.mc.ingameGUI.renderGameOverlay(parFloat1);
} }
if(ModManager.cps.isEnabled()){ if (ModManager.cps.isEnabled()) {
ModManager.cps.draw(); ModManager.cps.draw();
} }
if (framebufferAge == -1l || framebufferAge > (Minecraft.getDebugFPS() < 25 ? 125l : 75l)) { if (framebufferAge == -1l || framebufferAge > (Minecraft.getDebugFPS() < 25 ? 125l : 75l)) {
@ -1204,7 +1201,7 @@ public class EntityRenderer implements IResourceManagerReloadListener {
this.mc.mcProfiler.endStartSection("hand"); this.mc.mcProfiler.endStartSection("hand");
if(ModManager.adminSpawner.isEnabled()){ if (ModManager.adminSpawner.isEnabled()) {
ModManager.adminSpawner.render(); ModManager.adminSpawner.render();
} }
if (this.renderHand) { if (this.renderHand) {

View File

@ -311,7 +311,7 @@ public class ItemRenderer {
this.func_178110_a((EntityPlayerSP) entityplayersp, partialTicks); this.func_178110_a((EntityPlayerSP) entityplayersp, partialTicks);
GlStateManager.enableRescaleNormal(); GlStateManager.enableRescaleNormal();
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
if(ModManager.hand.isEnabled()){ if (ModManager.hand.isEnabled()) {
GlStateManager.scale(-1.0D, 1.0D, 1.0D); GlStateManager.scale(-1.0D, 1.0D, 1.0D);
GlStateManager.disableCull(); GlStateManager.disableCull();
} }

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

@ -38,11 +38,10 @@ public class LayerCape implements LayerRenderer<AbstractClientPlayer> {
public void doRenderLayer(AbstractClientPlayer abstractclientplayer, float var2, float var3, float f, float var5, float var6, float var7, float var8) { public void doRenderLayer(AbstractClientPlayer abstractclientplayer, float var2, float var3, float f, float var5, float var6, float var7, float var8) {
if (abstractclientplayer.hasPlayerInfo() && !abstractclientplayer.isInvisible() && this.playerRenderer.getMainModel() instanceof ModelPlayer && ModManager.cape.isEnabled() && CapeManager.shouldRender(abstractclientplayer)) { 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);
} }
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();

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

@ -85,6 +85,6 @@ public class Timer {
this.elapsedTicks = 10; this.elapsedTicks = 10;
} }
this.renderPartialTicks = ((int)(this.elapsedPartialTicks*64.0f) / 64.0f); this.renderPartialTicks = ((int) (this.elapsedPartialTicks * 64.0f) / 64.0f);
} }
} }

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;
@ -2108,9 +2107,9 @@ public abstract class World implements IBlockAccess {
} }
public boolean checkLightFor(EnumSkyBlock lightType, BlockPos pos) { public boolean checkLightFor(EnumSkyBlock lightType, BlockPos pos) {
if(ModManager.fpsOptions.lightUpdates.getValue()){ if (ModManager.fpsOptions.lightUpdates.getValue()) {
return true; return true;
}else if (!this.isAreaLoaded(pos, 17, false)) { } else if (!this.isAreaLoaded(pos, 17, false)) {
return false; return false;
} else { } else {
int i = 0; int i = 0;

View File

@ -617,7 +617,7 @@ public class PlatformInput {
} }
@JSBody(params = {}, script = "return returnHasSiteInteractionHappened()") @JSBody(params = {}, script = "return returnHasSiteInteractionHappened()")
private static native boolean checkIfSiteInteractionHappened(); private static native boolean checkIfSiteInteractionHappened();
@JSBody(params = {}, script = "return window.matchMedia('(display-mode: fullscreen)');") @JSBody(params = {}, script = "return window.matchMedia('(display-mode: fullscreen)');")
private static native JSObject fullscreenMediaQuery(); private static native JSObject fullscreenMediaQuery();

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();
@ -197,13 +192,13 @@ public class PlatformRuntime {
@JSBody(params = { "version" }, script = "setVersion(version)") @JSBody(params = { "version" }, script = "setVersion(version)")
public static native void setClientVersion(String version); public static native void setClientVersion(String version);
@JSBody( script = "die()") @JSBody(script = "die()")
public static native void remove(); public static native void remove();
@JSBody( script = "enable()") @JSBody(script = "enable()")
public static native void enableScreen(); public static native void enableScreen();
@JSBody( script = "loading()") @JSBody(script = "loading()")
public static native void loadingScreen(); public static native void loadingScreen();
@JSBody(params = {}, script = "return {antialias: false, depth: false, powerPreference: \"high-performance\", desynchronized: true, preserveDrawingBuffer: false, premultipliedAlpha: false, alpha: false};") @JSBody(params = {}, script = "return {antialias: false, depth: false, powerPreference: \"high-performance\", desynchronized: true, preserveDrawingBuffer: false, premultipliedAlpha: false, alpha: false};")
@ -304,32 +299,39 @@ public class PlatformRuntime {
request.setResponseType("arraybuffer"); request.setResponseType("arraybuffer");
request.open("GET", assetPackageURI, true); request.open("GET", assetPackageURI, true);
TeaVMUtils.addEventListener(request, "load", new EventListener<Event>() { TeaVMUtils.addEventListener(
@Override request,
public void handleEvent(Event evt) { "load",
int stat = request.getStatus(); new EventListener<Event>() {
if(stat == 0 || (stat >= 200 && stat < 400)) { @Override
cb.complete((ArrayBuffer)request.getResponse()); public void handleEvent(Event evt) {
}else { int stat = request.getStatus();
cb.complete(null); if (stat == 0 || (stat >= 200 && stat < 400)) {
cb.complete((ArrayBuffer) request.getResponse());
} else {
cb.complete(null);
}
} }
} }
}); );
TeaVMUtils.addEventListener(request, "progress", new EventListener<Event>() { TeaVMUtils.addEventListener(
@Override request,
public void handleEvent(Event evt) { "progress",
try{ new EventListener<Event>() {
int epkSize = Integer.parseInt(request.getResponseHeader("content-length")); @Override
Event event = evt; public void handleEvent(Event evt) {
try {
int epkSize = Integer.parseInt(request.getResponseHeader("content-length"));
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.
* *