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) {
if (!parString2.isEmpty()) {
// stfu pls
// stfu pls
//logger.error("Error in class \"{}\"!", parString1);
//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)
public @interface Module {
String name() default "No name set";
String description() default "No description set.";
Category category() default Category.MISC;
boolean hasSetting() default false;
}

View File

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

View File

@ -4,22 +4,22 @@ import dev.resent.util.render.Color;
public class ClientInfo {
public static final String name = "Resent";
public static final String version = "3.6";
public static final String author = "Nitwit";
public static final String release = Release.STABLE.name;
public static final String name = "Resent";
public static final String version = "3.6";
public static final String author = "Nitwit";
public static final String release = Release.STABLE.name;
public static final int primaryColor = new Color(66, 66, 66).getRGB();
public static final int secondaryColor = new Color(117, 117, 117).getRGB();
public enum Release {
BETA("Beta"),
STABLE("Stable");
String name;
Release(String name) {
this.name = name;
}
}
public static final int primaryColor = new Color(66, 66, 66).getRGB();
public static final int secondaryColor = new Color(117, 117, 117).getRGB();
public enum Release {
BETA("Beta"),
STABLE("Stable");
String name;
Release(String name) {
this.name = name;
}
}
}

View File

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

View File

@ -1,14 +1,13 @@
package dev.resent.client;
import java.io.PrintWriter;
import dev.resent.module.base.RenderMod;
import dev.resent.module.base.setting.BooleanSetting;
import dev.resent.module.base.setting.ModeSetting;
import dev.resent.module.base.setting.NumberSetting;
import java.io.PrintWriter;
public class SaveUtil {
public void save(PrintWriter printwriter) {
Resent.INSTANCE.modManager.modules
.stream()
@ -29,9 +28,9 @@ public class SaveUtil {
if (s instanceof BooleanSetting) {
printwriter.println(m.getName() + "_boolsetting_" + s.name + ":" + ((BooleanSetting) s).getValue());
}
if(s instanceof NumberSetting){
NumberSetting ss = ((NumberSetting)s);
printwriter.println(m.getName() + "_numsetting_" + s.name + ":" + String.valueOf(ss.getValue()).substring(0, (String.valueOf(ss.getValue()).length())-2));
if (s instanceof NumberSetting) {
NumberSetting ss = ((NumberSetting) s);
printwriter.println(m.getName() + "_numsetting_" + s.name + ":" + String.valueOf(ss.getValue()).substring(0, (String.valueOf(ss.getValue()).length()) - 2));
}
});
});
@ -73,13 +72,12 @@ public class SaveUtil {
((BooleanSetting) se).setValue(astring[1].equals("true"));
}
}
if(se instanceof NumberSetting){
if(astring[0].equals(m.getName()+"_numsetting_"+se.name)){
((NumberSetting)se).value = Integer.parseInt(astring[1]);
if (se instanceof NumberSetting) {
if (astring[0].equals(m.getName() + "_numsetting_" + se.name)) {
((NumberSetting) se).value = Integer.parseInt(astring[1]);
}
}
});
});
}
}

View File

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

View File

@ -1,9 +1,5 @@
package dev.resent.module.base;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.impl.hud.ArmorHud;
import dev.resent.module.impl.hud.BPS;
@ -41,6 +37,9 @@ import dev.resent.module.impl.setting.NoParticles;
import dev.resent.module.impl.setting.NoRain;
import dev.resent.module.impl.setting.NoSwingDelay;
import dev.resent.module.impl.setting.SelfNametag;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
public class ModManager {
@ -79,13 +78,13 @@ public class ModManager {
public static ItemPhysics itemPhysics = new ItemPhysics();
public static FPSOptions fpsOptions = new FPSOptions();
public static AdminRay adminRay = new AdminRay();
public static AdminSpawner adminSpawner =new AdminSpawner();
public static AdminSpawner adminSpawner = new AdminSpawner();
public static ParticleMultiplier particleMultiplier = new ParticleMultiplier();
public static Hand hand;
//public static Crosshair crosshair = new Crosshair();
public ModManager() {
//Hud
//register(crosshair = new Crosshair());
register(hand = new Hand());
@ -129,10 +128,10 @@ public class ModManager {
}
public ArrayList<Mod> modsInCategory(Category c) {
if(c == null) {
return (ArrayList<Mod>) modules;
}
if (c == null) {
return (ArrayList<Mod>) modules;
}
ArrayList<Mod> inCat = (ArrayList<Mod>) this.modules.stream().filter(m -> m.getCategory() == c).collect(Collectors.toList());
return inCat;

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);
RenderUtils.drawRectOutline(this.x, this.y, this.x + this.getWidth(), this.y + this.getHeight(), -1);
mc.fontRendererObj.drawStringWithShadow(getName(), this.x, this.y - 10, new Color(255,255,255).getRGB());
mc.fontRendererObj.drawStringWithShadow(getName(), this.x, this.y - 10, new Color(255, 255, 255).getRGB());
final boolean mouseOverX = (mouseX >= this.getX() && mouseX <= this.getX() + this.getWidth());
final boolean mouseOverY = (mouseY >= this.getY() && mouseY <= this.getY() + this.getHeight());

View File

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

View File

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

View File

@ -20,7 +20,7 @@ public class NumberSetting extends Setting {
this.min = min;
this.max = max;
}
public void incr() {
if (value + increment >= max) {
value = max;
@ -41,7 +41,7 @@ public class NumberSetting extends Setting {
return value;
}
public float getInitialValue(){
public float getInitialValue() {
return initValue;
}

View File

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

View File

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

View File

@ -1,27 +1,30 @@
package dev.resent.module.impl.hud;
import java.text.DecimalFormat;
import dev.resent.annotation.RenderModule;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.RenderMod;
import java.text.DecimalFormat;
@RenderModule(name = "BPS", category = Category.HUD, x = 4, y = 16, description = "See your current blocks per second")
public class BPS extends RenderMod{
public class BPS extends RenderMod {
public int getWidth() { return mc.fontRendererObj.getStringWidth(getText()) + 4;}
public int getHeight(){ return 13; }
public int getWidth() {
return mc.fontRendererObj.getStringWidth(getText()) + 4;
}
public int getHeight() {
return 13;
}
public double getBPS() {
return mc.thePlayer.getDistance(mc.thePlayer.lastTickPosX, mc.thePlayer.lastTickPosY, mc.thePlayer.lastTickPosZ) * (mc.timer.ticksPerSecond * mc.timer.timerSpeed);
}
public String getText(){
public String getText() {
return "[BPS: " + new DecimalFormat("0.##").format(getBPS()) + "]";
}
public void draw(){
drawString(getText(), x+2, y+2);
public void draw() {
drawString(getText(), x + 2, y + 2);
}
}

View File

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

View File

@ -8,14 +8,13 @@ import dev.resent.module.base.setting.ModeSetting;
import dev.resent.module.base.setting.NumberSetting;
@Module(name = "ClickGUI", category = Category.HUD, hasSetting = true, description = "Customize Resent's UI")
public class ClickGui extends Mod{
public class ClickGui extends Mod {
public BooleanSetting scroll = new BooleanSetting("Smooth scroll", "", false);
public ModeSetting guiTheme = new ModeSetting("Gui theme", "New", "New", "Classic revised");
public NumberSetting test = new NumberSetting("Test, ignore!", "", 50, 1, 200, 5, 5);
public ClickGui(){
public ClickGui() {
addSetting(scroll, guiTheme);
}
}

View File

@ -2,8 +2,8 @@ package dev.resent.module.impl.hud;
import dev.resent.annotation.RenderModule;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.setting.BooleanSetting;
import dev.resent.module.base.RenderMod;
import dev.resent.module.base.setting.BooleanSetting;
import dev.resent.util.render.Color;
import dev.resent.visual.ui.Theme;
import net.minecraft.util.BlockPos;
@ -19,18 +19,14 @@ public class Info extends RenderMod {
public BooleanSetting direction = new BooleanSetting("Direction", "", true);
public static final String[] directionsF = new String[] { "\u00A79S\u00A7r", "\u00A72W\u00A7r", "\u00A74N\u00A7r", "\u00A76E\u00A7r" };
public int[] getPositions(){
int[] poses = new int[]{
(int)mc.thePlayer.posX,
(int)mc.thePlayer.posY,
(int)mc.thePlayer.posZ,
};
public int[] getPositions() {
int[] poses = new int[] { (int) mc.thePlayer.posX, (int) mc.thePlayer.posY, (int) mc.thePlayer.posZ };
return poses;
}
public int getWidth() {
return 5 + mc.fontRendererObj.getStringWidth(" X: Biome:" + mc.theWorld.getBiomeGenForCoords(new BlockPos(getPositions()[0], getPositions()[1], getPositions()[2])).biomeName + Math.max(getPositions()[0], Math.max(getPositions()[1], getPositions()[2])));
return 5 + mc.fontRendererObj.getStringWidth(" X: Biome:" + mc.theWorld.getBiomeGenForCoords(new BlockPos(getPositions()[0], getPositions()[1], getPositions()[2])).biomeName + Math.max(getPositions()[0], Math.max(getPositions()[1], getPositions()[2])));
}
public int getHeight() {
@ -46,9 +42,9 @@ public class Info extends RenderMod {
drawString(" Y: " + getPositions()[1], this.x + 5, this.y + 24);
drawString(" Z: " + getPositions()[2], this.x + 5, this.y + 34);
if (direction.getValue()){
if (direction.getValue()) {
drawString(" Dir: ", this.x + 5 + mc.fontRendererObj.getStringWidth(" X: " + getPositions()[0]), this.y + 14);
mc.fontRendererObj.drawString(directionsF[rot], this.x+5+mc.fontRendererObj.getStringWidth(" X: Dir: " + getPositions()[0]), this.y + 14, -1, Theme.getTextShadow());
mc.fontRendererObj.drawString(directionsF[rot], this.x + 5 + mc.fontRendererObj.getStringWidth(" X: Dir: " + getPositions()[0]), this.y + 14, -1, Theme.getTextShadow());
}
drawString(" Biome: " + mc.theWorld.getBiomeGenForCoords(new BlockPos(getPositions()[0], getPositions()[1], getPositions()[2])).biomeName, this.x + 5, this.y + 44);
}

View File

@ -6,11 +6,11 @@ import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.setting.NumberSetting;
@Module(name = "ItemPhysics", category = Category.MISC, hasSetting = true, description = "Give items physics!")
public class ItemPhysics extends Mod{
public class ItemPhysics extends Mod {
public static NumberSetting speed = new NumberSetting("Speed", "", 2, 1, 8, 1, 1);
public ItemPhysics(){
public ItemPhysics() {
addSetting(speed);
}
}

View File

@ -1,8 +1,5 @@
package dev.resent.module.impl.hud;
import java.util.ArrayList;
import java.util.List;
import dev.resent.annotation.RenderModule;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.RenderMod;
@ -11,6 +8,8 @@ import dev.resent.module.base.setting.ModeSetting;
import dev.resent.util.misc.FuncUtils;
import dev.resent.util.render.Color;
import dev.resent.util.render.RenderUtils;
import java.util.ArrayList;
import java.util.List;
import net.lax1dude.eaglercraft.v1_8.Mouse;
import net.minecraft.client.Minecraft;

View File

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

View File

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

View File

@ -11,42 +11,43 @@ import net.minecraft.tileentity.TileEntityMobSpawner;
import net.minecraft.util.AxisAlignedBB;
@Module(name = "Spawn", category = Category.HUD)
public class AdminSpawner extends Mod {
public void render(){
for(Object o: mc.theWorld.loadedTileEntityList) {
if(o instanceof TileEntityMobSpawner && this.isEnabled()) {
box(((TileEntityMobSpawner)o));
public void render() {
for (Object o : mc.theWorld.loadedTileEntityList) {
if (o instanceof TileEntityMobSpawner && this.isEnabled()) {
box(((TileEntityMobSpawner) o));
}
}
}
public static void box(TileEntityMobSpawner entity){
GlStateManager.blendFunc(770, 771);
GlStateManager.enableBlend();
EaglercraftGPU.glLineWidth(4.0F);
GlStateManager.disableTexture2D();
GlStateManager.disableDepth();
GlStateManager.depthMask(false);
GlStateManager.color(1F, 0.5F, 0.5F, 0.5F);
Minecraft.getMinecraft().getRenderManager();
RenderGlobal.func_181561_a(
new AxisAlignedBB(
entity.getPos().getX()-Minecraft.getMinecraft().getRenderManager().renderPosX+0.1,
entity.getPos().getY()-Minecraft.getMinecraft().getRenderManager().renderPosY+0.1,
entity.getPos().getZ()-Minecraft.getMinecraft().getRenderManager().renderPosZ+0.1,
entity.getPos().getX() -Minecraft.getMinecraft().getRenderManager().renderPosX+0.9,
entity.getPos().getY() -Minecraft.getMinecraft().getRenderManager().renderPosY+0.9,
entity.getPos().getZ()-Minecraft.getMinecraft().getRenderManager().renderPosZ+0.9));
GlStateManager.enableTexture2D();
GlStateManager.enableDepth();
GlStateManager.depthMask(true);
GlStateManager.disableBlend();
}
public static void box(TileEntityMobSpawner entity) {
GlStateManager.blendFunc(770, 771);
GlStateManager.enableBlend();
EaglercraftGPU.glLineWidth(4.0F);
GlStateManager.disableTexture2D();
GlStateManager.disableDepth();
GlStateManager.depthMask(false);
GlStateManager.color(1F, 0.5F, 0.5F, 0.5F);
Minecraft.getMinecraft().getRenderManager();
RenderGlobal.func_181561_a(
new AxisAlignedBB(
entity.getPos().getX() - Minecraft.getMinecraft().getRenderManager().renderPosX + 0.1,
entity.getPos().getY() - Minecraft.getMinecraft().getRenderManager().renderPosY + 0.1,
entity.getPos().getZ() - Minecraft.getMinecraft().getRenderManager().renderPosZ + 0.1,
entity.getPos().getX() - Minecraft.getMinecraft().getRenderManager().renderPosX + 0.9,
entity.getPos().getY() - Minecraft.getMinecraft().getRenderManager().renderPosY + 0.9,
entity.getPos().getZ() - Minecraft.getMinecraft().getRenderManager().renderPosZ + 0.9
)
);
GlStateManager.enableTexture2D();
GlStateManager.enableDepth();
GlStateManager.depthMask(true);
GlStateManager.disableBlend();
}
@Override
public boolean isAdmin(){
return true;
}
}
@Override
public boolean isAdmin() {
return true;
}
}

View File

@ -7,15 +7,16 @@ import dev.resent.module.base.setting.CustomRectSettingDraw;
import dev.resent.visual.cape.CapeUi;
@Module(name = "Cape", category = Category.MISC, hasSetting = true)
public class Cape extends Mod{
public CustomRectSettingDraw open = new CustomRectSettingDraw("Choose cape", "Select which cape you want to use"){
public class Cape extends Mod {
public CustomRectSettingDraw open = new CustomRectSettingDraw("Choose cape", "Select which cape you want to use") {
@Override
public void onPress(){
public void onPress() {
mc.displayGuiScreen(new CapeUi());
}
};
public Cape(){
public Cape() {
addSetting(open);
}
}

View File

@ -7,15 +7,16 @@ import dev.resent.module.base.setting.CustomRectSettingDraw;
import dev.resent.visual.crosshair.CrosshairUi;
@Module(name = "Crosshair", category = Category.MISC, hasSetting = true)
public class Crosshair extends Mod{
public CustomRectSettingDraw open = new CustomRectSettingDraw("Choose crosshair", "Select which crosshair you want to use"){
public class Crosshair extends Mod {
public CustomRectSettingDraw open = new CustomRectSettingDraw("Choose crosshair", "Select which crosshair you want to use") {
@Override
public void onPress(){
public void onPress() {
mc.displayGuiScreen(new CrosshairUi());
}
};
public Crosshair(){
public Crosshair() {
addSetting(open);
}
}

View File

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

View File

@ -7,12 +7,13 @@ import dev.resent.module.base.setting.BooleanSetting;
import dev.resent.module.base.setting.NumberSetting;
@Module(name = "Particles Mod", category = Category.MISC, hasSetting = true)
public class ParticleMultiplier extends Mod{
public class ParticleMultiplier extends Mod {
public static BooleanSetting alwaysCrit = new BooleanSetting("Always critical", "", false);
public static BooleanSetting alwaysSharp = new BooleanSetting("Always sharpness", "", false);
public static NumberSetting multiplier = new NumberSetting("Multiplier", "", 1, 1, 50, 1, 1);
public ParticleMultiplier(){
public ParticleMultiplier() {
addSetting(alwaysCrit, alwaysSharp, multiplier);
}
}

View File

@ -14,9 +14,9 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@Module(name = "Reach circle", category = Category.MISC)
public class ReachCircle extends Mod{
public class ReachCircle extends Mod {
public void uwu(float partialTicks){
public void uwu(float partialTicks) {
GlStateManager.pushMatrix();
mc.entityRenderer.disableLightmap();
GlStateManager.disableTexture2D();
@ -26,7 +26,7 @@ public class ReachCircle extends Mod{
//PlatformOpenGL._wglEnable(2848);
GlStateManager.depthMask(false);
for(Entity entity : mc.theWorld.loadedEntityList){
for (Entity entity : mc.theWorld.loadedEntityList) {
if (((EntityLivingBase) entity).canEntityBeSeen(mc.thePlayer) && !entity.isInvisible() && entity instanceof EntityPlayer) {
double posX = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * partialTicks - mc.getRenderManager().viewerPosX;
double posY = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * partialTicks - mc.getRenderManager().viewerPosY;
@ -43,15 +43,15 @@ public class ReachCircle extends Mod{
GlStateManager.enableTexture2D();
mc.entityRenderer.enableLightmap();
GlStateManager.popMatrix();
}
}
public void circle(double x, double y, double z, double rad) {
GlStateManager.pushMatrix();
Color color = new Color(255, 0, 0);
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
EaglercraftGPU.glLineWidth(2);
setColor(color.getRGB(), (color.getRGB() >> 24 & 255) / 255.0F);
worldrenderer.begin(3, DefaultVertexFormats.POSITION);

View File

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

View File

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

View File

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

View File

@ -5,13 +5,11 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Base64;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.UnsupportedAudioFileException;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.ISound;
import net.minecraft.client.audio.PositionedSoundRecord;
@ -22,7 +20,7 @@ public class SoundManager {
FileOutputStream fos = null;
File temp;
public void playSound(String base64) throws UnsupportedEncodingException{
public void playSound(String base64) throws UnsupportedEncodingException {
byte[] byteArray = Base64.getDecoder().decode(new String(base64).getBytes("UTF-8"));
this.playSound(byteArray);
}
@ -43,7 +41,6 @@ public class SoundManager {
Clip clip = AudioSystem.getClip();
clip.open(audioInputStream);
clip.start();
} catch (IOException ioe) {
ioe.printStackTrace();
} catch (UnsupportedAudioFileException e) {
@ -62,7 +59,7 @@ public class SoundManager {
}
// <3
public void playDemo(){
public void playDemo() {
ISound sound = PositionedSoundRecord.create(new ResourceLocation("minecraft:music.res"), 1);
Minecraft.getMinecraft().getSoundHandler().stopSounds();
Minecraft.getMinecraft().getSoundHandler().playSound(sound);

View File

@ -3,7 +3,6 @@ package dev.resent.util.misc;
import java.util.Collection;
import java.util.Iterator;
import java.util.function.Predicate;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
public class FuncUtils {
@ -22,14 +21,14 @@ public class FuncUtils {
public static boolean isInside(int mouseX, int mouseY, double x, double y, double width, double height) {
return (mouseX > x && mouseX < (x + width)) && (mouseY > y && mouseY < (y + height));
}
}
public static void setColor(int color) {
float f3 = (float) (color >> 24 & 255) / 255.0F;
float f = (float) (color >> 16 & 255) / 255.0F;
float f1 = (float) (color >> 8 & 255) / 255.0F;
float f2 = (float) (color & 255) / 255.0F;
GlStateManager.color(f, f1, f2, f3);
}
}

View File

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

View File

@ -18,57 +18,48 @@ public class RenderItemPhysics {
ItemStack itemstack = itemIn.getEntityItem();
Item item = itemstack.getItem();
Block block = Block.getBlockFromItem(item);
if (item == null)
{
if (item == null) {
return 0;
}
else
{
} else {
boolean flag = p_177077_9_.isGui3d();
int i = func_177078_a;
if(ModManager.itemPhysics.isEnabled()) {
if(block != null) {
GlStateManager.translate((float)p_177077_2_, (float)p_177077_4_ + 0.15F, (float)p_177077_6_);
}else {
GlStateManager.translate((float)p_177077_2_, (float)p_177077_4_ + 0.02F, (float)p_177077_6_);
if (ModManager.itemPhysics.isEnabled()) {
if (block != null) {
GlStateManager.translate((float) p_177077_2_, (float) p_177077_4_ + 0.15F, (float) p_177077_6_);
} else {
GlStateManager.translate((float) p_177077_2_, (float) p_177077_4_ + 0.02F, (float) p_177077_6_);
GlStateManager.rotate(-90F, 1F, 0F, 0F);
}
}else {
float f1 = MathHelper.sin(((float)itemIn.getAge() + p_177077_8_) / 10.0F + itemIn.hoverStart) * 0.1F + 0.1F;
}
} else {
float f1 = MathHelper.sin(((float) itemIn.getAge() + p_177077_8_) / 10.0F + itemIn.hoverStart) * 0.1F + 0.1F;
float f2 = p_177077_9_.getItemCameraTransforms().getTransform(ItemCameraTransforms.TransformType.GROUND).scale.y;
GlStateManager.translate((float)p_177077_2_, (float)p_177077_4_ + f1 + 0.25F * f2, (float)p_177077_6_);
GlStateManager.translate((float) p_177077_2_, (float) p_177077_4_ + f1 + 0.25F * f2, (float) p_177077_6_);
}
if(!ModManager.itemPhysics.isEnabled()) {
if (flag || Minecraft.getMinecraft().getRenderManager().options != null)
{
float f3 = (((float)itemIn.getAge() + p_177077_8_) / 20.0F + itemIn.hoverStart) * (180F / (float)Math.PI);
if (!ModManager.itemPhysics.isEnabled()) {
if (flag || Minecraft.getMinecraft().getRenderManager().options != null) {
float f3 = (((float) itemIn.getAge() + p_177077_8_) / 20.0F + itemIn.hoverStart) * (180F / (float) Math.PI);
GlStateManager.rotate(f3, 0.0F, 1.0F, 0.0F);
}
}
if (!flag)
{
float f6 = -0.0F * (float)(i - 1) * 0.5F;
float f4 = -0.0F * (float)(i - 1) * 0.5F;
float f5 = -0.046875F * (float)(i - 1) * 0.5F;
if (!flag) {
float f6 = -0.0F * (float) (i - 1) * 0.5F;
float f4 = -0.0F * (float) (i - 1) * 0.5F;
float f5 = -0.046875F * (float) (i - 1) * 0.5F;
GlStateManager.translate(f6, f4, f5);
}
if(ModManager.itemPhysics.isEnabled() && !itemIn.onGround) {
float angle = System.currentTimeMillis() % (360 * 20) / (float) (4.5 - ItemPhysics.speed.getValue()/2);
GlStateManager.rotate(angle, 1F, 1F, 1F);
if (ModManager.itemPhysics.isEnabled() && !itemIn.onGround) {
float angle = System.currentTimeMillis() % (360 * 20) / (float) (4.5 - ItemPhysics.speed.getValue() / 2);
GlStateManager.rotate(angle, 1F, 1F, 1F);
}
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
return i;
}
}
}
}

View File

@ -77,21 +77,20 @@ public class RenderUtils {
paramYEnd = z;
}
double x1 = (double)(paramXStart + radius);
double y1 = (double)(paramYStart + radius);
double x2 = (double)(paramXEnd - radius);
double y2 = (double)(paramYEnd - radius);
double x1 = (double) (paramXStart + radius);
double y1 = (double) (paramYStart + radius);
double x2 = (double) (paramXEnd - radius);
double y2 = (double) (paramYEnd - radius);
if (popPush)
GlStateManager.pushMatrix();
if (popPush) GlStateManager.pushMatrix();
GlStateManager.enableBlend();
GlStateManager.enableTexture2D();
GlStateManager.blendFunc(RealOpenGLEnums.GL_SRC_ALPHA, RealOpenGLEnums.GL_ONE_MINUS_SRC_ALPHA);
EaglercraftGPU.glLineWidth(1);
//glEnable(GL_LINE_SMOOTH);
GlStateManager.color(red, green, blue, alpha);
GlStateManager.color(red, green, blue, alpha);
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
@ -99,24 +98,19 @@ public class RenderUtils {
worldrenderer.begin(RealOpenGLEnums.GL_LINE_SMOOTH, DefaultVertexFormats.POSITION_TEX);
double degree = Math.PI / 180;
for (double i = 0; i <= 90; i += 1)
glVertex2d(x2 + Math.sin(i * degree) * radius, y2 + Math.cos(i * degree) * radius);
for (double i = 90; i <= 180; i += 1)
glVertex2d(x2 + Math.sin(i * degree) * radius, y1 + Math.cos(i * degree) * radius);
for (double i = 180; i <= 270; i += 1)
glVertex2d(x1 + Math.sin(i * degree) * radius, y1 + Math.cos(i * degree) * radius);
for (double i = 270; i <= 360; i += 1)
glVertex2d(x1 + Math.sin(i * degree) * radius, y2 + Math.cos(i * degree) * radius);
for (double i = 0; i <= 90; i += 1) glVertex2d(x2 + Math.sin(i * degree) * radius, y2 + Math.cos(i * degree) * radius);
for (double i = 90; i <= 180; i += 1) glVertex2d(x2 + Math.sin(i * degree) * radius, y1 + Math.cos(i * degree) * radius);
for (double i = 180; i <= 270; i += 1) glVertex2d(x1 + Math.sin(i * degree) * radius, y1 + Math.cos(i * degree) * radius);
for (double i = 270; i <= 360; i += 1) glVertex2d(x1 + Math.sin(i * degree) * radius, y2 + Math.cos(i * degree) * radius);
EaglercraftGPU.glEndList();
GlStateManager.enableTexture2D();
GlStateManager.disableBlend();
//glDisable(GL_LINE_SMOOTH);
if (popPush)
GlStateManager.popMatrix();
if (popPush) GlStateManager.popMatrix();
}
public static void glVertex2d(double idk, double idk2){
public static void glVertex2d(double idk, double idk2) {
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.pos(idk, idk2, 0);
@ -134,7 +128,6 @@ public class RenderUtils {
Gui.drawRect((int) paramInt1, (int) paramInt2, (int) paramInt3, (int) paramInt4, color);
}
}
public static void drawRoundedRect(final float paramFloat1, final float paramFloat2, final float paramFloat3, final float paramFloat4, final float paramFloat5) {
final int i = 18;

View File

@ -10,7 +10,7 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
public class RoundedUtil {
final static Minecraft mc = Minecraft.getMinecraft();
static final Minecraft mc = Minecraft.getMinecraft();
public static void drawSmoothRoundedRect(float x, float y, float x1, float y1, float radius, int color) {
Tessellator tessellator = Tessellator.getInstance();
@ -29,24 +29,16 @@ public class RoundedUtil {
GlStateManager.color(red, green, blue, alpha);
worldrenderer.begin(RealOpenGLEnums.GL_POLYGON, DefaultVertexFormats.POSITION_TEX);
int i;
for (i = 0; i <= 90; i += 3)
glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y + radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D);
for (i = 90; i <= 180; i += 3)
glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D);
for (i = 0; i <= 90; i += 3)
glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius);
for (i = 90; i <= 180; i += 3)
glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y + radius + Math.cos(i * Math.PI / 180.0D) * radius);
for (i = 0; i <= 90; i += 3) glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y + radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D);
for (i = 90; i <= 180; i += 3) glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D);
for (i = 0; i <= 90; i += 3) glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius);
for (i = 90; i <= 180; i += 3) glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y + radius + Math.cos(i * Math.PI / 180.0D) * radius);
tessellator.draw();
worldrenderer.begin(RealOpenGLEnums.GL_LINE_LOOP, DefaultVertexFormats.POSITION_TEX);
for (i = 0; i <= 90; i += 3)
glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y + radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D);
for (i = 90; i <= 180; i += 3)
glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D);
for (i = 0; i <= 90; i += 3)
glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius);
for (i = 90; i <= 180; i += 3)
glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y + radius + Math.cos(i * Math.PI / 180.0D) * radius);
for (i = 0; i <= 90; i += 3) glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y + radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D);
for (i = 90; i <= 180; i += 3) glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D);
for (i = 0; i <= 90; i += 3) glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius);
for (i = 90; i <= 180; i += 3) glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y + radius + Math.cos(i * Math.PI / 180.0D) * radius);
tessellator.draw();
GlStateManager.enableTexture2D();
GlStateManager.disableBlend();
@ -54,10 +46,11 @@ public class RoundedUtil {
GlStateManager.scale(2.0D, 2.0D, 2.0D);
EaglercraftGPU.glLineWidth(1);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
}
public static void drawRoundedRect(float x, float y, float x1, float y1, float radius, int color) {
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
GlStateManager.scale(0.5D, 0.5D, 0.5D);
x *= 2.0D;
y *= 2.0D;
@ -73,14 +66,10 @@ public class RoundedUtil {
GlStateManager.color(red, green, blue, alpha);
worldrenderer.begin(RealOpenGLEnums.GL_POLYGON, DefaultVertexFormats.POSITION_TEX);
int i;
for (i = 0; i <= 90; i += 3)
glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y + radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D);
for (i = 90; i <= 180; i += 3)
glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D);
for (i = 0; i <= 90; i += 3)
glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius);
for (i = 90; i <= 180; i += 3)
glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y + radius + Math.cos(i * Math.PI / 180.0D) * radius);
for (i = 0; i <= 90; i += 3) glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y + radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D);
for (i = 90; i <= 180; i += 3) glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D);
for (i = 0; i <= 90; i += 3) glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius);
for (i = 90; i <= 180; i += 3) glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y + radius + Math.cos(i * Math.PI / 180.0D) * radius);
tessellator.draw();
GlStateManager.enableTexture2D();
GlStateManager.disableBlend();
@ -88,9 +77,9 @@ public class RoundedUtil {
GlStateManager.scale(2.0D, 2.0D, 2.0D);
GlStateManager.enableBlend();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
}
public static void glVertex2d(double idk, double idk2){
public static void glVertex2d(double idk, double idk2) {
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.pos(idk, idk2, 0);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -37,8 +37,8 @@ public class SimpleAnimation {
public void setValue(float value) {
this.value = value;
}
public boolean isDone() {
return lastValue >= value-1;
return lastValue >= value - 1;
}
}

View File

@ -1,8 +1,5 @@
package dev.resent.visual.ui.clickgui;
import java.io.IOException;
import java.util.Comparator;
import dev.resent.client.ClientInfo;
import dev.resent.client.Resent;
import dev.resent.module.base.Mod;
@ -19,6 +16,8 @@ import dev.resent.util.render.RenderUtils;
import dev.resent.visual.ui.Theme;
import dev.resent.visual.ui.animation.Animation;
import dev.resent.visual.ui.animation.Direction;
import java.io.IOException;
import java.util.Comparator;
import net.lax1dude.eaglercraft.v1_8.Keyboard;
import net.lax1dude.eaglercraft.v1_8.Mouse;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
@ -52,81 +51,78 @@ public class ClickGUI extends GuiScreen {
offset = MathHelper.clamp_int(MathHelper.clamp_int(offset, 0, getListMaxScroll()), 0, getListMaxScroll());
int xo = 0;
int off = 0;
if(isMouseInside(mouseX, mouseY, x, height+14, x+20, height+25)) {
selectedCategory = null;
}else if(isMouseInside(mouseX, mouseY, x+24, height+14, x+46, height+25)) {
selectedCategory = Category.HUD;
}else if(isMouseInside(mouseX, mouseY, x+50, height+14, x+74, height+25)) {
selectedCategory = Category.MISC;
if (isMouseInside(mouseX, mouseY, x, height + 14, x + 20, height + 25)) {
selectedCategory = null;
} else if (isMouseInside(mouseX, mouseY, x + 24, height + 14, x + 46, height + 25)) {
selectedCategory = Category.HUD;
} else if (isMouseInside(mouseX, mouseY, x + 50, height + 14, x + 74, height + 25)) {
selectedCategory = Category.MISC;
}
if (isMouseInside(mouseX, mouseY, sr.getScaledWidth() / 2 - fr.getStringWidth("Edit Layout") / 2 - 5, sr.getScaledHeight() - y - 9, sr.getScaledWidth() / 2 - fr.getStringWidth("Edit Layout") / 2 + 5 + fr.getStringWidth("Edit Layout"), sr.getScaledHeight() - y + 5) && mouseButton == 0) {
mc.displayGuiScreen(new HUDConfigScreen(this));
this.openedMod = null;
}
Resent.INSTANCE.modManager.modsInCategory(selectedCategory).sort(Comparator.comparingInt(m -> fr.getStringWidth(m.getName())));
for (Mod m : Resent.INSTANCE.modManager.modsInCategory(selectedCategory) ) {
if(!m.isAdmin() || EntityRenderer.test){
int fh = 9;
for (Mod m : Resent.INSTANCE.modManager.modsInCategory(selectedCategory)) {
if (!m.isAdmin() || EntityRenderer.test) {
int fh = 9;
if (isMouseInside(mouseX, mouseY, this.x + 90 + xo - 1 + 10, height - 2 - fh * -(off) + 51 - 1 - offset, this.x + 90 + xo - 1 + 21, height + 30 - fh * (-off) + 30 - 1 + 2 - 1 - offset) && m.doesHaveSetting() && openedMod == null) {
// Open settings
this.openedMod = m;
} else if (isMouseInside(mouseX, mouseY, x - 9 + 2, height + 27 + 9 + 2, x - 9 + 6 + fr.getStringWidth("<"), height + 33 + 9 + 2 + fr.getStringWidth("<")) && mouseButton == 0) {
// Close settings
this.openedMod = null;
} else if (isMouseInside(mouseX, mouseY, width + 15, height - 10, width + 25, height + 7)) {
// Close ui
mc.displayGuiScreen(null);
this.openedMod = null;
}else if(isMouseInside(mouseX, mouseY, this.x+48+xo, height-2-fh*-(off)+70-1-offset, this.x+80+xo, height+30-fh*-off+30+2-offset+17) && ModManager.clickGui.guiTheme.getValue() == "New" && openedMod == null){
//toggle new
if(m.getName() != "ClickGUI")
m.toggle();
} else if (isMouseInside(mouseX, mouseY, this.x + 10 + xo - 2 + 10, height - 2 - fh * -(off) + 50 - 2 - offset, this.x + 90 + xo + 22, height + 30 - fh * (-off) + 30 + 2 - offset) && mouseButton == 0 && openedMod == null && ModManager.clickGui.guiTheme.getValue() == "Classic revised") {
//toggle classic
if(m.getName() != "ClickGUI")
m.toggle();
}
if (xo > width / 2) {
xo = 0;
off += 5;
} else {
xo += 100;
}
if (isMouseInside(mouseX, mouseY, this.x + 90 + xo - 1 + 10, height - 2 - fh * -(off) + 51 - 1 - offset, this.x + 90 + xo - 1 + 21, height + 30 - fh * (-off) + 30 - 1 + 2 - 1 - offset) && m.doesHaveSetting() && openedMod == null) {
// Open settings
this.openedMod = m;
} else if (isMouseInside(mouseX, mouseY, x - 9 + 2, height + 27 + 9 + 2, x - 9 + 6 + fr.getStringWidth("<"), height + 33 + 9 + 2 + fr.getStringWidth("<")) && mouseButton == 0) {
// Close settings
this.openedMod = null;
} else if (isMouseInside(mouseX, mouseY, width + 15, height - 10, width + 25, height + 7)) {
// Close ui
mc.displayGuiScreen(null);
this.openedMod = null;
} else if (isMouseInside(mouseX, mouseY, this.x + 48 + xo, height - 2 - fh * -(off) + 70 - 1 - offset, this.x + 80 + xo, height + 30 - fh * -off + 30 + 2 - offset + 17) && ModManager.clickGui.guiTheme.getValue() == "New" && openedMod == null) {
//toggle new
if (m.getName() != "ClickGUI") m.toggle();
} else if (isMouseInside(mouseX, mouseY, this.x + 10 + xo - 2 + 10, height - 2 - fh * -(off) + 50 - 2 - offset, this.x + 90 + xo + 22, height + 30 - fh * (-off) + 30 + 2 - offset) && mouseButton == 0 && openedMod == null && ModManager.clickGui.guiTheme.getValue() == "Classic revised") {
//toggle classic
if (m.getName() != "ClickGUI") m.toggle();
}
if (xo > width / 2) {
xo = 0;
off += 5;
} else {
xo += 100;
}
}
}
if (openedMod != null) {
int var = 0;
for (Setting s : this.openedMod.settings) {
if(s instanceof NumberSetting) {
if(isMouseInside(mouseX, mouseY, width-150+sliderOffset, height+41+var, width-141+sliderOffset, height+50+var)) {
draggingNumber = true;
if (s instanceof NumberSetting) {
if (isMouseInside(mouseX, mouseY, width - 150 + sliderOffset, height + 41 + var, width - 141 + sliderOffset, height + 50 + var)) {
draggingNumber = true;
}
}
if (s instanceof BooleanSetting) {
if (isMouseInside(mouseX, mouseY, this.x + 11, height - 9 + 50 + var, this.x + 19, height - 9 + 50 + 9 + var - 1) && mouseButton == 0) {
((BooleanSetting)s).toggle();
((BooleanSetting) s).toggle();
}
}
if (s instanceof ModeSetting) {
if(isMouseInside(mouseX, mouseY, this.x+360, height+40+var, this.x+370, height+50+var) && mouseButton == 0) {
((ModeSetting)s).cycle(false);
if (isMouseInside(mouseX, mouseY, this.x + 360, height + 40 + var, this.x + 370, height + 50 + var) && mouseButton == 0) {
((ModeSetting) s).cycle(false);
}
if(isMouseInside(mouseX, mouseY, this.x+458, height+40+var, this.x+470, height+50+var) && mouseButton == 0) {
((ModeSetting)s).cycle(true);
if (isMouseInside(mouseX, mouseY, this.x + 458, height + 40 + var, this.x + 470, height + 50 + var) && mouseButton == 0) {
((ModeSetting) s).cycle(true);
}
}
if(s instanceof CustomRectSettingDraw){
if(isMouseInside(mouseX, mouseY, x+21, height+41+var, x+27+fr.getStringWidth(s.name), height+var+53)){
((CustomRectSettingDraw)s).onPress();
if (s instanceof CustomRectSettingDraw) {
if (isMouseInside(mouseX, mouseY, x + 21, height + 41 + var, x + 27 + fr.getStringWidth(s.name), height + var + 53)) {
((CustomRectSettingDraw) s).onPress();
}
}
@ -148,11 +144,11 @@ public class ClickGUI extends GuiScreen {
int off = 0;
if (close) {
if(introAnimation == null) {
mc.displayGuiScreen(null);
return;
}
if (introAnimation == null) {
mc.displayGuiScreen(null);
return;
}
introAnimation.setDirection(Direction.BACKWARDS);
if (introAnimation.isDone(Direction.BACKWARDS)) {
mc.displayGuiScreen(null);
@ -164,9 +160,9 @@ public class ClickGUI extends GuiScreen {
// background
drawRect(x - 10, y + 20, width + 35, height - 10, new Color(35, 39, 42, 200).getRGB());
fr.drawString(ClientInfo.name + " Client " + ClientInfo.version, x + 8, height - 2, -1);
//RenderUtils.drawRectOutline(sr.getScaledWidth() / 2 - fr.getStringWidth("Edit Layout") / 2 - 5, sr.getScaledHeight() - y - 9, sr.getScaledWidth() / 2 - fr.getStringWidth("Edit Layout") / 2 + 5 + fr.getStringWidth("Edit Layout"), sr.getScaledHeight() - y + 5, -1);
drawRect(
drawRect(
sr.getScaledWidth() / 2 - fr.getStringWidth("Edit Layout") / 2 - 4,
sr.getScaledHeight() - y - 9 + 1,
sr.getScaledWidth() / 2 - fr.getStringWidth("Edit Layout") / 2 + 5 + fr.getStringWidth("Edit Layout") - 1,
@ -178,43 +174,43 @@ public class ClickGUI extends GuiScreen {
// close
fr.drawString("X", width + 18, height - 2, -1);
//categories
drawRect(x+0.8d, height+14, x+20, height+25, isMouseInside(mouseX, mouseY, x, height+14, x+20, height+25) ? new Color(150, 150, 150, 65).getRGB() : new Color(211, 211, 211, 65).getRGB());
drawRect(x+23d, height+14, x+47, height+25, isMouseInside(mouseX, mouseY, x+24, height+14, x+46, height+25) ? new Color(150, 150, 150, 65).getRGB() : new Color(211, 211, 211, 65).getRGB());
drawRect(x+50, height+14, x+75, height+25, isMouseInside(mouseX, mouseY, x+50, height+14, x+74, height+25) ? new Color(150, 150, 150, 65).getRGB() : new Color(211, 211, 211, 65).getRGB());
fr.drawStringWithShadow("All", x+5f, height+16, -1);
fr.drawStringWithShadow("Hud", x+26.5f, height+16, -1);
fr.drawStringWithShadow("Misc", x+53, height+16, -1);
drawRect(x + 0.8d, height + 14, x + 20, height + 25, isMouseInside(mouseX, mouseY, x, height + 14, x + 20, height + 25) ? new Color(150, 150, 150, 65).getRGB() : new Color(211, 211, 211, 65).getRGB());
drawRect(x + 23d, height + 14, x + 47, height + 25, isMouseInside(mouseX, mouseY, x + 24, height + 14, x + 46, height + 25) ? new Color(150, 150, 150, 65).getRGB() : new Color(211, 211, 211, 65).getRGB());
drawRect(x + 50, height + 14, x + 75, height + 25, isMouseInside(mouseX, mouseY, x + 50, height + 14, x + 74, height + 25) ? new Color(150, 150, 150, 65).getRGB() : new Color(211, 211, 211, 65).getRGB());
fr.drawStringWithShadow("All", x + 5f, height + 16, -1);
fr.drawStringWithShadow("Hud", x + 26.5f, height + 16, -1);
fr.drawStringWithShadow("Misc", x + 53, height + 16, -1);
//white line
drawRect(x - 8, height + 29, width + 33, height + 30, -1);
GlUtils.stopScale();
Resent.INSTANCE.modManager.modsInCategory(selectedCategory).sort(Comparator.comparingInt(m -> fr.getStringWidth(m.getName())));
for (Mod m : Resent.INSTANCE.modManager.modsInCategory(selectedCategory)) {
if (this.openedMod == null && !m.isAdmin() || this.openedMod == null && EntityRenderer.test) {
int fh = 9;
if (height - 2 - fh * -(off) + 50 - 2 - offset > height + 29 && height + 40 - fh * (-off) + 30 +15 - offset < y + 20 && (introAnimation != null ? introAnimation.isDone() : true)) {
if (height - 2 - fh * -(off) + 50 - 2 - offset > height + 29 && height + 40 - fh * (-off) + 30 + 15 - offset < y + 20 && (introAnimation != null ? introAnimation.isDone() : true)) {
// Enabled outline
m.toggleAnimation.setAnimation(m.isEnabled() ? 20 : 0, 7);
if(ModManager.clickGui.guiTheme.getValue() == "New"){
RenderUtils.drawRoundedRect(this.x+48+xo, height-2-fh*-(off)+70-1-offset, this.x+80+xo, height+30-fh*-off+30+2-offset+17, 6, new Color(97, 97, 97).getRGB(), true);
RenderUtils.drawRoundedRect(this.x+48+xo, height-2-fh*-(off)+70-1-offset, this.x+60+xo+m.toggleAnimation.getValue(), height+30-fh*-off+30+2-offset+17, 6, Color.green.getRGB(), true);
RenderUtils.drawRoundedRect(this.x+48+xo+m.toggleAnimation.getValue(), height-2-fh*-(off)+70-1-offset, this.x+60+xo+m.toggleAnimation.getValue(), height+30-fh*-off+30+2-offset+17, 6, -1, true);
}else if(ModManager.clickGui.guiTheme.getValue() == "Classic revised"){
m.toggleAnimation.setAnimation(m.isEnabled() ? 20 : 0, 7);
if (ModManager.clickGui.guiTheme.getValue() == "New") {
RenderUtils.drawRoundedRect(this.x + 48 + xo, height - 2 - fh * -(off) + 70 - 1 - offset, this.x + 80 + xo, height + 30 - fh * -off + 30 + 2 - offset + 17, 6, new Color(97, 97, 97).getRGB(), true);
RenderUtils.drawRoundedRect(this.x + 48 + xo, height - 2 - fh * -(off) + 70 - 1 - offset, this.x + 60 + xo + m.toggleAnimation.getValue(), height + 30 - fh * -off + 30 + 2 - offset + 17, 6, Color.green.getRGB(), true);
RenderUtils.drawRoundedRect(this.x + 48 + xo + m.toggleAnimation.getValue(), height - 2 - fh * -(off) + 70 - 1 - offset, this.x + 60 + xo + m.toggleAnimation.getValue(), height + 30 - fh * -off + 30 + 2 - offset + 17, 6, -1, true);
} else if (ModManager.clickGui.guiTheme.getValue() == "Classic revised") {
RenderUtils.drawRoundedRect(this.x + 10 + xo - 2 + 10, height - 2 - fh * -(off) + 50 - 2 - offset, this.x + 90 + xo + 22, height + 30 - fh * (-off) + 30 + 2 - offset, 4, m.isEnabled() ? Color.GREEN.getRGB() : Color.RED.getRGB(), true);
}
if(ModManager.clickGui.guiTheme.getValue().equals("New")) {
drawRect(
this.x + 10 + xo - 1 + 10,
height - 2 - fh * -(off) + 50 - 1 - offset,
this.x + 90 + xo - 1 + 22,
height + 85 - fh * (-off) - offset,
/*isMouseInside(mouseX, mouseY, this.x + 10 + xo - 1 + 10, height - 2 - fh * -(off) + 50 - 1 - offset, this.x + 90 + xo - 1 + 22, height + 30 - fh * (-off) + 30 - 1 + 2 - offset) ? new Color(105, 105, 105, 65).getRGB() :*/ new Color(211, 211, 211, 65).getRGB()
);
if (ModManager.clickGui.guiTheme.getValue().equals("New")) {
drawRect(
this.x + 10 + xo - 1 + 10,
height - 2 - fh * -(off) + 50 - 1 - offset,
this.x + 90 + xo - 1 + 22,
height + 85 - fh * (-off) - offset,
/*isMouseInside(mouseX, mouseY, this.x + 10 + xo - 1 + 10, height - 2 - fh * -(off) + 50 - 1 - offset, this.x + 90 + xo - 1 + 22, height + 30 - fh * (-off) + 30 - 1 + 2 - offset) ? new Color(105, 105, 105, 65).getRGB() :*/new Color(211, 211, 211, 65).getRGB()
);
}
if (m.doesHaveSetting()) {
@ -232,56 +228,55 @@ public class ClickGUI extends GuiScreen {
fr.drawStringWithShadow(ClientInfo.name + " - " + openedMod.getName(), sr.getScaledWidth() / 2 - (fr.getStringWidth("Resent - " + openedMod.getName()) / 2), height + 29 - 9 - 2, -1);
for (Setting s : openedMod.settings) {
if(s instanceof CustomRectSettingDraw){
drawRect(x+21, height+41+var, x+27+fr.getStringWidth(s.name), height+var+53, isMouseInside(mouseX, mouseY, x+21, height+39+var, x+26+fr.getStringWidth(s.name), height+var+51) ? new Color(150, 150, 150).getRGB() : new Color(211, 211, 211).getRGB());
if (s instanceof CustomRectSettingDraw) {
drawRect(x + 21, height + 41 + var, x + 27 + fr.getStringWidth(s.name), height + var + 53, isMouseInside(mouseX, mouseY, x + 21, height + 39 + var, x + 26 + fr.getStringWidth(s.name), height + var + 51) ? new Color(150, 150, 150).getRGB() : new Color(211, 211, 211).getRGB());
//RenderUtils.drawRectOutline(x+21, height+41+var, x+27+fr.getStringWidth(s.name), height+var+53, -1);
fr.drawStringWithShadow(s.name, this.x + 24, height +43 + var, -1);
fr.drawStringWithShadow(s.name, this.x + 24, height + 43 + var, -1);
var += 3;
}
if(s instanceof NumberSetting) {
NumberSetting ss = ((NumberSetting)s);
fr.drawStringWithShadow(s.name + ": sof " + sliderOffset + ", val: " + ((NumberSetting)s).getValue(), this.x+24, height+41+var, -1);
drawRect(width-150, height+43+var, width-45, height+47+var, -1);
RenderUtils.drawRoundedRect(width-150+sliderOffset, height+40+var, width-140+sliderOffset, height+50+var, 4, Color.RED.getRGB());
if(settingDrag) {
sliderOffset = mouseX-(width-150);
ss.setValue(sliderOffset*(ss.max/100));
}else {
sliderOffset = (int) ((ss.getValue() * 100)/ss.max);
if (s instanceof NumberSetting) {
NumberSetting ss = ((NumberSetting) s);
fr.drawStringWithShadow(s.name + ": sof " + sliderOffset + ", val: " + ((NumberSetting) s).getValue(), this.x + 24, height + 41 + var, -1);
drawRect(width - 150, height + 43 + var, width - 45, height + 47 + var, -1);
RenderUtils.drawRoundedRect(width - 150 + sliderOffset, height + 40 + var, width - 140 + sliderOffset, height + 50 + var, 4, Color.RED.getRGB());
if (settingDrag) {
sliderOffset = mouseX - (width - 150);
ss.setValue(sliderOffset * (ss.max / 100));
} else {
sliderOffset = (int) ((ss.getValue() * 100) / ss.max);
}
if(sliderOffset < 0) {
if (sliderOffset < 0) {
settingDrag = false;
sliderOffset = 0;
}else if(draggingNumber){
} else if (draggingNumber) {
settingDrag = true;
}
if(sliderOffset > 100){
if (sliderOffset > 100) {
settingDrag = false;
sliderOffset = 100;
}else if(draggingNumber){
} else if (draggingNumber) {
settingDrag = true;
}
}
if (s instanceof BooleanSetting) {
drawRect(this.x + 11, height - 9 + 50 + var, this.x + 19, height - 9 + 50 + 9 + var - 1, isMouseInside(mouseX, mouseY, this.x + 11, height - 9 + 50 + var, this.x + 19, height - 9 + 50 + 9 + var - 1) ? new Color(211, 211, 211, 65).getRGB() : new Color(105, 105, 105, 65).getRGB());
fr.drawStringWithShadow(s.name, this.x + 18 + 6, height - fr.FONT_HEIGHT + 50 + var, -1);
if (((BooleanSetting)s).getValue()) {
if (((BooleanSetting) s).getValue()) {
mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/check.png"));
Gui.drawModalRectWithCustomSizedTexture(this.x + 9, height + 39 + var, 0, 0, 12, 12, 12, 12);
}
}
if (s instanceof ModeSetting) {
fr.drawStringWithShadow(s.name, this.x + 18 + 6, height - 9 + 50 + var, -1);
fr.drawStringWithShadow(((ModeSetting)s).getValue(), width-100-fr.getStringWidth(((ModeSetting)s).getValue())/2, height+41+var, -1);
fr.drawStringWithShadow(EnumChatFormatting.RED + "<", width - 150, height-9+50+var, -1);
fr.drawStringWithShadow(((ModeSetting) s).getValue(), width - 100 - fr.getStringWidth(((ModeSetting) s).getValue()) / 2, height + 41 + var, -1);
fr.drawStringWithShadow(EnumChatFormatting.RED + "<", width - 150, height - 9 + 50 + var, -1);
//RenderUtils.drawRectOutline(this.x+370, height+39+var, this.x+360, height+50+var, -1);
fr.drawStringWithShadow(EnumChatFormatting.RED + ">", this.x+463, height-9+50+var, -1);
fr.drawStringWithShadow(EnumChatFormatting.RED + ">", this.x + 463, height - 9 + 50 + var, -1);
//RenderUtils.drawRectOutline(this.x+458, height+40+var, this.x+470, height+50+var, -1);
}
@ -289,25 +284,21 @@ public class ClickGUI extends GuiScreen {
}
}
if(!m.isAdmin() || EntityRenderer.test){
if (xo > width / 2) {
xo = 0;
off += 5;
} else {
xo += 100;
if (!m.isAdmin() || EntityRenderer.test) {
if (xo > width / 2) {
xo = 0;
off += 5;
} else {
xo += 100;
}
}
}
}
}
public boolean doesGuiPauseGame() {
return false;
}
public boolean isMouseInside(double mouseX, double mouseY, double x, double y, double width, double height) {
return (mouseX >= x && mouseX <= width) && (mouseY >= y && mouseY <= height);
}
public void onGuiClosed() {
Keyboard.enableRepeatEvents(true);
ModManager.clickGui.setEnabled(false);
@ -321,7 +312,7 @@ public class ClickGUI extends GuiScreen {
}
@Override
public void mouseReleased(int mouseX, int mouseY, int mouseButton){
public void mouseReleased(int mouseX, int mouseY, int mouseButton) {
draggingNumber = false;
settingDrag = false;
}
@ -341,20 +332,19 @@ public class ClickGUI extends GuiScreen {
for (int i = 0; i < 20; i++) {
offset = MathHelper.clamp_int(offset + 1, 0, getListMaxScroll());
try {
if(ModManager.clickGui.scroll.getValue())
Thread.sleep(1);
if (ModManager.clickGui.scroll.getValue()) Thread.sleep(1);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}).start();
})
.start();
} else if (wheel > 0) {
new Thread(() -> {
for (int i = 0; i < 20; i++) {
offset = MathHelper.clamp_int(offset - 1, 0, getListMaxScroll());
try {
if(ModManager.clickGui.scroll.getValue())
Thread.sleep(1);
if (ModManager.clickGui.scroll.getValue()) Thread.sleep(1);
} catch (InterruptedException e) {
e.printStackTrace();
}

View File

@ -7,13 +7,12 @@ import net.minecraft.client.gui.GuiScreen;
public class HUDConfigScreen extends GuiScreen {
private GuiScreen parentGuiScreen;
public HUDConfigScreen(GuiScreen parentScreen) {
parentGuiScreen = parentScreen;
}
private GuiScreen parentGuiScreen;
public HUDConfigScreen(GuiScreen parentScreen) {
parentGuiScreen = parentScreen;
}
public void initGui() {
this.buttonList.add(new GuiButton(200, width / 2 - 100, height - 30, "Back"));
}
@ -24,7 +23,7 @@ public class HUDConfigScreen extends GuiScreen {
public void drawScreen(int mx, int my, float par3) {
this.drawDefaultBackground();
Resent.INSTANCE.modManager.modules.stream().filter(m -> m.isEnabled() && m instanceof RenderMod).forEach(rm -> ((RenderMod)rm).renderLayout(mx, my));
Resent.INSTANCE.modManager.modules.stream().filter(m -> m.isEnabled() && m instanceof RenderMod).forEach(rm -> ((RenderMod) rm).renderLayout(mx, my));
super.drawScreen(mx, my, par3);
}

View File

@ -17,18 +17,17 @@ public class PreGUI extends GuiScreen {
@Override
public void drawScreen(int i, int j, float var3) {
opacityAnimation.setAnimation(100, 5);
slideAnimation.setAnimation(200, 7);
boolean isInside = isMouseInside(i, j, GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 20, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 50);
boolean isInside2 = isMouseInside(i, j, GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 55, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 85);
opacityAnimation.setAnimation(100, 5);
slideAnimation.setAnimation(200, 7);
boolean isInside = isMouseInside(i, j, GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 20, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 50);
boolean isInside2 = isMouseInside(i, j, GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 55, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 85);
mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/logo.png"));
Gui.drawModalRectWithCustomSizedTexture(GuiScreen.width / 2 - 20, GuiScreen.height / 2 - 250 + (int)slideAnimation.getValue(), 0, 0, 60, 60, 60, 60);
Gui.drawRect(GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 20, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 50, isInside ? 0x90FFFFFF : new Color(230, 230, 230, (int)opacityAnimation.getValue()).getRGB());
Gui.drawRect(GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 55, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 85, isInside2 ? 0x90FFFFFF : new Color(230, 230, 230, (int)opacityAnimation.getValue()).getRGB());
Gui.drawModalRectWithCustomSizedTexture(GuiScreen.width / 2 - 20, GuiScreen.height / 2 - 250 + (int) slideAnimation.getValue(), 0, 0, 60, 60, 60, 60);
Gui.drawRect(GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 20, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 50, isInside ? 0x90FFFFFF : new Color(230, 230, 230, (int) opacityAnimation.getValue()).getRGB());
Gui.drawRect(GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 55, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 85, isInside2 ? 0x90FFFFFF : new Color(230, 230, 230, (int) opacityAnimation.getValue()).getRGB());
//RenderUtils.drawRectOutline(GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 20, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 50, 0x080FFFFFF);
if(opacityAnimation.isDone()) {
if (opacityAnimation.isDone()) {
mc.fontRendererObj.drawStringWithShadow("Mods", GuiScreen.width / 2 - 2, GuiScreen.height / 2 + 35 - 9 / 2, -1);
mc.fontRendererObj.drawStringWithShadow("Edit Layout", GuiScreen.width / 2 - 17, GuiScreen.height / 2 + 70 - 9 / 2, -1);
}
@ -59,7 +58,4 @@ public class PreGUI extends GuiScreen {
super.keyTyped(parChar1, parInt1);
}
public boolean isMouseInside(int mouseX, int mouseY, int x, int y, int width, int height) {
return (mouseX >= x && mouseX <= width) && (mouseY >= y && mouseY <= height);
}
}

View File

@ -1,8 +1,5 @@
package dev.resent.visual.ui.clickgui.rewrite;
import java.io.IOException;
import java.util.ArrayList;
import dev.resent.client.Resent;
import dev.resent.module.base.Mod;
import dev.resent.module.base.setting.BooleanSetting;
@ -16,6 +13,8 @@ import dev.resent.visual.ui.animation.Direction;
import dev.resent.visual.ui.animation.SimpleAnimation;
import dev.resent.visual.ui.clickgui.rewrite.comp.Comp;
import dev.resent.visual.ui.clickgui.rewrite.comp.impl.CompCheck;
import java.io.IOException;
import java.util.ArrayList;
import net.lax1dude.eaglercraft.v1_8.Mouse;
import net.lax1dude.eaglercraft.v1_8.internal.KeyboardConstants;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
@ -32,19 +31,15 @@ import net.minecraft.util.ResourceLocation;
public class ClickGuiRewrite extends GuiScreen {
public FontRenderer fr;
public ArrayList < Comp > comps = new ArrayList < > ();
public ArrayList<Comp> comps = new ArrayList<>();
public float x, y, width, height;
public Animation introAnimation;
public ScaledResolution sr;
public boolean closing, isSearchFocused, iforgor, iforgor2 = true;
public boolean closing, isSearchFocused, home = true, setting;
public Mod selectedMod;
public String searchString = "";
public SimpleAnimation partAnimation;
public int backgroundColor = new Color(18, 18, 18).getRGB(),
primaryColor = 0xFF000000,
secondaryColor = new Color(33, 33, 33).getRGB(),
onSurfaceColor = new Color(3, 218, 197).getRGB(),
secondaryFontColor = new Color(187, 134, 252).getRGB();
public int backgroundColor = new Color(18, 18, 18).getRGB(), primaryColor = 0xFF000000, secondaryColor = new Color(33, 33, 33).getRGB(), onSurfaceColor = new Color(3, 218, 197).getRGB(), secondaryFontColor = new Color(187, 134, 252).getRGB();
public int scrollOffset = 0;
public String part = "Home";
@ -55,6 +50,8 @@ public class ClickGuiRewrite extends GuiScreen {
GlUtils.startScale((this.x+this.width) / 2, (this.y+this.height) / 2, introAnimation != null ? (float) introAnimation.getValue() : 1);
/* !-------------- NECESSARY ELEMENTS -----------------! */
//Navigation bar
RenderUtils.drawRoundedRect(x, y, x+width-60, y+height, 32, secondaryColor);
@ -73,12 +70,13 @@ public class ClickGuiRewrite extends GuiScreen {
fr.drawString("Resent", x+80, y+36, -1, false);
GlStateManager.popMatrix();
if (iforgor) {
if (setting) {
partAnimation.setAnimation(50, 9);
} else if (iforgor2) {
}
if (home) {
partAnimation.setAnimation(0, 9);
}
//Navigation selection
RenderUtils.drawRoundedRect(x+15, y+115+partAnimation.getValue(), x+45, y+145+partAnimation.getValue(), 8, secondaryFontColor);
@ -92,7 +90,6 @@ public class ClickGuiRewrite extends GuiScreen {
//Search
RenderUtils.drawRoundedRect(x+width-300, y+25, x+width-50, y+65, 9, secondaryColor);
mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/search.png"));
Gui.drawModalRectWithCustomSizedTexture(x+width-290, (int) y+36, 0, 0, 20, 20, 20, 20);
GlStateManager.pushMatrix();
@ -111,8 +108,10 @@ public class ClickGuiRewrite extends GuiScreen {
GlStateManager.popMatrix();
/* !------------- HOME/MODULE (SOON) --------------------! */
//Draw module button
for (Mod m: Resent.INSTANCE.modManager.modules) {
for (Mod m : Resent.INSTANCE.modManager.modules) {
if (!m.isAdmin() && m.getName().toLowerCase().startsWith(searchString.toLowerCase()) && selectedMod == null) {
if (y+125+offset+scrollOffset > y+95 && y+175+offset+scrollOffset < y+height && part == "Home") {
//Body
@ -120,39 +119,39 @@ public class ClickGuiRewrite extends GuiScreen {
//Gear
if (m.doesHaveSetting()) {
GlStateManager.color(1, 1, 1);
GlStateManager.color(1, 1, 1);
mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/gear2.png"));
Gui.drawModalRectWithCustomSizedTexture(x+width-60, (int) y+140+offset+scrollOffset, 0, 0, 20, 20, 20, 20);
}
}
//Toggle
RenderUtils.drawRoundedRect(x+100, y+135+offset+scrollOffset, x+130, y+165+offset+scrollOffset, 8, m.isEnabled() ? onSurfaceColor : new Color(66, 66, 66).getRGB());
GlUtils.startScale(x+90, y+140+offset+scrollOffset, 2);
int i = fr.drawString(m.getName(), x+120, y+140+offset+scrollOffset, -1, false);
GlStateManager.popMatrix();
GlUtils.startScale(x+120+i/2, y+140+offset+scrollOffset, 1.5f);
GlUtils.startScale(x+120+i / 2, y+140+offset+scrollOffset, 1.5f);
fr.drawString(m.getDescription(), x+20+i, y+142+offset+scrollOffset, -1, false);
GlStateManager.popMatrix();
// if (isMouseInside(mouseX, mouseY, x+i+80, y+115+offset+scrollOffset, x+width-20, y+185+offset+scrollOffset)) {
// fr.drawString(m.getDescription(), mousex+8, mouseY, onSurfaceColor, false);
// }
// if (isMouseInside(mouseX, mouseY, x+i+80, y+115+offset+scrollOffset, x+width-20, y+185+offset+scrollOffset)) {
// fr.drawString(m.getDescription(), mousex+8, mouseY, onSurfaceColor, false);
// }
}
offset+= 60;
offset += 60;
}
}
/* !------------- SETTINGS ----------------! */
if (selectedMod != null) {
fr.drawString("<", x+80, y+115+offset, -1, false);
for (Comp comp: comps) {
fr.drawString("<", x+80, y+115+offset, -1, false);
RenderUtils.drawRoundedRect(x+80, y+125, x+width-20, y+325, 16, secondaryColor);
for (Comp comp : comps) {
comp.drawScreen(mouseX, mouseY);
}
}
GlStateManager.popMatrix();
if (closing) {
@ -167,20 +166,18 @@ public class ClickGuiRewrite extends GuiScreen {
mc.displayGuiScreen(null);
}
}
}
@Override
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) {
if (isMouseInside(mouseX, mouseY, x+20, (int) y+170, x+40, (int) y+190)) {
iforgor2 = false;
iforgor = true;
part = "Setting";
} else if (isMouseInside(mouseX, mouseY, x+20, (int) y+120, x+40, (int) y+140)) {
iforgor = false;
iforgor2 = true;
if (isMouseInside(mouseX, mouseY, x+20, (int) y+120, x+40, (int) y+140)) {
setting = false;
home = true;
part = "Home";
} else if (isMouseInside(mouseX, mouseY, x+20, (int) y+170, x+40, (int) y+190)) {
home = false;
setting = true;
part = "Setting";
}
if (isMouseInside(mouseX, mouseY, x+width-300, y+25, x+width-50, y+65)) {
@ -191,62 +188,56 @@ public class ClickGuiRewrite extends GuiScreen {
int offset = 0;
for (Mod m: Resent.INSTANCE.modManager.modules) {
for (Mod m : Resent.INSTANCE.modManager.modules) {
if (!m.isAdmin() && m.getName().toLowerCase().startsWith(searchString.toLowerCase()) && selectedMod == null) {
if (y+125+offset+scrollOffset > y+95 && y+175+offset+scrollOffset < y+height && part == "Home") {
if (isMouseInside(mouseX, mouseY, x+width-60, y+140+offset+scrollOffset, x+width-40, y+160+offset+scrollOffset) && mouseButton == 0 && m.doesHaveSetting()) {
selectedMod = m;
int settingOffset = 0;
for (Setting s: selectedMod.settings) {
selectedMod = m;
int settingOffset = 0;
for (Setting s : selectedMod.settings) {
if (s instanceof BooleanSetting) {
comps.add(new CompCheck(x+110, y+125+settingOffset, selectedMod, s));
}
settingOffset+= 25;
settingOffset += 25;
}
}
if(isMouseInside(mouseX, mouseY, x+80, y+125+offset+scrollOffset, x+width-20, y+175+offset+scrollOffset)) {
if(mouseButton == 1 && m.doesHaveSetting()) {
selectedMod = m;
int settingOffset = 0;
for (Setting s: selectedMod.settings) {
if (isMouseInside(mouseX, mouseY, x+80, y+125+offset+scrollOffset, x+width-20, y+175+offset+scrollOffset)) {
if (mouseButton == 1 && m.doesHaveSetting()) {
selectedMod = m;
int settingOffset = 0;
for (Setting s : selectedMod.settings) {
if (s instanceof BooleanSetting) {
comps.add(new CompCheck(x+110, y+125+settingOffset, selectedMod, s));
}
settingOffset+= 25;
settingOffset += 25;
}
}
if(mouseButton == 0 && selectedMod == null) {
m.toggle();
}
}
}
if (mouseButton == 0 && selectedMod == null) {
m.toggle();
}
}
}
offset+= 60;
}
}
if (selectedMod != null) {
if(isMouseInside(mouseX, mouseY, x+77, y+112, x+87, y+125)) {
selectedMod = null;
comps.clear();
}
for (Comp c: comps) {
c.mouseClicked(mouseX, mouseY, mouseButton);
offset += 60;
}
}
if (selectedMod != null) {
if (isMouseInside(mouseX, mouseY, x+77, y+112, x+87, y+125)) {
selectedMod = null;
comps.clear();
}
for (Comp c : comps) {
c.mouseClicked(mouseX, mouseY, mouseButton);
}
}
}
@Override
public void initGui() {
@ -267,29 +258,25 @@ public class ClickGuiRewrite extends GuiScreen {
}
if (selectedMod != null) {
for (Comp c: comps) {
for (Comp c : comps) {
c.keyTyped(par1, key);
}
}
// Search box stuff
else if (key == KeyboardConstants.KEY_BACK && isSearchFocused) {
if (key == KeyboardConstants.KEY_BACK && isSearchFocused) {
if (searchString.length() != 0) {
searchString = searchString.substring(0, searchString.length()-1);
}
} else {
if (searchString.length() <= 18 && isSearchFocused) {
String balls = ChatAllowedCharacters.filterAllowedCharacters(String.valueOf(par1));
if (balls != null && balls != "") {
searchString += String.valueOf(par1);
scrollOffset = 0;
}
} else if (searchString.length() <= 18 && isSearchFocused) {
String balls = ChatAllowedCharacters.filterAllowedCharacters(String.valueOf(par1));
if (balls != "") {
searchString += String.valueOf(par1);
scrollOffset = 0;
}
}
}
@Override
public void handleMouseInput() throws IOException {
int scroll = Mouse.getEventDWheel();
@ -300,13 +287,13 @@ public class ClickGuiRewrite extends GuiScreen {
}
super.handleMouseInput();
}
public int getMaxScroll() {
return Resent.INSTANCE.modManager.modules.size() * -53;
}
@Override
public void onGuiClosed() {
mc.gameSettings.saveOptions();
mc.gameSettings.saveOptions();
}
}
}

View File

@ -13,9 +13,8 @@ public abstract class Comp {
public void mouseReleased(int mouseX, int mouseY, int state) {}
public void drawScreen(int mouseX, int mouseY) {}
public void keyTyped(char typedChar, int keyCode) {}
public boolean isMouseInside(double mouseX, double mouseY, double x, double y, double width, double height) {
return (mouseX >= x && mouseX <= width) && (mouseY >= y && mouseY <= height);
}
}

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.setting.BooleanSetting;
import dev.resent.module.base.setting.Setting;
import dev.resent.util.misc.FuncUtils;
import dev.resent.util.render.Color;
import dev.resent.util.render.RenderUtils;
import dev.resent.visual.ui.clickgui.rewrite.comp.Comp;
import net.minecraft.client.Minecraft;
public class CompCheck extends Comp{
public class CompCheck extends Comp {
public CompCheck(float x, float y, Mod m, Setting s){
public CompCheck(float x, float y, Mod m, Setting s) {
this.x = x;
this.y = y;
this.mod = m;
@ -20,15 +19,14 @@ public class CompCheck extends Comp{
@Override
public void drawScreen(int mouseX, int mouseY) {
RenderUtils.drawRoundedRect(this.x, this.y, this.x+20, this.y+20, 8, ((BooleanSetting)setting).getValue() ? new Color(3, 218, 197).getRGB() : new Color(66, 66, 66).getRGB());
Minecraft.getMinecraft().fontRendererObj.drawString(setting.name, this.x+25, this.y+6.5f, -1, false);
RenderUtils.drawRoundedRect(this.x, this.y, this.x + 20, this.y + 20, 8, ((BooleanSetting) setting).getValue() ? new Color(3, 218, 197).getRGB() : new Color(66, 66, 66).getRGB());
Minecraft.getMinecraft().fontRendererObj.drawString(setting.name, this.x + 25, this.y + 6.5f, -1, false);
}
@Override
public void mouseClicked(int mouseX, int mouseY, int mouseButton) {
if(isMouseInside(mouseX, mouseY, this.x, this.y, this.x+20, this.y+20)){
((BooleanSetting)setting).toggle();
if (isMouseInside(mouseX, mouseY, this.x, this.y, this.x + 20, this.y + 20)) {
((BooleanSetting) setting).toggle();
}
}
}

View File

@ -1,9 +1,8 @@
package net.minecraft.block;
import java.util.List;
import dev.resent.module.base.ModManager;
import dev.resent.module.impl.misc.AdminRay;
import java.util.List;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
@ -400,8 +399,7 @@ public class Block {
}
public int getMixedBrightnessForBlock(IBlockAccess worldIn, BlockPos pos) {
if(ModManager.adminRay.isEnabled()){
if (ModManager.adminRay.isEnabled()) {
return 99999;
}
@ -417,8 +415,7 @@ public class Block {
}
public boolean shouldSideBeRendered(IBlockAccess iblockaccess, BlockPos blockpos, EnumFacing enumfacing) {
if(ModManager.adminRay.isEnabled()){
if (ModManager.adminRay.isEnabled()) {
return AdminRay.shouldRender(this);
}
@ -1052,18 +1049,18 @@ public class Block {
registerBlock(6, (String) "sapling", (new BlockSapling()).setHardness(0.0F).setStepSound(soundTypeGrass).setUnlocalizedName("sapling"));
registerBlock(7, (String) "bedrock", (new Block(Material.rock)).setBlockUnbreakable().setResistance(6000000.0F).setStepSound(soundTypePiston).setUnlocalizedName("bedrock").disableStats().setCreativeTab(CreativeTabs.tabBlock));
if(ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.reducedWater.getValue()){
if (ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.reducedWater.getValue()) {
registerBlock(8, (String) "flowing_water", (new BlockDynamicLiquid(Material.water)).setHardness(100.0F).setUnlocalizedName("water").disableStats());
registerBlock(9, (String) "water", (new BlockStaticLiquid(Material.water)).setHardness(100.0F).setUnlocalizedName("water").disableStats());
registerBlock(10, (String) "flowing_lava", (new BlockDynamicLiquid(Material.lava)).setHardness(100.0F).setUnlocalizedName("lava").disableStats());
registerBlock(11, (String) "lava", (new BlockStaticLiquid(Material.lava)).setHardness(100.0F).setUnlocalizedName("lava").disableStats());
}else {
} else {
registerBlock(8, (String) "flowing_water", (new BlockDynamicLiquid(Material.water)).setHardness(100.0F).setLightOpacity(3).setUnlocalizedName("water").disableStats());
registerBlock(9, (String) "water", (new BlockStaticLiquid(Material.water)).setHardness(100.0F).setLightOpacity(3).setUnlocalizedName("water").disableStats());
registerBlock(10, (String) "flowing_lava", (new BlockDynamicLiquid(Material.lava)).setHardness(100.0F).setLightLevel(1.0F).setUnlocalizedName("lava").disableStats());
registerBlock(11, (String) "lava", (new BlockStaticLiquid(Material.lava)).setHardness(100.0F).setLightLevel(1.0F).setUnlocalizedName("lava").disableStats());
}
registerBlock(12, (String) "sand", (new BlockSand()).setHardness(0.5F).setStepSound(soundTypeSand).setUnlocalizedName("sand"));
registerBlock(13, (String) "gravel", (new BlockGravel()).setHardness(0.6F).setStepSound(soundTypeGravel).setUnlocalizedName("gravel"));
registerBlock(14, (String) "gold_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setUnlocalizedName("oreGold"));

View File

@ -1,9 +1,8 @@
package net.minecraft.block;
import dev.resent.module.base.ModManager;
import java.util.EnumSet;
import java.util.Set;
import dev.resent.module.base.ModManager;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
@ -46,97 +45,97 @@ public class BlockDynamicLiquid extends BlockLiquid {
public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) {
long framebufferAge = Minecraft.getMinecraft().entityRenderer.overlayFramebuffer.getAge();
if (framebufferAge == -1l || framebufferAge > (Minecraft.getDebugFPS() < 25 ? 125l : 75l)) {
if(ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.reducedWater.getValue()){
int i = ((Integer) iblockstate.getValue(LEVEL)).intValue();
byte b0 = 1;
if (this.blockMaterial == Material.lava && !world.provider.doesWaterVaporize()) {
b0 = 2;
}
if (ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.reducedWater.getValue()) {
int i = ((Integer) iblockstate.getValue(LEVEL)).intValue();
byte b0 = 1;
if (this.blockMaterial == Material.lava && !world.provider.doesWaterVaporize()) {
b0 = 2;
}
int j = this.tickRate(world);
if (i > 0) {
int k = -100;
this.adjacentSourceBlocks = 0;
int j = this.tickRate(world);
if (i > 0) {
int k = -100;
this.adjacentSourceBlocks = 0;
for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) {
k = this.checkAdjacentBlock(world, blockpos.offset(enumfacing), k);
}
for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) {
k = this.checkAdjacentBlock(world, blockpos.offset(enumfacing), k);
}
int l = k + b0;
if (l >= 8 || k < 0) {
l = -1;
}
int l = k + b0;
if (l >= 8 || k < 0) {
l = -1;
}
if (this.getLevel(world, blockpos.up()) >= 0) {
int i1 = this.getLevel(world, blockpos.up());
if (i1 >= 8) {
l = i1;
if (this.getLevel(world, blockpos.up()) >= 0) {
int i1 = this.getLevel(world, blockpos.up());
if (i1 >= 8) {
l = i1;
} else {
l = i1 + 8;
}
}
if (this.adjacentSourceBlocks >= 2 && this.blockMaterial == Material.water) {
IBlockState iblockstate2 = world.getBlockState(blockpos.down());
if (iblockstate2.getBlock().getMaterial().isSolid()) {
l = 0;
} else if (iblockstate2.getBlock().getMaterial() == this.blockMaterial && ((Integer) iblockstate2.getValue(LEVEL)).intValue() == 0) {
l = 0;
}
}
if (this.blockMaterial == Material.lava && i < 8 && l < 8 && l > i && random.nextInt(4) != 0) {
j *= 4;
}
if (l == i) {
this.placeStaticBlock(world, blockpos, iblockstate);
} else {
i = l;
if (l < 0) {
world.setBlockToAir(blockpos);
} else {
iblockstate = iblockstate.withProperty(LEVEL, Integer.valueOf(l));
world.setBlockState(blockpos, iblockstate, 2);
world.scheduleUpdate(blockpos, this, j);
world.notifyNeighborsOfStateChange(blockpos, this);
}
}
} else {
l = i1 + 8;
this.placeStaticBlock(world, blockpos, iblockstate);
}
}
if (this.adjacentSourceBlocks >= 2 && this.blockMaterial == Material.water) {
IBlockState iblockstate2 = world.getBlockState(blockpos.down());
if (iblockstate2.getBlock().getMaterial().isSolid()) {
l = 0;
} else if (iblockstate2.getBlock().getMaterial() == this.blockMaterial && ((Integer) iblockstate2.getValue(LEVEL)).intValue() == 0) {
l = 0;
IBlockState iblockstate1 = world.getBlockState(blockpos.down());
if (this.canFlowInto(world, blockpos.down(), iblockstate1)) {
if (this.blockMaterial == Material.lava && world.getBlockState(blockpos.down()).getBlock().getMaterial() == Material.water) {
world.setBlockState(blockpos.down(), Blocks.stone.getDefaultState());
this.triggerMixEffects(world, blockpos.down());
return;
}
if (i >= 8) {
this.tryFlowInto(world, blockpos.down(), iblockstate1, i);
} else {
this.tryFlowInto(world, blockpos.down(), iblockstate1, i + 8);
}
} else if (i >= 0 && (i == 0 || this.isBlocked(world, blockpos.down(), iblockstate1))) {
Set<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) {
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.
*/
public void onUpdate() {
if(ModManager.sprint.isEnabled()){
if (ModManager.sprint.isEnabled()) {
Sprint.onUpdate();
}
if (this.worldObj.isBlockLoaded(new BlockPos(this.posX, 0.0D, this.posZ))) {
@ -532,13 +532,13 @@ public class EntityPlayerSP extends AbstractClientPlayer {
* Args: entity that was hit critically
*/
public void onCriticalHit(Entity entityHit) {
for(int i = 0; i < ParticleMultiplier.multiplier.getValue(); i++){
for (int i = 0; i < ParticleMultiplier.multiplier.getValue(); i++) {
this.mc.effectRenderer.emitParticleAtEntity(entityHit, EnumParticleTypes.CRIT);
}
}
public void onEnchantmentCritical(Entity entityHit) {
for(int i = 0; i < ParticleMultiplier.multiplier.getValue(); i++){
for (int i = 0; i < ParticleMultiplier.multiplier.getValue(); i++) {
this.mc.effectRenderer.emitParticleAtEntity(entityHit, EnumParticleTypes.CRIT_MAGIC);
}
}

View File

@ -78,31 +78,28 @@ public class GuiButton extends Gui {
* Draws this button to the screen.
*/
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
if (this.visible) {
FontRenderer fontrenderer = mc.fontRendererObj;
mc.getTextureManager().bindTexture(buttonTextures);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width
&& mouseY < this.yPosition + this.height;
int i = this.getHoverState(this.hovered);
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(RealOpenGLEnums.GL_SRC_ALPHA, RealOpenGLEnums.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
GlStateManager.blendFunc(RealOpenGLEnums.GL_SRC_ALPHA, RealOpenGLEnums.GL_ONE_MINUS_SRC_ALPHA);
this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + i * 20, this.width / 2, this.height);
this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2,
46 + i * 20, this.width / 2, this.height);
this.mouseDragged(mc, mouseX, mouseY);
int j = 14737632;
if (!this.enabled) {
j = 10526880;
} else if (this.hovered) {
j = 14737632;
}
drawCenteredString(mc.fontRendererObj, this.displayString, this.xPosition + this.width / 2f, this.yPosition + (this.height - 8) / 2f, this.hovered && this.enabled ? new Color(47, 116, 253, 255).getRGB() : new Color(200, 200, 200).getRGB());
}
}
if (this.visible) {
FontRenderer fontrenderer = mc.fontRendererObj;
mc.getTextureManager().bindTexture(buttonTextures);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
int i = this.getHoverState(this.hovered);
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(RealOpenGLEnums.GL_SRC_ALPHA, RealOpenGLEnums.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
GlStateManager.blendFunc(RealOpenGLEnums.GL_SRC_ALPHA, RealOpenGLEnums.GL_ONE_MINUS_SRC_ALPHA);
this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + i * 20, this.width / 2, this.height);
this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + i * 20, this.width / 2, this.height);
this.mouseDragged(mc, mouseX, mouseY);
int j = 14737632;
if (!this.enabled) {
j = 10526880;
} else if (this.hovered) {
j = 14737632;
}
drawCenteredString(mc.fontRendererObj, this.displayString, this.xPosition + this.width / 2f, this.yPosition + (this.height - 8) / 2f, this.hovered && this.enabled ? new Color(47, 116, 253, 255).getRGB() : new Color(200, 200, 200).getRGB());
}
}
/**+
* Fired when the mouse button is dragged. Equivalent of

View File

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

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_SRC_ALPHA;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import dev.resent.client.Resent;
import dev.resent.module.base.RenderMod;
import dev.resent.util.misc.W;
import dev.resent.visual.crosshair.CrosshairManager;
import dev.resent.visual.ui.animation.SimpleAnimation;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerTextureAtlasSprite;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
@ -303,11 +301,14 @@ public class GuiIngame extends Gui {
this.overlayPlayerList.renderPlayerlist(i, scoreboard, scoreobjective1);
}
Resent.INSTANCE.modManager.modules.stream().filter(m -> m.isEnabled() && m instanceof RenderMod).forEach(m -> {
if(!Minecraft.getMinecraft().gameSettings.showDebugInfo && m.getName() != "CPS"){
((RenderMod) m).draw();
}
});
Resent.INSTANCE.modManager.modules
.stream()
.filter(m -> m.isEnabled() && m instanceof RenderMod)
.forEach(m -> {
if (!Minecraft.getMinecraft().gameSettings.showDebugInfo && m.getName() != "CPS") {
((RenderMod) m).draw();
}
});
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableLighting();
@ -318,12 +319,11 @@ public class GuiIngame extends Gui {
if (this.showCrosshair()) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
if(CrosshairManager.crosshairLocation == null){
if(CrosshairManager.read() != null)
CrosshairManager.forceLoad(CrosshairManager.read());
if (CrosshairManager.crosshairLocation == null) {
if (CrosshairManager.read() != null) CrosshairManager.forceLoad(CrosshairManager.read());
this.mc.getTextureManager().bindTexture(icons);
}
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR, 1, 0);
GlStateManager.enableAlpha();
@ -334,34 +334,33 @@ public class GuiIngame extends Gui {
public SimpleAnimation simpleAnimation = new SimpleAnimation(0.0F);
protected void renderTooltip(ScaledResolution sr, float partialTicks) {
if (this.mc.getRenderViewEntity() instanceof EntityPlayer) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(widgetsTexPath);
EntityPlayer entityplayer = (EntityPlayer) this.mc.getRenderViewEntity();
int i = sr.getScaledWidth() / 2;
float f = this.zLevel;
this.zLevel = -90.0F;
this.drawTexturedModalRect(i - 91, sr.getScaledHeight() - 22, 0, 0, 182, 22);
this.drawTexturedModalRect(i - 91 - 1 + entityplayer.inventory.currentItem * 20,
sr.getScaledHeight() - 22 - 1, 0, 22, 24, 22);
this.zLevel = f;
GlStateManager.enableRescaleNormal();
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, 1, 0);
RenderHelper.enableGUIStandardItemLighting();
protected void renderTooltip(ScaledResolution sr, float partialTicks) {
if (this.mc.getRenderViewEntity() instanceof EntityPlayer) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(widgetsTexPath);
EntityPlayer entityplayer = (EntityPlayer) this.mc.getRenderViewEntity();
int i = sr.getScaledWidth() / 2;
float f = this.zLevel;
this.zLevel = -90.0F;
this.drawTexturedModalRect(i - 91, sr.getScaledHeight() - 22, 0, 0, 182, 22);
this.drawTexturedModalRect(i - 91 - 1 + entityplayer.inventory.currentItem * 20, sr.getScaledHeight() - 22 - 1, 0, 22, 24, 22);
this.zLevel = f;
GlStateManager.enableRescaleNormal();
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, 1, 0);
RenderHelper.enableGUIStandardItemLighting();
for (int j = 0; j < 9; ++j) {
int k = sr.getScaledWidth() / 2 - 90 + j * 20 + 2;
int l = sr.getScaledHeight() - 16 - 3;
this.renderHotbarItem(j, k, l, partialTicks, entityplayer);
}
for (int j = 0; j < 9; ++j) {
int k = sr.getScaledWidth() / 2 - 90 + j * 20 + 2;
int l = sr.getScaledHeight() - 16 - 3;
this.renderHotbarItem(j, k, l, partialTicks, entityplayer);
}
RenderHelper.disableStandardItemLighting();
GlStateManager.disableRescaleNormal();
GlStateManager.disableBlend();
}
}
RenderHelper.disableStandardItemLighting();
GlStateManager.disableRescaleNormal();
GlStateManager.disableBlend();
}
}
public void renderHorseJumpBar(ScaledResolution parScaledResolution, int parInt1) {
this.mc.mcProfiler.startSection("jumpBar");

View File

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

View File

@ -558,12 +558,11 @@ public abstract class GuiScreen extends Gui implements GuiYesNoCallback {
private void openWebLink(String parURI) {
EagRuntime.openLink(parURI);
}
public boolean isMouseInside(double mouseX, double mouseY, double x, double y, double width, double height) {
return (mouseX >= x && mouseX <= width) && (mouseY >= y && mouseY <= height);
}
/**+
* Returns true if either windows ctrl key is down or if either
* mac meta key is down

View File

@ -66,7 +66,7 @@ public class GuiTextField extends Gui {
private boolean visible = true;
private GuiPageButtonList.GuiResponder field_175210_x;
private Predicate<String> field_175209_y = Predicates.alwaysTrue();
public boolean isTypingPassword = false;
public GuiTextField(int componentId, FontRenderer fontrendererObj, int x, int y, int par5Width, int par6Height) {
@ -452,49 +452,40 @@ public class GuiTextField extends Gui {
if (k > s.length()) {
k = s.length();
}
if (s.length() > 0) {
String s1 = flag ? s.substring(0, j) : s;
String s1 = flag ? s.substring(0, j) : s;
String s2 = s1;
if (s1.startsWith("/l ") || s1.startsWith("/login ") || s1.startsWith("/log ")) {
s2 = "";
String password = "";
// password isnt sent anywhere, its just used for counting how many "*" you need for hiding the password.
if (s1.startsWith("/l ")) {
s2 = s1.substring(0, 3);
password = s1.substring(3);
}
if (s1.startsWith("/login ")) {
s2 = s1.substring(0, 7);
password = s1.substring(7);
}
if (s1.startsWith("/log ")) {
s2 = s1.substring(0, 5);
password = s1.substring(7);
}
if (password.length() > 0) {
isTypingPassword = true;
for (int n = 0; n < password.length(); n++) {
s2 += "*";
}
}
s2 = "";
String password = "";
// password isnt sent anywhere, its just used for counting how many "*" you need for hiding the password.
if (s1.startsWith("/l ")) {
s2 = s1.substring(0, 3);
password = s1.substring(3);
}
if (s1.startsWith("/login ")) {
s2 = s1.substring(0, 7);
password = s1.substring(7);
}
if (s1.startsWith("/log ")) {
s2 = s1.substring(0, 5);
password = s1.substring(7);
}
if (password.length() > 0) {
isTypingPassword = true;
for (int n = 0; n < password.length(); n++) {
s2 += "*";
}
}
} else {
isTypingPassword = false;
}
else {
isTypingPassword = false;
}
j1 = this.fontRendererInstance.drawStringWithShadow(s2, (float) l, (float) i1, i);
}

View File

@ -2,11 +2,9 @@ package net.minecraft.client.model;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_COMPILE;
import java.util.List;
import com.google.common.collect.Lists;
import dev.resent.module.base.ModManager;
import java.util.List;
import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
@ -142,7 +140,6 @@ public class ModelRenderer {
private boolean compiledState;
public void render(float parFloat1) {
boolean batchRendering = ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.batchRendering.getValue();
if (compiledState != batchRendering) {
@ -273,7 +270,7 @@ public class ModelRenderer {
WorldRenderer worldrenderer = Tessellator.getInstance().getWorldRenderer();
boolean batchRendering = ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.batchRendering.getValue();
this.compiledState = batchRendering;
if (batchRendering) {
Tessellator.getInstance().getWorldRenderer().begin(7, DefaultVertexFormats.OLDMODEL_POSITION_TEX_NORMAL);

View File

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

View File

@ -282,24 +282,21 @@ public class PlayerControllerMP {
}
public void updateController() {
this.syncCurrentPlayItem();
if (this.netClientHandler.getNetworkManager().isChannelOpen()) {
try {
this.netClientHandler.getNetworkManager().processReceivedPackets();
} catch (IOException ex) {
EaglercraftNetworkManager.logger
.fatal("Unhandled IOException was thrown " + "while processing multiplayer packets!");
EaglercraftNetworkManager.logger.fatal(ex);
EaglercraftNetworkManager.logger.fatal("Disconnecting...");
this.netClientHandler.getNetworkManager()
.closeChannel(new ChatComponentText("Exception thrown: " + ex.toString()));
}
this.netClientHandler.getSkinCache().flush();
} else {
this.netClientHandler.getNetworkManager().checkDisconnected();
}
}
this.syncCurrentPlayItem();
if (this.netClientHandler.getNetworkManager().isChannelOpen()) {
try {
this.netClientHandler.getNetworkManager().processReceivedPackets();
} catch (IOException ex) {
EaglercraftNetworkManager.logger.fatal("Unhandled IOException was thrown " + "while processing multiplayer packets!");
EaglercraftNetworkManager.logger.fatal(ex);
EaglercraftNetworkManager.logger.fatal("Disconnecting...");
this.netClientHandler.getNetworkManager().closeChannel(new ChatComponentText("Exception thrown: " + ex.toString()));
}
this.netClientHandler.getSkinCache().flush();
} else {
this.netClientHandler.getNetworkManager().checkDisconnected();
}
}
private boolean isHittingPosition(BlockPos pos) {
ItemStack itemstack = this.mc.thePlayer.getHeldItem();

View File

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

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.Maps;
import dev.resent.module.base.ModManager;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -359,8 +357,7 @@ public class EffectRenderer {
}
public void addBlockDestroyEffects(BlockPos pos, IBlockState state) {
if(ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.blockEffects.getValue())
return;
if (ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.blockEffects.getValue()) return;
if (state.getBlock().getMaterial() != Material.air) {
state = state.getBlock().getActualState(state, this.worldObj, pos);
@ -383,8 +380,7 @@ public class EffectRenderer {
* Adds block hit particles for the specified block
*/
public void addBlockHitEffects(BlockPos pos, EnumFacing side) {
if(ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.blockEffects.getValue())
return;
if (ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.blockEffects.getValue()) return;
IBlockState iblockstate = this.worldObj.getBlockState(pos);
Block block = iblockstate.getBlock();

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.Predicates;
import dev.resent.client.Resent;
import dev.resent.module.base.ModManager;
import dev.resent.module.base.RenderMod;
@ -660,13 +659,11 @@ public class EntityRenderer implements IResourceManagerReloadListener {
}
public void enableLightmap() {
if(ModManager.fpsOptions.lightUpdates.getValue() || ModManager.fullbright.isEnabled())
return;
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.enableTexture2D();
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
if (ModManager.fpsOptions.lightUpdates.getValue() || ModManager.fullbright.isEnabled()) return;
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.enableTexture2D();
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
}
/**+
@ -886,7 +883,7 @@ public class EntityRenderer implements IResourceManagerReloadListener {
GlStateManager.enableOverlayFramebufferBlending();
this.mc.ingameGUI.renderGameOverlay(parFloat1);
}
if(ModManager.cps.isEnabled()){
if (ModManager.cps.isEnabled()) {
ModManager.cps.draw();
}
if (framebufferAge == -1l || framebufferAge > (Minecraft.getDebugFPS() < 25 ? 125l : 75l)) {
@ -1204,7 +1201,7 @@ public class EntityRenderer implements IResourceManagerReloadListener {
this.mc.mcProfiler.endStartSection("hand");
if(ModManager.adminSpawner.isEnabled()){
if (ModManager.adminSpawner.isEnabled()) {
ModManager.adminSpawner.render();
}
if (this.renderHand) {

View File

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

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

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

View File

@ -4,7 +4,6 @@ import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import dev.resent.client.Resent;
import dev.resent.module.base.ModManager;
import java.io.BufferedReader;
@ -225,7 +224,7 @@ public class GameSettings {
},
this.keyBindsHotbar
);
this.difficulty = EnumDifficulty.NORMAL;
this.lastServer = "";
this.fovSetting = 70.0F;

View File

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

View File

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

View File

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

View File

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

View File

@ -3,7 +3,6 @@ package net.minecraft.world;
import com.google.common.base.Predicate;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import dev.resent.module.base.ModManager;
import dev.resent.util.misc.W;
import java.util.ArrayList;
@ -2108,9 +2107,9 @@ public abstract class World implements IBlockAccess {
}
public boolean checkLightFor(EnumSkyBlock lightType, BlockPos pos) {
if(ModManager.fpsOptions.lightUpdates.getValue()){
if (ModManager.fpsOptions.lightUpdates.getValue()) {
return true;
}else if (!this.isAreaLoaded(pos, 17, false)) {
} else if (!this.isAreaLoaded(pos, 17, false)) {
return false;
} else {
int i = 0;

View File

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

View File

@ -1,12 +1,34 @@
package net.lax1dude.eaglercraft.v1_8.internal;
import com.jcraft.jzlib.DeflaterOutputStream;
import com.jcraft.jzlib.GZIPInputStream;
import com.jcraft.jzlib.GZIPOutputStream;
import com.jcraft.jzlib.InflaterInputStream;
import dev.resent.client.ClientInfo;
import dev.resent.client.Resent;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.function.Consumer;
import net.lax1dude.eaglercraft.v1_8.EagUtils;
import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion;
import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer;
import net.lax1dude.eaglercraft.v1_8.internal.buffer.EaglerArrayBufferAllocator;
import net.lax1dude.eaglercraft.v1_8.internal.buffer.FloatBuffer;
import net.lax1dude.eaglercraft.v1_8.internal.buffer.IntBuffer;
import net.lax1dude.eaglercraft.v1_8.internal.teavm.EPKLoader;
import net.lax1dude.eaglercraft.v1_8.internal.teavm.EarlyLoadScreen;
import net.lax1dude.eaglercraft.v1_8.internal.teavm.MainClass;
import net.lax1dude.eaglercraft.v1_8.internal.teavm.MainClass.EPKFileEntry;
import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMClientConfigAdapter;
import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMUtils;
import net.lax1dude.eaglercraft.v1_8.internal.teavm.WebGL2RenderingContext;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
import net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums;
import net.lax1dude.eaglercraft.v1_8.profile.EaglerProfile;
import org.teavm.interop.Async;
import org.teavm.interop.AsyncCallback;
import org.teavm.jso.JSBody;
@ -28,31 +50,6 @@ import org.teavm.jso.typedarrays.ArrayBuffer;
import org.teavm.jso.webaudio.MediaStream;
import org.teavm.jso.webgl.WebGLFramebuffer;
import com.jcraft.jzlib.DeflaterOutputStream;
import com.jcraft.jzlib.GZIPInputStream;
import com.jcraft.jzlib.GZIPOutputStream;
import com.jcraft.jzlib.InflaterInputStream;
import dev.resent.client.ClientInfo;
import dev.resent.client.Resent;
import net.lax1dude.eaglercraft.v1_8.EagUtils;
import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion;
import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer;
import net.lax1dude.eaglercraft.v1_8.internal.buffer.EaglerArrayBufferAllocator;
import net.lax1dude.eaglercraft.v1_8.internal.buffer.FloatBuffer;
import net.lax1dude.eaglercraft.v1_8.internal.buffer.IntBuffer;
import net.lax1dude.eaglercraft.v1_8.internal.teavm.EPKLoader;
import net.lax1dude.eaglercraft.v1_8.internal.teavm.EarlyLoadScreen;
import net.lax1dude.eaglercraft.v1_8.internal.teavm.MainClass;
import net.lax1dude.eaglercraft.v1_8.internal.teavm.MainClass.EPKFileEntry;
import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMClientConfigAdapter;
import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMUtils;
import net.lax1dude.eaglercraft.v1_8.internal.teavm.WebGL2RenderingContext;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
import net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums;
import net.lax1dude.eaglercraft.v1_8.profile.EaglerProfile;
/**
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
*
@ -158,7 +155,6 @@ public class PlatformRuntime {
EagUtils.sleep(50l);
logger.info("Decompressing: {}", logURL);
try {
EPKLoader.loadEPK(epkFileData, epkFiles[i].path, PlatformAssets.assets);
@ -173,7 +169,6 @@ public class PlatformRuntime {
logger.info("Initializing sound engine...");
enableScreen();
PlatformInput.pressAnyKeyScreen();
@ -197,13 +192,13 @@ public class PlatformRuntime {
@JSBody(params = { "version" }, script = "setVersion(version)")
public static native void setClientVersion(String version);
@JSBody( script = "die()")
@JSBody(script = "die()")
public static native void remove();
@JSBody( script = "enable()")
@JSBody(script = "enable()")
public static native void enableScreen();
@JSBody( script = "loading()")
@JSBody(script = "loading()")
public static native void loadingScreen();
@JSBody(params = {}, script = "return {antialias: false, depth: false, powerPreference: \"high-performance\", desynchronized: true, preserveDrawingBuffer: false, premultipliedAlpha: false, alpha: false};")
@ -304,32 +299,39 @@ public class PlatformRuntime {
request.setResponseType("arraybuffer");
request.open("GET", assetPackageURI, true);
TeaVMUtils.addEventListener(request, "load", new EventListener<Event>() {
@Override
public void handleEvent(Event evt) {
int stat = request.getStatus();
if(stat == 0 || (stat >= 200 && stat < 400)) {
cb.complete((ArrayBuffer)request.getResponse());
}else {
cb.complete(null);
TeaVMUtils.addEventListener(
request,
"load",
new EventListener<Event>() {
@Override
public void handleEvent(Event evt) {
int stat = request.getStatus();
if (stat == 0 || (stat >= 200 && stat < 400)) {
cb.complete((ArrayBuffer) request.getResponse());
} else {
cb.complete(null);
}
}
}
});
);
TeaVMUtils.addEventListener(request, "progress", new EventListener<Event>() {
@Override
public void handleEvent(Event evt) {
try{
int epkSize = Integer.parseInt(request.getResponseHeader("content-length"));
Event event = evt;
setBarProgress(event, epkSize);
}catch (Exception e){
e.printStackTrace();
TeaVMUtils.addEventListener(
request,
"progress",
new EventListener<Event>() {
@Override
public void handleEvent(Event evt) {
try {
int epkSize = Integer.parseInt(request.getResponseHeader("content-length"));
Event event = evt;
setBarProgress(event, epkSize);
} catch (Exception e) {
e.printStackTrace();
}
}
}
});
);
TeaVMUtils.addEventListener(
request,
@ -611,8 +613,10 @@ public class PlatformRuntime {
mediaRec = null;
}
}
@JSBody(params = {}, script = "showMojang();")
public static native void showMojangScreen();
@JSBody(params = {}, script = "die2();")
public static native void removeLoadScreen();
}

View File

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