This commit is contained in:
ThisIsALegitUsername 2023-02-19 17:39:01 +00:00
parent b66ca91aae
commit 361db9057e
85 changed files with 20891 additions and 21014 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -16,9 +16,8 @@
package com.google.common.base; package com.google.common.base;
import java.nio.charset.Charset;
import com.google.common.annotations.GwtCompatible; import com.google.common.annotations.GwtCompatible;
import java.nio.charset.Charset;
/** /**
* Contains constant definitions for the six standard {@link Charset} instances, * Contains constant definitions for the six standard {@link Charset} instances,

View File

@ -1,19 +1,25 @@
package dev.resent; package dev.resent;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter; import java.io.PrintWriter;
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 dev.resent.module.base.ModManager; import dev.resent.module.base.ModManager;
import dev.resent.module.base.RenderMod; import dev.resent.module.base.RenderMod;
import dev.resent.module.setting.BooleanSetting; import dev.resent.module.setting.BooleanSetting;
import dev.resent.module.setting.ModeSetting; import dev.resent.module.setting.ModeSetting;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.MusicTicker;
import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.audio.SoundHandler;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
public class Resent { public class Resent {
static { static {
INSTANCE = new Resent(); INSTANCE = new Resent();
} }
@ -27,7 +33,9 @@ public class Resent {
} }
public void save(PrintWriter printwriter) { public void save(PrintWriter printwriter) {
Resent.INSTANCE.modManager.modules.stream().forEach( m -> { Resent.INSTANCE.modManager.modules
.stream()
.forEach(m -> {
printwriter.println(m.getName() + ":" + m.isEnabled()); printwriter.println(m.getName() + ":" + m.isEnabled());
if (m instanceof RenderMod) { if (m instanceof RenderMod) {
printwriter.println(m.getName() + "_x:" + ((RenderMod) m).getX()); printwriter.println(m.getName() + "_x:" + ((RenderMod) m).getX());
@ -35,7 +43,9 @@ public class Resent {
printwriter.println(m.getName() + "_lastx:" + ((RenderMod) m).lastX); printwriter.println(m.getName() + "_lastx:" + ((RenderMod) m).lastX);
printwriter.println(m.getName() + "_lasty:" + ((RenderMod) m).lastY); printwriter.println(m.getName() + "_lasty:" + ((RenderMod) m).lastY);
} }
m.settings.stream().forEach(s -> { m.settings
.stream()
.forEach(s -> {
if (s instanceof ModeSetting) { if (s instanceof ModeSetting) {
printwriter.println(m.getName() + "_modesetting_" + s.name + ":" + ((ModeSetting) s).getValue()); printwriter.println(m.getName() + "_modesetting_" + s.name + ":" + ((ModeSetting) s).getValue());
} }
@ -47,8 +57,9 @@ public class Resent {
} }
public void load(String[] astring) { public void load(String[] astring) {
Resent.INSTANCE.modManager.modules
Resent.INSTANCE.modManager.modules.stream().forEach(m -> { .stream()
.forEach(m -> {
if (astring[0].equals(m.getName())) { if (astring[0].equals(m.getName())) {
m.setEnabled(astring[1].equals("true")); m.setEnabled(astring[1].equals("true"));
} }
@ -68,7 +79,9 @@ public class Resent {
} }
} }
m.settings.stream().forEach(se ->{ m.settings
.stream()
.forEach(se -> {
if (se instanceof ModeSetting) { if (se instanceof ModeSetting) {
if (astring[0].equals(m.getName() + "_modesetting_" + se.name)) { if (astring[0].equals(m.getName() + "_modesetting_" + se.name)) {
((ModeSetting) se).setValue(astring[1]); ((ModeSetting) se).setValue(astring[1]);
@ -85,20 +98,48 @@ public class Resent {
//Legacy code below. //Legacy code below.
/*public void playMusic(){ FileOutputStream fos = null;
MusicTicker player = Minecraft.getMinecraft().func_181535_r(); File temp;
SoundHandler soundhandler = Minecraft.getMinecraft().getSoundHandler();
player.func_181557_a(); public void playSoundFromByteArray(byte[] bArray) {
player.func_181558_a(MusicTicker.MusicType.RES); try {
soundhandler.resumeSounds(); temp = new File("C:/test").getAbsoluteFile();
}*/
if (!temp.exists()) {
temp.createNewFile();
}
fos = new FileOutputStream(temp);
fos.write(bArray);
fos.flush();
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(temp);
Clip clip = AudioSystem.getClip();
clip.open(audioInputStream);
clip.start();
} catch (IOException ioe) {
ioe.printStackTrace();
} catch (UnsupportedAudioFileException e) {
e.printStackTrace();
} catch (LineUnavailableException e) {
e.printStackTrace();
} finally {
try {
if (fos != null) {
fos.close();
}
} catch (IOException ioe) {
System.out.println("Error in closing the Stream");
}
}
}
public void test(){ public void test(){
Minecraft.getMinecraft().getSoundHandler().stopSounds();
Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("minecraft:music.res"), 1)); Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("minecraft:music.res"), 1));
} }
public void stopMusic() { public void stopMusic() {
Minecraft.getMinecraft().getSoundHandler().stopSounds(); Minecraft.getMinecraft().getSoundHandler().stopSounds();
} }
} }

View File

@ -1,16 +1,17 @@
package dev.resent.annotation; package dev.resent.annotation;
import dev.resent.module.base.Mod.Category;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
import dev.resent.module.base.Mod.Category;
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
public @interface Module { public @interface Module {
String name() default "placeholder"; String name() default "placeholder";
Category category() default Category.MISC; Category category() default Category.MISC;
boolean hasSetting() default false; boolean hasSetting() default false;
} }

View File

@ -1,18 +1,21 @@
package dev.resent.annotation; package dev.resent.annotation;
import dev.resent.module.base.Mod.Category;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
import dev.resent.module.base.Mod.Category;
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
public @interface RenderModule { public @interface RenderModule {
String name(); String name();
Category category(); Category category();
int x(); int x();
int y(); int y();
boolean hasSetting() default false; boolean hasSetting() default false;
} }

View File

@ -9,6 +9,7 @@ import net.minecraft.client.renderer.entity.layers.LayerRenderer;
public abstract class CosmeticBase implements LayerRenderer<AbstractClientPlayer> { public abstract class CosmeticBase implements LayerRenderer<AbstractClientPlayer> {
protected final RenderPlayer playerRenderer; protected final RenderPlayer playerRenderer;
public CosmeticBase(RenderPlayer playerRenderer) { public CosmeticBase(RenderPlayer playerRenderer) {
this.playerRenderer = playerRenderer; this.playerRenderer = playerRenderer;
} }
@ -23,7 +24,10 @@ public abstract class CosmeticBase implements LayerRenderer<AbstractClientPlayer
public abstract void render(AbstractClientPlayer player, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale); public abstract void render(AbstractClientPlayer player, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale);
@Override @Override
public boolean shouldCombineTextures() { return false; } public boolean shouldCombineTextures() {
return false;
}
public class CosmeticModelBase extends ModelBase { public class CosmeticModelBase extends ModelBase {
protected final ModelBiped playerModel; protected final ModelBiped playerModel;
@ -31,7 +35,5 @@ public abstract class CosmeticBase implements LayerRenderer<AbstractClientPlayer
public CosmeticModelBase(RenderPlayer player) { public CosmeticModelBase(RenderPlayer player) {
this.playerModel = player.getMainModel(); this.playerModel = player.getMainModel();
} }
} }
} }

View File

@ -23,25 +23,25 @@ public class CosmeticController {
return ModManager.cosmetics.isEnabled() && Cosmetics.show.getValue() && shouldRender(player) && Cosmetics.halo.getValue(); return ModManager.cosmetics.isEnabled() && Cosmetics.show.getValue() && shouldRender(player) && Cosmetics.halo.getValue();
} }
public static float[] getTopHatColor(AbstractClientPlayer player) {
return new float[] { 1, 0, 0 };
}
public static float[] getCrystalWingsColor(AbstractClientPlayer player) {
return new float[] { 1, 1, 1 };
}
public static float[] getTopHatColor(AbstractClientPlayer player){ return new float[]{1, 0, 0}; }
public static float[] getCrystalWingsColor(AbstractClientPlayer player){ return new float[]{1, 1, 1}; }
public static float[] getDragonWingsColor = new float[] { 1f, 1f, 1f, 1f }; public static float[] getDragonWingsColor = new float[] { 1f, 1f, 1f, 1f };
public static boolean shouldRender(AbstractClientPlayer player) { public static boolean shouldRender(AbstractClientPlayer player) {
switch (Cosmetics.who.getValue()) { switch (Cosmetics.who.getValue()) {
case "Only you": case "Only you":
return player == Minecraft.getMinecraft().thePlayer; return player == Minecraft.getMinecraft().thePlayer;
case "Everyone": case "Everyone":
return true; return true;
case "Everyone else": case "Everyone else":
return player != Minecraft.getMinecraft().thePlayer; return player != Minecraft.getMinecraft().thePlayer;
} }
return false; return false;
} }
} }

View File

@ -13,6 +13,7 @@ import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
public class CrystalWings extends CosmeticBase { public class CrystalWings extends CosmeticBase {
private CrytsalWingsModel crytsalWingsModel; private CrytsalWingsModel crytsalWingsModel;
public CrystalWings(RenderPlayer playerRenderer) { public CrystalWings(RenderPlayer playerRenderer) {
@ -33,6 +34,7 @@ public class CrystalWings extends CosmeticBase {
} }
public class CrytsalWingsModel extends CosmeticModelBase { public class CrytsalWingsModel extends CosmeticModelBase {
private ModelRenderer model; private ModelRenderer model;
ResourceLocation resourceLocation = new ResourceLocation("eagler:gui/crystal.png"); ResourceLocation resourceLocation = new ResourceLocation("eagler:gui/crystal.png");
@ -75,8 +77,7 @@ public class CrystalWings extends CosmeticBase {
modelrenderer1.rotateAngleZ = 0.0F; modelrenderer1.rotateAngleZ = 0.0F;
} else { } else {
RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager();
if (rendermanager != null) if (rendermanager != null) GlStateManager.rotate(rendermanager.playerViewX / 3.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(rendermanager.playerViewX / 3.0F, 1.0F, 0.0F, 0.0F);
} }
this.model.isHidden = false; this.model.isHidden = false;
for (int i = -1; i <= 1; i += 2) { for (int i = -1; i <= 1; i += 2) {
@ -87,10 +88,8 @@ public class CrystalWings extends CosmeticBase {
GlStateManager.alphaFunc(516, 0.003921569F); GlStateManager.alphaFunc(516, 0.003921569F);
GlStateManager.disableLighting(); GlStateManager.disableLighting();
Minecraft.getMinecraft().getTextureManager().bindTexture(this.resourceLocation); Minecraft.getMinecraft().getTextureManager().bindTexture(this.resourceLocation);
if (i == 1) if (i == 1) GlStateManager.scale(-1.0F, 1.0F, 1.0F);
GlStateManager.scale(-1.0F, 1.0F, 1.0F);
GlStateManager.translate(0.05D, 0.0D, 0.0D); GlStateManager.translate(0.05D, 0.0D, 0.0D);
this.model.render(scale); this.model.render(scale);
GlStateManager.disableBlend(); GlStateManager.disableBlend();

View File

@ -9,6 +9,7 @@ import net.minecraft.client.renderer.entity.RenderPlayer;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
public class Glasses extends CosmeticBase { public class Glasses extends CosmeticBase {
private final GlassesRenderer glassesModel; private final GlassesRenderer glassesModel;
public Glasses(RenderPlayer renderPlayer) { public Glasses(RenderPlayer renderPlayer) {
@ -121,8 +122,7 @@ public class Glasses extends CosmeticBase {
} }
} }
private void setRotation(ModelRenderer model, float x, float y, float z) private void setRotation(ModelRenderer model, float x, float y, float z) {
{
model.rotateAngleX = x; model.rotateAngleX = x;
model.rotateAngleY = y; model.rotateAngleY = y;
model.rotateAngleZ = z; model.rotateAngleZ = z;

View File

@ -12,6 +12,7 @@ import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
public class Halo extends CosmeticBase { public class Halo extends CosmeticBase {
private final ModelHalo modelHalo; private final ModelHalo modelHalo;
private static final ResourceLocation HALOBLUE; private static final ResourceLocation HALOBLUE;
@ -38,8 +39,8 @@ public class Halo extends CosmeticBase {
} }
} }
private class ModelHalo extends CosmeticModelBase private class ModelHalo extends CosmeticModelBase {
{
private ModelRenderer halo; private ModelRenderer halo;
public ModelHalo(final RenderPlayer player) { public ModelHalo(final RenderPlayer player) {
@ -71,6 +72,5 @@ public class Halo extends CosmeticBase {
Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation); Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation);
return colorModel; return colorModel;
} }
} }
} }

View File

@ -20,8 +20,7 @@ public class TopHat extends CosmeticBase{
} }
@Override @Override
public void render(AbstractClientPlayer player, float limbSwing, float limbSwingAmount, float partialTicks, public void render(AbstractClientPlayer player, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float HeadYaw, float headPitch, float scale) {
float ageInTicks, float HeadYaw, float headPitch, float scale) {
if (CosmeticController.renderTopHat(player)) { if (CosmeticController.renderTopHat(player)) {
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
playerRenderer.bindTexture(hat); playerRenderer.bindTexture(hat);
@ -53,7 +52,6 @@ public class TopHat extends CosmeticBase{
@Override @Override
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float headYaw, float headPitch, float scale) { public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float headYaw, float headPitch, float scale) {
rim.rotateAngleX = playerModel.bipedHead.rotateAngleX; rim.rotateAngleX = playerModel.bipedHead.rotateAngleX;
rim.rotateAngleY = playerModel.bipedHead.rotateAngleY; rim.rotateAngleY = playerModel.bipedHead.rotateAngleY;
rim.rotationPointX = 0.0f; rim.rotationPointX = 0.0f;
@ -65,8 +63,6 @@ public class TopHat extends CosmeticBase{
tip.rotationPointX = 0.0f; tip.rotationPointX = 0.0f;
tip.rotationPointY = 0.0f; tip.rotationPointY = 0.0f;
tip.render(scale); tip.render(scale);
}
}
} }
} }

View File

@ -1,13 +1,12 @@
package dev.resent.module.base; package dev.resent.module.base;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import dev.resent.annotation.Module; import dev.resent.annotation.Module;
import dev.resent.module.setting.Setting; import dev.resent.module.setting.Setting;
import dev.resent.ui.Theme; import dev.resent.ui.Theme;
import dev.resent.util.render.RenderUtils; import dev.resent.util.render.RenderUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
public abstract class Mod { public abstract class Mod {
@ -30,8 +29,12 @@ public abstract class Mod {
} }
} }
public void addSetting(final Setting... settings) { this.settings.addAll(Arrays.asList(settings)); } public void addSetting(final Setting... settings) {
this.settings.addAll(Arrays.asList(settings));
}
public void onEnable() {} public void onEnable() {}
public void onDisable() {} public void onDisable() {}
public void toggle() { public void toggle() {
@ -40,11 +43,9 @@ public abstract class Mod {
} }
private void onChange() { private void onChange() {
if(enabled) if (enabled) onEnable(); else onDisable();
onEnable();
else
onDisable();
} }
public void setEnabled(final boolean enabled) { public void setEnabled(final boolean enabled) {
this.enabled = enabled; this.enabled = enabled;
onChange(); onChange();
@ -70,17 +71,37 @@ public abstract class Mod {
public final String name; public final String name;
public int i; public int i;
Category(final String name) { Category(final String name) {
this.name = name; this.name = name;
} }
} }
public boolean isEnabled() { return enabled; } public boolean isEnabled() {
public boolean isHasSetting() { return hasSetting; } return enabled;
public String getName() { return name; } }
public Category getCategory() { return category; }
public void setName(String name) { this.name = name; } public boolean isHasSetting() {
public void setCategory(Category category) { this.category = category; } return hasSetting;
public void setHasSetting(boolean hasSetting) { this.hasSetting = hasSetting; } }
public String getName() {
return name;
}
public Category getCategory() {
return category;
}
public void setName(String name) {
this.name = name;
}
public void setCategory(Category category) {
this.category = category;
}
public void setHasSetting(boolean hasSetting) {
this.hasSetting = hasSetting;
}
} }

View File

@ -1,9 +1,5 @@
package dev.resent.module.base; package dev.resent.module.base;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import dev.resent.module.base.Mod.Category; import dev.resent.module.base.Mod.Category;
import dev.resent.module.impl.hud.ArmorHud; import dev.resent.module.impl.hud.ArmorHud;
import dev.resent.module.impl.hud.CPS; import dev.resent.module.impl.hud.CPS;
@ -33,8 +29,12 @@ import dev.resent.module.impl.misc.NoSwingDelay;
import dev.resent.module.impl.misc.Scoreboard; import dev.resent.module.impl.misc.Scoreboard;
import dev.resent.module.impl.misc.Sprint; import dev.resent.module.impl.misc.Sprint;
import dev.resent.module.impl.misc.TabGui; import dev.resent.module.impl.misc.TabGui;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
public class ModManager { public class ModManager {
public List<Mod> modules = new ArrayList<>(); public List<Mod> modules = new ArrayList<>();
public static Cosmetics cosmetics = new Cosmetics(); public static Cosmetics cosmetics = new Cosmetics();

View File

@ -24,8 +24,8 @@ public abstract class RenderMod extends Mod {
} }
public void draw() {} public void draw() {}
public void renderLayout(final int mouseX, final int mouseY) {
public void renderLayout(final int mouseX, final int mouseY) {
if ((getX() + getWidth()) > GuiScreen.width) { if ((getX() + getWidth()) > GuiScreen.width) {
this.x = GuiScreen.width - getWidth(); this.x = GuiScreen.width - getWidth();
dragging = false; dragging = false;
@ -61,7 +61,6 @@ public abstract class RenderMod extends Mod {
this.lastY = y - mouseY; this.lastY = y - mouseY;
this.dragging = true; this.dragging = true;
} }
} }
public int getX() { public int getX() {

View File

@ -13,7 +13,10 @@ import net.minecraft.item.ItemStack;
public class ArmorHud extends RenderMod { public class ArmorHud extends RenderMod {
public ScaledResolution sr; public ScaledResolution sr;
public ArmorHud() { addSetting(helm, chestp, leg, boot, item); }
public ArmorHud() {
addSetting(helm, chestp, leg, boot, item);
}
public static BooleanSetting helm = new BooleanSetting("Helmet", "", true); public static BooleanSetting helm = new BooleanSetting("Helmet", "", true);
public static BooleanSetting chestp = new BooleanSetting("Chestplate", "", true); public static BooleanSetting chestp = new BooleanSetting("Chestplate", "", true);
@ -21,8 +24,13 @@ public class ArmorHud extends RenderMod {
public static BooleanSetting boot = new BooleanSetting("Boots", "", true); public static BooleanSetting boot = new BooleanSetting("Boots", "", true);
public static BooleanSetting item = new BooleanSetting("Item", "", true); public static BooleanSetting item = new BooleanSetting("Item", "", true);
public int getWidth() { return 20; } public int getWidth() {
public int getHeight() { return 96; } return 20;
}
public int getHeight() {
return 96;
}
@Override @Override
public void draw() { public void draw() {

View File

@ -1,13 +1,12 @@
package dev.resent.module.impl.hud; package dev.resent.module.impl.hud;
import java.util.ArrayList;
import java.util.List;
import dev.resent.annotation.RenderModule; import dev.resent.annotation.RenderModule;
import dev.resent.module.base.Mod.Category; import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.RenderMod; import dev.resent.module.base.RenderMod;
import dev.resent.ui.Theme; import dev.resent.ui.Theme;
import dev.resent.util.misc.FuncUtils; import dev.resent.util.misc.FuncUtils;
import java.util.ArrayList;
import java.util.List;
@RenderModule(name = "CPS", category = Category.HUD, x = 4, y = 26) @RenderModule(name = "CPS", category = Category.HUD, x = 4, y = 26)
public class CPS extends RenderMod { public class CPS extends RenderMod {
@ -16,12 +15,16 @@ public class CPS extends RenderMod {
private boolean wasPressed; private boolean wasPressed;
private long lastPressed; private long lastPressed;
public int getWidth() { return mc.fontRendererObj.getStringWidth("[CPS: "+ clicks.size() + "]") + 4; } public int getWidth() {
public int getHeight() { return mc.fontRendererObj.FONT_HEIGHT+4; } return mc.fontRendererObj.getStringWidth("[CPS: " + clicks.size() + "]") + 4;
}
public int getHeight() {
return mc.fontRendererObj.FONT_HEIGHT + 4;
}
@Override @Override
public void draw() { public void draw() {
boolean pressed = mc.gameSettings.keyBindAttack.pressed || mc.gameSettings.keyBindUseItem.pressed; boolean pressed = mc.gameSettings.keyBindAttack.pressed || mc.gameSettings.keyBindUseItem.pressed;
if (pressed != wasPressed) { if (pressed != wasPressed) {
@ -37,5 +40,4 @@ public class CPS extends RenderMod {
drawString("[CPS: " + clicks.size() + "]", this.x + 2, this.y + 2, Theme.getFontColor(Theme.getFontId()), Theme.getTextShadow()); drawString("[CPS: " + clicks.size() + "]", this.x + 2, this.y + 2, Theme.getFontColor(Theme.getFontId()), Theme.getTextShadow());
} }
} }

View File

@ -27,8 +27,13 @@ public class ComboCounter extends RenderMod {
} }
} }
public int getWidth() { return Minecraft.getMinecraft().fontRendererObj.getStringWidth(getText()) + 4; } public int getWidth() {
public int getHeight() { return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT + 4; } return Minecraft.getMinecraft().fontRendererObj.getStringWidth(getText()) + 4;
}
public int getHeight() {
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT + 4;
}
private String getText() { private String getText() {
return "[" + combo + " Combo]"; return "[" + combo + " Combo]";

View File

@ -9,8 +9,13 @@ import net.minecraft.client.Minecraft;
@RenderModule(name = "FPS", category = Category.HUD, x = 4, y = 38) @RenderModule(name = "FPS", category = Category.HUD, x = 4, y = 38)
public class FPS extends RenderMod { public class FPS extends RenderMod {
public int getWidth() { return mc.fontRendererObj.getStringWidth(getText()) + 4; } public int getWidth() {
public int getHeight() { return mc.fontRendererObj.FONT_HEIGHT + 4; } return mc.fontRendererObj.getStringWidth(getText()) + 4;
}
public int getHeight() {
return mc.fontRendererObj.FONT_HEIGHT + 4;
}
public String getText() { public String getText() {
return "[FPS: " + Minecraft.debugFPS + "]"; return "[FPS: " + Minecraft.debugFPS + "]";

View File

@ -1,8 +1,8 @@
package dev.resent.module.impl.hud; package dev.resent.module.impl.hud;
import dev.resent.annotation.Module; import dev.resent.annotation.Module;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.Mod; import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
import dev.resent.util.misc.W; import dev.resent.util.misc.W;
import net.lax1dude.eaglercraft.v1_8.Keyboard; import net.lax1dude.eaglercraft.v1_8.Keyboard;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;

View File

@ -1,15 +1,17 @@
package dev.resent.module.impl.hud; package dev.resent.module.impl.hud;
import dev.resent.annotation.Module; import dev.resent.annotation.Module;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.Mod; import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.setting.BooleanSetting; import dev.resent.module.setting.BooleanSetting;
import dev.resent.module.setting.ModeSetting; import dev.resent.module.setting.ModeSetting;
@Module(name = "Hitboxes", category = Category.HUD, hasSetting = true) @Module(name = "Hitboxes", category = Category.HUD, hasSetting = true)
public class Hitboxes extends Mod { public class Hitboxes extends Mod {
public Hitboxes() { addSetting(color, old); } public Hitboxes() {
addSetting(color, old);
}
public static ModeSetting color = new ModeSetting("Color", "", "White", "Red", "Yellow", "Green", "Blue", "Pink", "Orange", "Black"); public static ModeSetting color = new ModeSetting("Color", "", "White", "Red", "Yellow", "Green", "Blue", "Pink", "Orange", "Black");
public static BooleanSetting old = new BooleanSetting("1.7 Hitboxes", "", true); public static BooleanSetting old = new BooleanSetting("1.7 Hitboxes", "", true);

View File

@ -39,10 +39,8 @@ public class Info extends RenderMod {
drawString(" Y: " + py, this.x + 5, this.y + 24, Theme.getFontColor(Theme.getFontId()), Theme.getTextShadow()); drawString(" Y: " + py, this.x + 5, this.y + 24, Theme.getFontColor(Theme.getFontId()), Theme.getTextShadow());
drawString(" Z: " + pz, this.x + 5, this.y + 34, Theme.getFontColor(Theme.getFontId()), Theme.getTextShadow()); drawString(" Z: " + pz, this.x + 5, this.y + 34, Theme.getFontColor(Theme.getFontId()), Theme.getTextShadow());
if (direction.getValue()) if (direction.getValue()) drawString(" Dir: " + directionsF[rot], this.x + 5 + mc.fontRendererObj.getStringWidth(" X: " + px), this.y + 14, Theme.getFontColor(Theme.getFontId()), Theme.getTextShadow());
drawString(" Dir: " + directionsF[rot], this.x+5+mc.fontRendererObj.getStringWidth(" X: " + px), this.y + 14, Theme.getFontColor(Theme.getFontId()), Theme.getTextShadow());
drawString(" Biome: " + mc.theWorld.getBiomeGenForCoords(new BlockPos(px, py, pz)).biomeName, this.x + 5, this.y + 44, Theme.getFontColor(Theme.getFontId()), Theme.getTextShadow()); drawString(" Biome: " + mc.theWorld.getBiomeGenForCoords(new BlockPos(px, py, pz)).biomeName, this.x + 5, this.y + 44, Theme.getFontColor(Theme.getFontId()), Theme.getTextShadow());
} }
} }
} }

View File

@ -1,8 +1,5 @@
package dev.resent.module.impl.hud; package dev.resent.module.impl.hud;
import java.util.ArrayList;
import java.util.List;
import dev.resent.annotation.RenderModule; import dev.resent.annotation.RenderModule;
import dev.resent.module.base.Mod.Category; import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.RenderMod; import dev.resent.module.base.RenderMod;
@ -12,6 +9,8 @@ import dev.resent.ui.Theme;
import dev.resent.util.misc.FuncUtils; import dev.resent.util.misc.FuncUtils;
import dev.resent.util.render.Color; import dev.resent.util.render.Color;
import dev.resent.util.render.RenderUtils; import dev.resent.util.render.RenderUtils;
import java.util.ArrayList;
import java.util.List;
import net.lax1dude.eaglercraft.v1_8.Mouse; import net.lax1dude.eaglercraft.v1_8.Mouse;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
@ -40,16 +39,14 @@ public class KeyStrokes extends RenderMod{
public long lastPressed2; public long lastPressed2;
public float getSize(ModeSetting size) { public float getSize(ModeSetting size) {
if (size.getValue() == "Small") if (size.getValue() == "Small") return 0.75f;
return 0.75f; if (size.getValue() == "Normal") return 1.0f;
if (size.getValue() == "Normal") if (size.getValue() == "Large") return 1.25f;
return 1.0f;
if (size.getValue() == "Large")
return 1.25f;
return 1.0f; return 1.0f;
} }
public int getLeftCPS() { final long leftTime = System.currentTimeMillis() + 100L; public int getLeftCPS() {
final long leftTime = System.currentTimeMillis() + 100L;
FuncUtils.removeIf(clicks, beenLeftTime -> beenLeftTime + 1200L < leftTime + 200L); FuncUtils.removeIf(clicks, beenLeftTime -> beenLeftTime + 1200L < leftTime + 200L);
return this.clicks.size(); return this.clicks.size();
} }
@ -64,7 +61,6 @@ public class KeyStrokes extends RenderMod{
@Override @Override
public void draw() { public void draw() {
boolean pressed = mc.gameSettings.keyBindAttack.pressed; boolean pressed = mc.gameSettings.keyBindAttack.pressed;
boolean rpressed = mc.gameSettings.keyBindUseItem.pressed; boolean rpressed = mc.gameSettings.keyBindUseItem.pressed;
boolean wKey = mc.gameSettings.keyBindForward.pressed; boolean wKey = mc.gameSettings.keyBindForward.pressed;
@ -82,54 +78,39 @@ public class KeyStrokes extends RenderMod{
if (pressed != this.wasPressed) { if (pressed != this.wasPressed) {
this.lastPressed = System.currentTimeMillis(); this.lastPressed = System.currentTimeMillis();
this.wasPressed = pressed; this.wasPressed = pressed;
if (pressed) if (pressed) this.clicks.add(Long.valueOf(this.lastPressed));
this.clicks.add(Long.valueOf(this.lastPressed));
} }
if (rpressed != this.wasPressed2) { if (rpressed != this.wasPressed2) {
this.lastPressed2 = System.currentTimeMillis() + 10L; this.lastPressed2 = System.currentTimeMillis() + 10L;
this.wasPressed2 = rpressed; this.wasPressed2 = rpressed;
if (rpressed) if (rpressed) this.clicks2.add(Long.valueOf(this.lastPressed2));
this.clicks2.add(Long.valueOf(this.lastPressed2));
} }
//W //W
RenderUtils.drawRoundedRect(this.x + 30, this.y + 3, this.x + 55, this.y + 25 + 3, 4, RenderUtils.drawRoundedRect(this.x + 30, this.y + 3, this.x + 55, this.y + 25 + 3, 4, wKey ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded());
wKey ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded());
// S // S
RenderUtils.drawRoundedRect(this.x + 30, this.y + 30, this.x + 55, this.y + 55, 4, RenderUtils.drawRoundedRect(this.x + 30, this.y + 30, this.x + 55, this.y + 55, 4, sKey ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded());
sKey ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded());
// A // A
RenderUtils.drawRoundedRect(this.x + 3, this.y + 30, this.x + 25 + 3, this.y + 55, 4, RenderUtils.drawRoundedRect(this.x + 3, this.y + 30, this.x + 25 + 3, this.y + 55, 4, aKey ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded());
aKey ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded());
// D // D
RenderUtils.drawRoundedRect(this.x + 60 - 3, this.y + 30, this.x + 85 - 3, this.y + 25 + 5 + 25, 4, RenderUtils.drawRoundedRect(this.x + 60 - 3, this.y + 30, this.x + 85 - 3, this.y + 25 + 5 + 25, 4, dKey ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded());
dKey ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded());
// LMB // LMB
RenderUtils.drawRoundedRect(this.x+3, this.y+57, this.x+41, this.y+82, 4, RenderUtils.drawRoundedRect(this.x + 3, this.y + 57, this.x + 41, this.y + 82, 4, pressed ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded());
pressed ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded());
// RMB // RMB
RenderUtils.drawRoundedRect(this.x + 45 - 1, this.y + 60 - 3, this.x + 85 - 3, this.y + 85 - 3, 4, RenderUtils.drawRoundedRect(this.x + 45 - 1, this.y + 60 - 3, this.x + 85 - 3, this.y + 85 - 3, 4, rpressed ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded());
rpressed ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded());
// Jump // Jump
if(jump.getValue()) if (jump.getValue()) RenderUtils.drawRoundedRect(this.x + 3, this.y + 84, this.x + 85 - 3, this.y + 105 - 6, 4, jumpKey ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded());
RenderUtils.drawRoundedRect(this.x + 3, this.y+84, this.x+85-3,
this.y + 105 - 6, 4, jumpKey ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded());
// Sneak // Sneak
if (sneak.getValue()) if (sneak.getValue()) RenderUtils.drawRoundedRect(this.x + 3, jump.getValue() ? this.y + 102 : this.y + 84, this.x + 85 - 3, jump.getValue() ? this.y + 120 - 3 : this.y + 105 - 6, 4, mc.gameSettings.keyBindSneak.pressed ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded());
RenderUtils.drawRoundedRect(this.x + 3, jump.getValue() ? this.y+102 : this.y+84, this.x+85-3,
jump.getValue() ? this.y+120-3 : this.y+105-6, 4, mc.gameSettings.keyBindSneak.pressed ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded());
mc.fontRendererObj.drawString("W", this.x + 25 + 5 + (25 / 2 - mc.fontRendererObj.getStringWidth("W") + 4), this.y + 8 + 3, wKey ? getColor(colorp) : getColor(color), tshadow.getValue()); mc.fontRendererObj.drawString("W", this.x + 25 + 5 + (25 / 2 - mc.fontRendererObj.getStringWidth("W") + 4), this.y + 8 + 3, wKey ? getColor(colorp) : getColor(color), tshadow.getValue());
mc.fontRendererObj.drawString("S", this.x + 25 + 5 + (25 / 2 - mc.fontRendererObj.getStringWidth("S") + 4), this.y + 38, sKey ? getColor(colorp) : getColor(color), tshadow.getValue()); mc.fontRendererObj.drawString("S", this.x + 25 + 5 + (25 / 2 - mc.fontRendererObj.getStringWidth("S") + 4), this.y + 38, sKey ? getColor(colorp) : getColor(color), tshadow.getValue());
mc.fontRendererObj.drawString("A", this.x + 3 + (25 / 2 - mc.fontRendererObj.getStringWidth("A") + 4), this.y + 38, aKey ? getColor(colorp) : getColor(color), tshadow.getValue()); mc.fontRendererObj.drawString("A", this.x + 3 + (25 / 2 - mc.fontRendererObj.getStringWidth("A") + 4), this.y + 38, aKey ? getColor(colorp) : getColor(color), tshadow.getValue());
mc.fontRendererObj.drawString("D", this.x + -3 + 25 + 25 + 10 + (25 / 2 - mc.fontRendererObj.getStringWidth("D") + 4), this.y + 38, dKey ? getColor(colorp) : getColor(color), tshadow.getValue()); mc.fontRendererObj.drawString("D", this.x + -3 + 25 + 25 + 10 + (25 / 2 - mc.fontRendererObj.getStringWidth("D") + 4), this.y + 38, dKey ? getColor(colorp) : getColor(color), tshadow.getValue());
if(jump.getValue()) if (jump.getValue()) mc.fontRendererObj.drawString("\u00A7m-------", this.x + 85 + (25 / 2 - mc.fontRendererObj.getStringWidth("u00A7m-------") + 4), this.y + 92 - 3, jumpKey ? getColor(colorp) : getColor(color), tshadow.getValue());
mc.fontRendererObj.drawString("\u00A7m-------", this.x+85+(25/2-mc.fontRendererObj.getStringWidth("u00A7m-------") + 4), this.y+92-3, jumpKey ? getColor(colorp) : getColor(color), tshadow.getValue()); if (sneak.getValue()) mc.fontRendererObj.drawString("Sneak", this.x + 38 + 3 + (25 / 2 - mc.fontRendererObj.getStringWidth("Sneak") + 4), jump.getValue() ? this.y + 92 + 15 + 1 - 3 : this.y + 92 - 4, mc.gameSettings.keyBindSneak.pressed ? getColor(colorp) : getColor(color), tshadow.getValue());
if(sneak.getValue())
mc.fontRendererObj.drawString("Sneak", this.x+38+3+(25/2-mc.fontRendererObj.getStringWidth("Sneak") + 4), jump.getValue() ? this.y+92+15+1-3 : this.y+92-4, mc.gameSettings.keyBindSneak.pressed ? getColor(colorp) : getColor(color), tshadow.getValue());
mc.fontRendererObj.drawString("LMB", this.x + 3 + 40 / 2 - mc.fontRendererObj.getStringWidth("LMB") / 2, (this.y + 60 + 25 / 2) - mc.fontRendererObj.FONT_HEIGHT / 2 - 3, Mouse.isButtonDown(0) ? getColor(colorp) : getColor(color), tshadow.getValue()); mc.fontRendererObj.drawString("LMB", this.x + 3 + 40 / 2 - mc.fontRendererObj.getStringWidth("LMB") / 2, (this.y + 60 + 25 / 2) - mc.fontRendererObj.FONT_HEIGHT / 2 - 3, Mouse.isButtonDown(0) ? getColor(colorp) : getColor(color), tshadow.getValue());
mc.fontRendererObj.drawString("RMB", this.x + 40 + 3 + 40 / 2 - mc.fontRendererObj.getStringWidth("RMB") / 2, (this.y + 60 + 25 / 2) - mc.fontRendererObj.FONT_HEIGHT / 2 - 3, Mouse.isButtonDown(1) ? getColor(colorp) : getColor(color), tshadow.getValue()); mc.fontRendererObj.drawString("RMB", this.x + 40 + 3 + 40 / 2 - mc.fontRendererObj.getStringWidth("RMB") / 2, (this.y + 60 + 25 / 2) - mc.fontRendererObj.FONT_HEIGHT / 2 - 3, Mouse.isButtonDown(1) ? getColor(colorp) : getColor(color), tshadow.getValue());
this.setHeight((25 + 5 + 25 + 5 + 25 + 25)); this.setHeight((25 + 5 + 25 + 5 + 25 + 25));
@ -137,7 +118,6 @@ public class KeyStrokes extends RenderMod{
} }
public static int getColor(ModeSetting asdf) { public static int getColor(ModeSetting asdf) {
switch (asdf.getValue()) { switch (asdf.getValue()) {
case "Red": case "Red":
return new Color(255, 0, 0, 208).getRGB(); return new Color(255, 0, 0, 208).getRGB();
@ -158,5 +138,4 @@ public class KeyStrokes extends RenderMod{
} }
return -1; return -1;
} }
} }

View File

@ -1,10 +1,9 @@
package dev.resent.module.impl.hud; package dev.resent.module.impl.hud;
import java.util.Collection;
import dev.resent.annotation.RenderModule; import dev.resent.annotation.RenderModule;
import dev.resent.module.base.Mod.Category; import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.RenderMod; import dev.resent.module.base.RenderMod;
import java.util.Collection;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer; import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
@ -39,8 +38,7 @@ public class PotionHUD extends RenderMod {
GlStateManager.disableLighting(); GlStateManager.disableLighting();
GlStateManager.enableAlpha(); GlStateManager.enableAlpha();
int l = 33; int l = 33;
if (collection.size() > 5) if (collection.size() > 5) l = 132 / (collection.size() - 1);
l = 132 / (collection.size() - 1);
for (PotionEffect potioneffect : mc.thePlayer.getActivePotionEffects()) { for (PotionEffect potioneffect : mc.thePlayer.getActivePotionEffects()) {
Potion potion = Potion.potionTypes[potioneffect.getPotionID()]; Potion potion = Potion.potionTypes[potioneffect.getPotionID()];
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);

View File

@ -1,11 +1,10 @@
package dev.resent.module.impl.hud; package dev.resent.module.impl.hud;
import java.text.DecimalFormat;
import dev.resent.annotation.RenderModule; import dev.resent.annotation.RenderModule;
import dev.resent.module.base.Mod.Category; import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.RenderMod; import dev.resent.module.base.RenderMod;
import dev.resent.ui.Theme; import dev.resent.ui.Theme;
import java.text.DecimalFormat;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.util.Vec3; import net.minecraft.util.Vec3;

View File

@ -1,8 +1,8 @@
package dev.resent.module.impl.misc; package dev.resent.module.impl.misc;
import dev.resent.annotation.Module; import dev.resent.annotation.Module;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.Mod; import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
@Module(name = "Animations", category = Category.MISC) @Module(name = "Animations", category = Category.MISC)
public class Animations extends Mod {} public class Animations extends Mod {}

View File

@ -1,14 +1,16 @@
package dev.resent.module.impl.misc; package dev.resent.module.impl.misc;
import dev.resent.annotation.Module; import dev.resent.annotation.Module;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.Mod; import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.setting.BooleanSetting; import dev.resent.module.setting.BooleanSetting;
@Module(name = "AutoGG", category = Category.MISC, hasSetting = true) @Module(name = "AutoGG", category = Category.MISC, hasSetting = true)
public class AutoGG extends Mod { public class AutoGG extends Mod {
public AutoGG() { addSetting(rep, onLose, onWin); } public AutoGG() {
addSetting(rep, onLose, onWin);
}
public static BooleanSetting rep = new BooleanSetting("Repetition bypass", "", true); public static BooleanSetting rep = new BooleanSetting("Repetition bypass", "", true);
public static BooleanSetting onLose = new BooleanSetting("On Lose", "", true); public static BooleanSetting onLose = new BooleanSetting("On Lose", "", true);

View File

@ -1,8 +1,8 @@
package dev.resent.module.impl.misc; package dev.resent.module.impl.misc;
import dev.resent.annotation.Module; import dev.resent.annotation.Module;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.Mod; import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
@Module(name = "AutoRespawn", category = Category.MISC) @Module(name = "AutoRespawn", category = Category.MISC)
public class AutoRespawn extends Mod { public class AutoRespawn extends Mod {
@ -14,5 +14,4 @@ public class AutoRespawn extends Mod {
} }
} }
} }
} }

View File

@ -1,8 +1,8 @@
package dev.resent.module.impl.misc; package dev.resent.module.impl.misc;
import dev.resent.annotation.Module; import dev.resent.annotation.Module;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.Mod; import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
@Module(name = "Clear chat", category = Category.MISC) @Module(name = "Clear chat", category = Category.MISC)
public class ClearChat extends Mod {} public class ClearChat extends Mod {}

View File

@ -1,14 +1,17 @@
package dev.resent.module.impl.misc; package dev.resent.module.impl.misc;
import dev.resent.annotation.Module; import dev.resent.annotation.Module;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.Mod; import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.setting.BooleanSetting; import dev.resent.module.setting.BooleanSetting;
import dev.resent.module.setting.ModeSetting; import dev.resent.module.setting.ModeSetting;
@Module(name = "Cosmetics", category = Category.MISC, hasSetting = true) @Module(name = "Cosmetics", category = Category.MISC, hasSetting = true)
public class Cosmetics extends Mod { public class Cosmetics extends Mod {
public Cosmetics(){ addSetting(who, show, halo, crystalwings, glasses, hat); }
public Cosmetics() {
addSetting(who, show, halo, crystalwings, glasses, hat);
}
public static BooleanSetting show = new BooleanSetting("Show cosmetics", "", true); public static BooleanSetting show = new BooleanSetting("Show cosmetics", "", true);
public static BooleanSetting crystalwings = new BooleanSetting("Crystal wings", "", true); public static BooleanSetting crystalwings = new BooleanSetting("Crystal wings", "", true);
@ -17,5 +20,4 @@ public class Cosmetics extends Mod{
public static BooleanSetting hat = new BooleanSetting("Top hat", "", false); public static BooleanSetting hat = new BooleanSetting("Top hat", "", false);
public static BooleanSetting glasses = new BooleanSetting("Glasses", "", false); public static BooleanSetting glasses = new BooleanSetting("Glasses", "", false);
public static ModeSetting who = new ModeSetting("Who to render on", "", "Only you", "Everyone", "Everyone else"); public static ModeSetting who = new ModeSetting("Who to render on", "", "Only you", "Everyone", "Everyone else");
} }

View File

@ -1,8 +1,8 @@
package dev.resent.module.impl.misc; package dev.resent.module.impl.misc;
import dev.resent.annotation.Module; import dev.resent.annotation.Module;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.Mod; import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
@Module(name = "Fast Crystal", category = Category.MISC) @Module(name = "Fast Crystal", category = Category.MISC)
public class CrystalOptimizer extends Mod {} public class CrystalOptimizer extends Mod {}

View File

@ -1,8 +1,8 @@
package dev.resent.module.impl.misc; package dev.resent.module.impl.misc;
import dev.resent.annotation.Module; import dev.resent.annotation.Module;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.Mod; import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
@Module(name = "NoDynamicFOV", category = Category.MISC) @Module(name = "NoDynamicFOV", category = Category.MISC)
public class DynamicFOV extends Mod {} public class DynamicFOV extends Mod {}

View File

@ -1,14 +1,18 @@
package dev.resent.module.impl.misc; package dev.resent.module.impl.misc;
import dev.resent.annotation.Module; import dev.resent.annotation.Module;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.Mod; import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
@Module(name = "Fast math", category = Category.MISC) @Module(name = "Fast math", category = Category.MISC)
public class FPSB extends Mod { public class FPSB extends Mod {
public void onEnable() { MathHelper.fastMath = true; }
public void onDisable() { MathHelper.fastMath = false; }
public void onEnable() {
MathHelper.fastMath = true;
}
public void onDisable() {
MathHelper.fastMath = false;
}
} }

View File

@ -11,7 +11,6 @@ public class Fullbright extends Mod {
@Override @Override
public void onEnable() { public void onEnable() {
if (mc.thePlayer != null && mc.theWorld != null && mc.gameSettings != null) { if (mc.thePlayer != null && mc.theWorld != null && mc.gameSettings != null) {
//Resent.INSTANCE.playMusic();
Resent.INSTANCE.test(); Resent.INSTANCE.test();
mc.gameSettings.gammaSetting = 100; mc.gameSettings.gammaSetting = 100;
} }

View File

@ -1,14 +1,17 @@
package dev.resent.module.impl.misc; package dev.resent.module.impl.misc;
import dev.resent.annotation.Module; import dev.resent.annotation.Module;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.Mod; import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.setting.BooleanSetting; import dev.resent.module.setting.BooleanSetting;
import dev.resent.module.setting.ModeSetting; import dev.resent.module.setting.ModeSetting;
@Module(name = "Theme", category = Category.MISC, hasSetting = true) @Module(name = "Theme", category = Category.MISC, hasSetting = true)
public class HUD extends Mod { public class HUD extends Mod {
public HUD(){ addSetting(fontTheme, animationTheme, tshadow, round); }
public HUD() {
addSetting(fontTheme, animationTheme, tshadow, round);
}
public static final ModeSetting fontTheme = new ModeSetting("Font", "", "Classic", "Rainbow", "Chroma"); public static final ModeSetting fontTheme = new ModeSetting("Font", "", "Classic", "Rainbow", "Chroma");
//public static final ModeSetting rectTheme = new ModeSetting("Rectangle", "", "Classic", "Astolfo"); //public static final ModeSetting rectTheme = new ModeSetting("Rectangle", "", "Classic", "Astolfo");

View File

@ -1,8 +1,8 @@
package dev.resent.module.impl.misc; package dev.resent.module.impl.misc;
import dev.resent.annotation.Module; import dev.resent.annotation.Module;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.Mod; import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
@Module(name = "Minimal Bobbing", category = Category.MISC) @Module(name = "Minimal Bobbing", category = Category.MISC)
public class MinimalViewBobbing extends Mod {} public class MinimalViewBobbing extends Mod {}

View File

@ -1,8 +1,8 @@
package dev.resent.module.impl.misc; package dev.resent.module.impl.misc;
import dev.resent.annotation.Module; import dev.resent.annotation.Module;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.Mod; import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
@Module(name = "NoParticles", category = Category.MISC) @Module(name = "NoParticles", category = Category.MISC)
public class NoParticles extends Mod {} public class NoParticles extends Mod {}

View File

@ -1,8 +1,8 @@
package dev.resent.module.impl.misc; package dev.resent.module.impl.misc;
import dev.resent.annotation.Module; import dev.resent.annotation.Module;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.Mod; import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
@Module(name = "NoRain", category = Category.MISC) @Module(name = "NoRain", category = Category.MISC)
public class NoRain extends Mod {} public class NoRain extends Mod {}

View File

@ -1,8 +1,8 @@
package dev.resent.module.impl.misc; package dev.resent.module.impl.misc;
import dev.resent.annotation.Module; import dev.resent.annotation.Module;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.Mod; import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
@Module(name = "NoSwingDelay", category = Category.MISC) @Module(name = "NoSwingDelay", category = Category.MISC)
public class NoSwingDelay extends Mod {} public class NoSwingDelay extends Mod {}

View File

@ -1,8 +1,8 @@
package dev.resent.module.impl.misc; package dev.resent.module.impl.misc;
import dev.resent.annotation.Module; import dev.resent.annotation.Module;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.Mod; import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.setting.BooleanSetting; import dev.resent.module.setting.BooleanSetting;
@Module(name = "Scoreboard", category = Category.MISC, hasSetting = true) @Module(name = "Scoreboard", category = Category.MISC, hasSetting = true)

View File

@ -38,8 +38,7 @@ public class Sprint extends RenderMod {
toggled = !toggled; toggled = !toggled;
} }
if (toggled) { if (toggled) {
if (mc.gameSettings.keyBindForward.pressed && !mc.thePlayer.isUsingItem()) if (mc.gameSettings.keyBindForward.pressed && !mc.thePlayer.isUsingItem()) mc.thePlayer.setSprinting(true);
mc.thePlayer.setSprinting(true);
text = definitive ? text : "[Sprinting (Toggled)]"; text = definitive ? text : "[Sprinting (Toggled)]";
} }
@ -54,8 +53,7 @@ public class Sprint extends RenderMod {
@Override @Override
public void draw() { public void draw() {
if (drawn.getValue()) if (drawn.getValue()) drawString(getText(), x + 2, y + 2, Theme.getFontColor(Theme.getFontId()), Theme.getTextShadow());
drawString(getText(), x + 2, y + 2, Theme.getFontColor(Theme.getFontId()), Theme.getTextShadow());
} }
@Override @Override

View File

@ -35,10 +35,8 @@ public class TabGui extends RenderMod{
} }
if (expanded) { if (expanded) {
Category category = Category.values()[current]; Category category = Category.values()[current];
if(Resent.INSTANCE.modManager.modsInCategory(category).size() == 0) if (Resent.INSTANCE.modManager.modsInCategory(category).size() == 0) return;
return;
Gui.drawRect(x + 70, y, x + 138, y + 3 + Resent.INSTANCE.modManager.modsInCategory(category).size() * 16, 0x90000000); Gui.drawRect(x + 70, y, x + 138, y + 3 + Resent.INSTANCE.modManager.modsInCategory(category).size() * 16, 0x90000000);
RenderUtils.drawChromaRectangle(x + 70, y + category.i * 16, x + 138, y + 18f + category.i * 16, 0.6f, 0xff900000); RenderUtils.drawChromaRectangle(x + 70, y + category.i * 16, x + 138, y + 18f + category.i * 16, 0.6f, 0xff900000);
@ -95,5 +93,4 @@ public class TabGui extends RenderMod{
expanded = false; expanded = false;
} }
} }
} }

View File

@ -1,17 +1,16 @@
package dev.resent.ui; package dev.resent.ui;
import java.io.IOException;
import dev.resent.Resent; import dev.resent.Resent;
import dev.resent.ui.animation.Animation;
import dev.resent.ui.animation.Direction;
import dev.resent.module.base.Mod; import dev.resent.module.base.Mod;
import dev.resent.module.setting.BooleanSetting; import dev.resent.module.setting.BooleanSetting;
import dev.resent.module.setting.ModeSetting; import dev.resent.module.setting.ModeSetting;
import dev.resent.module.setting.Setting; import dev.resent.module.setting.Setting;
import dev.resent.ui.animation.Animation;
import dev.resent.ui.animation.Direction;
import dev.resent.util.misc.GlUtils; import dev.resent.util.misc.GlUtils;
import dev.resent.util.render.Color; import dev.resent.util.render.Color;
import dev.resent.util.render.RenderUtils; import dev.resent.util.render.RenderUtils;
import java.io.IOException;
import net.lax1dude.eaglercraft.v1_8.Keyboard; import net.lax1dude.eaglercraft.v1_8.Keyboard;
import net.lax1dude.eaglercraft.v1_8.Mouse; import net.lax1dude.eaglercraft.v1_8.Mouse;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
@ -155,9 +154,7 @@ public class ClickGUI extends GuiScreen {
); );
if (m.isHasSetting()) { if (m.isHasSetting()) {
if(isMouseInside(mouseX, mouseY, this.x + 90 + xo - 1 + 10, height - 2 - fh * -(off) + 51 + 1 - offset, this.x + 90 + xo - 1 + 10 + fr.getStringWidth("o"), height - 2 - fh * -(off) + 51 + 1 - offset + 9)) if (isMouseInside(mouseX, mouseY, this.x + 90 + xo - 1 + 10, height - 2 - fh * -(off) + 51 + 1 - offset, this.x + 90 + xo - 1 + 10 + fr.getStringWidth("o"), height - 2 - fh * -(off) + 51 + 1 - offset + 9)) GlStateManager.color(1, 1, 1, 0.6f); else {
GlStateManager.color(1,1,1,0.6f);
else {
GlStateManager.enableBlend(); GlStateManager.enableBlend();
this.mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/gear.png")); this.mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/gear.png"));
Gui.drawModalRectWithCustomSizedTexture(this.x + 99 + xo, height - 2 - fh * -(off) + 51 + 1 - offset, 0, 0, 8, 8, 8, 8); Gui.drawModalRectWithCustomSizedTexture(this.x + 99 + xo, height - 2 - fh * -(off) + 51 + 1 - offset, 0, 0, 8, 8, 8, 8);
@ -179,17 +176,7 @@ public class ClickGUI extends GuiScreen {
Setting s = this.modWatching.settings.get(amogus); Setting s = this.modWatching.settings.get(amogus);
if (s instanceof BooleanSetting) { if (s instanceof BooleanSetting) {
b = (BooleanSetting) s; b = (BooleanSetting) s;
drawRect( 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());
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());
if (b.getValue()) { if (b.getValue()) {
GlStateManager.color(1, 1, 1); GlStateManager.color(1, 1, 1);
@ -229,7 +216,6 @@ public class ClickGUI extends GuiScreen {
public void onGuiClosed() { public void onGuiClosed() {
Keyboard.enableRepeatEvents(true); Keyboard.enableRepeatEvents(true);
mc.gameSettings.saveOptions(); mc.gameSettings.saveOptions();
} }
@Override @Override

View File

@ -6,6 +6,7 @@ import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
public class ClientButton extends GuiButton { public class ClientButton extends GuiButton {
public ClientButton(final int buttonId, final int x, final int y, final int widthIn, final int heightIn, final String buttonText) { public ClientButton(final int buttonId, final int x, final int y, final int widthIn, final int heightIn, final String buttonText) {
super(buttonId, x, y, widthIn, heightIn, buttonText); super(buttonId, x, y, widthIn, heightIn, buttonText);
} }

View File

@ -10,9 +10,9 @@ import net.minecraft.util.ResourceLocation;
public class PreGUI extends GuiScreen { public class PreGUI extends GuiScreen {
Minecraft mc = Minecraft.getMinecraft(); Minecraft mc = Minecraft.getMinecraft();
@Override @Override
public void drawScreen(int i, int j, float var3) { public void drawScreen(int i, int j, float var3) {
mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/logo.png")); mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/logo.png"));
Gui.drawModalRectWithCustomSizedTexture(GuiScreen.width / 2 - 20, GuiScreen.height / 2 - 50, 0, 0, 60, 60, 60, 60); Gui.drawModalRectWithCustomSizedTexture(GuiScreen.width / 2 - 20, GuiScreen.height / 2 - 50, 0, 0, 60, 60, 60, 60);
@ -20,7 +20,6 @@ public class PreGUI extends GuiScreen{
RenderUtils.drawRectOutline(GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 20, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 50, 0x080FFFFFF); RenderUtils.drawRectOutline(GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 20, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 50, 0x080FFFFFF);
GlUtils.drawCenteredScaledString("Mods", GuiScreen.width / 2 + 10, GuiScreen.height / 2 + 35 - mc.fontRendererObj.FONT_HEIGHT / 2, -1, 1f); GlUtils.drawCenteredScaledString("Mods", GuiScreen.width / 2 + 10, GuiScreen.height / 2 + 35 - mc.fontRendererObj.FONT_HEIGHT / 2, -1, 1f);
super.drawScreen(i, j, var3); super.drawScreen(i, j, var3);
} }
@Override @Override
@ -43,5 +42,4 @@ public class PreGUI extends GuiScreen{
public boolean isMouseInside(int mouseX, int mouseY, int x, int y, int width, int height) { public boolean isMouseInside(int mouseX, int mouseY, int x, int y, int width, int height) {
return (mouseX >= x && mouseX <= width) && (mouseY >= y && mouseY <= height); return (mouseX >= x && mouseX <= width) && (mouseY >= y && mouseY <= height);
} }
} }

View File

@ -79,5 +79,4 @@ public class Theme {
public static boolean getTextShadow() { public static boolean getTextShadow() {
return HUD.tshadow.getValue(); return HUD.tshadow.getValue();
} }
} }

View File

@ -55,8 +55,7 @@ public abstract class Animation {
public double getValue() { public double getValue() {
if (direction == Direction.FORWARDS) { if (direction == Direction.FORWARDS) {
if (isDone()) if (isDone()) return endPoint;
return endPoint;
return (getEquation(timer.getTime()) * endPoint); return (getEquation(timer.getTime()) * endPoint);
} else { } else {
if (isDone()) return 0; if (isDone()) return 0;
@ -114,5 +113,4 @@ class AnimationTimer {
public void setTime(long time) { public void setTime(long time) {
lastMS = time; lastMS = time;
} }
} }

View File

@ -3,7 +3,6 @@ package dev.resent.ui.animation;
public class AnimationUtils { public class AnimationUtils {
public static float calculateCompensation(final float target, float current, final double speed, long delta) { public static float calculateCompensation(final float target, float current, final double speed, long delta) {
final float diff = current - target; final float diff = current - target;
double add = (delta * (speed / 50)); double add = (delta * (speed / 50));
@ -14,15 +13,13 @@ public class AnimationUtils {
} else { } else {
current = target; current = target;
} }
} } else if (diff < -speed) {
else if (diff < -speed) {
if (current + add < target) { if (current + add < target) {
current += add; current += add;
} else { } else {
current = target; current = target;
} }
} } else {
else{
current = target; current = target;
} }

View File

@ -11,7 +11,6 @@ public class SimpleAnimation {
} }
public void setAnimation(final float value, double speed) { public void setAnimation(final float value, double speed) {
final long currentMS = System.currentTimeMillis(); final long currentMS = System.currentTimeMillis();
final long delta = currentMS - this.lastMS; final long delta = currentMS - this.lastMS;
this.lastMS = currentMS; this.lastMS = currentMS;
@ -22,8 +21,7 @@ public class SimpleAnimation {
speed = 28; speed = 28;
} }
if (speed != 0.0) if (speed != 0.0) {
{
deltaValue = Math.abs(value - this.value) * 0.35f / (10.0 / speed); deltaValue = Math.abs(value - this.value) * 0.35f / (10.0 / speed);
} }

View File

@ -4,6 +4,7 @@ import dev.resent.ui.animation.Animation;
import dev.resent.ui.animation.Direction; import dev.resent.ui.animation.Direction;
public class EaseBackIn extends Animation { public class EaseBackIn extends Animation {
private final float easeAmount; private final float easeAmount;
public EaseBackIn(int ms, double endPoint, float easeAmount) { public EaseBackIn(int ms, double endPoint, float easeAmount) {
@ -27,5 +28,4 @@ public class EaseBackIn extends Animation {
float shrink = easeAmount + 1; float shrink = easeAmount + 1;
return Math.max(0, 1 + shrink * Math.pow(x1 - 1, 3) + easeAmount * Math.pow(x1 - 1, 2)); return Math.max(0, 1 + shrink * Math.pow(x1 - 1, 3) + easeAmount * Math.pow(x1 - 1, 2));
} }
} }

View File

@ -17,5 +17,4 @@ public class EaseInOutQuad extends Animation {
double x = x1 / duration; double x = x1 / duration;
return x < 0.5 ? 2 * Math.pow(x, 2) : 1 - Math.pow(-2 * x + 2, 2) / 2; return x < 0.5 ? 2 * Math.pow(x, 2) : 1 - Math.pow(-2 * x + 2, 2) / 2;
} }
} }

View File

@ -17,5 +17,4 @@ public class SmoothStepAnimation extends Animation {
double x1 = x / (double) duration; //Used to force input to range from 0 - 1 double x1 = x / (double) duration; //Used to force input to range from 0 - 1
return -2 * Math.pow(x1, 3) + (3 * Math.pow(x1, 2)); return -2 * Math.pow(x1, 3) + (3 * Math.pow(x1, 2));
} }
} }

View File

@ -184,5 +184,4 @@ public class RenderUtils {
rainbowState %= 360; rainbowState %= 360;
return Color.HSBtoRGB((float) (rainbowState / 360.0f), 0.8f, 0.7f); return Color.HSBtoRGB((float) (rainbowState / 360.0f), 0.8f, 0.7f);
} }
} }

View File

@ -52,9 +52,7 @@ public class EaglercraftRandom {
public int nextInt(int bound) { public int nextInt(int bound) {
int r = next(31); int r = next(31);
int m = bound - 1; int m = bound - 1;
if ( if ((bound & m) == 0) r = (int) ((bound * (long) r) >> 31); else { // i.e., bound is a power of 2
(bound & m) == 0
) r = (int) ((bound * (long) r) >> 31); else { // i.e., bound is a power of 2
for (int u = r; u - (r = u % bound) + m < 0; u = next(31)); for (int u = r; u - (r = u % bound) + m < 0; u = next(31));
} }
return r; return r;

View File

@ -2,7 +2,6 @@ package net.lax1dude.eaglercraft.v1_8;
public class EaglercraftVersion { public class EaglercraftVersion {
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
/// Customize these to fit your fork: /// Customize these to fit your fork:
@ -15,8 +14,6 @@ public class EaglercraftVersion {
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// Do not change these, they must stay as credit to lax1dude's // Do not change these, they must stay as credit to lax1dude's
// original repository for maintaining the project: // original repository for maintaining the project:
@ -27,12 +24,10 @@ public class EaglercraftVersion {
public static final String projectOriginURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8"; public static final String projectOriginURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8";
// Miscellaneous variables: // Miscellaneous variables:
public static final String mainMenuStringA = "Minecraft 1.8.8"; public static final String mainMenuStringA = "Minecraft 1.8.8";
public static final String mainMenuStringB = projectOriginName + " " + public static final String mainMenuStringB = projectOriginName + " " + projectOriginRevision + "-" + projectOriginVersion;
projectOriginRevision + "-" + projectOriginVersion;
public static final String mainMenuStringC = "Rewritten by " + projectOriginAuthor; public static final String mainMenuStringC = "Rewritten by " + projectOriginAuthor;
public static final String mainMenuStringD = "Resources Copyright Mojang AB"; public static final String mainMenuStringD = "Resources Copyright Mojang AB";

View File

@ -28,8 +28,7 @@ public class EaglerFontRenderer extends FontRenderer {
private final int[] temporaryCodepointArray = new int[6553]; private final int[] temporaryCodepointArray = new int[6553];
public EaglerFontRenderer(GameSettings gameSettingsIn, ResourceLocation location, TextureManager textureManagerIn, public EaglerFontRenderer(GameSettings gameSettingsIn, ResourceLocation location, TextureManager textureManagerIn, boolean unicode) {
boolean unicode) {
super(gameSettingsIn, location, textureManagerIn, unicode); super(gameSettingsIn, location, textureManagerIn, unicode);
} }
@ -107,8 +106,7 @@ public class EaglerFontRenderer extends FontRenderer {
this.strikethroughStyle = false; this.strikethroughStyle = false;
this.underlineStyle = false; this.underlineStyle = false;
this.italicStyle = false; this.italicStyle = false;
this.textColor = ((int) (this.alpha * 255.0f) << 24) | ((int) (this.red * 255.0f) << 16) this.textColor = ((int) (this.alpha * 255.0f) << 24) | ((int) (this.red * 255.0f) << 16) | ((int) (this.green * 255.0f) << 8) | (int) (this.blue * 255.0f);
| ((int) (this.green * 255.0f) << 8) | (int) (this.blue * 255.0f);
} }
++i; ++i;
@ -117,7 +115,8 @@ public class EaglerFontRenderer extends FontRenderer {
if (this.randomStyle && j != -1) { if (this.randomStyle && j != -1) {
int k = this.getCharWidth(c0); int k = this.getCharWidth(c0);
String chars = "\u00c0\u00c1\u00c2\u00c8\u00ca\u00cb\u00cd\u00d3\u00d4\u00d5\u00da\u00df\u00e3\u00f5\u011f\u0130\u0131\u0152\u0153\u015e\u015f\u0174\u0175\u017e\u0207\u0000\u0000\u0000\u0000\u0000\u0000\u0000 !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0000\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00f8\u00a3\u00d8\u00d7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\u03b2\u0393\u03c0\u03a3\u03c3\u03bc\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u2205\u2208\u2229\u2261\u00b1\u2265\u2264\u2320\u2321\u00f7\u2248\u00b0\u2219\u00b7\u221a\u207f\u00b2\u25a0\u0000"; String chars =
"\u00c0\u00c1\u00c2\u00c8\u00ca\u00cb\u00cd\u00d3\u00d4\u00d5\u00da\u00df\u00e3\u00f5\u011f\u0130\u0131\u0152\u0153\u015e\u015f\u0174\u0175\u017e\u0207\u0000\u0000\u0000\u0000\u0000\u0000\u0000 !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0000\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00f8\u00a3\u00d8\u00d7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\u03b2\u0393\u03c0\u03a3\u03c3\u03bc\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u2205\u2208\u2229\u2261\u00b1\u2265\u2264\u2320\u2321\u00f7\u2248\u00b0\u2219\u00b7\u221a\u207f\u00b2\u25a0\u0000";
char c1; char c1;
while (true) { while (true) {
@ -135,31 +134,20 @@ public class EaglerFontRenderer extends FontRenderer {
if (this.strikethroughStyle) { if (this.strikethroughStyle) {
hasStrike = true; hasStrike = true;
worldrenderer.pos((double) this.posX, (double) (this.posY + (float) (this.FONT_HEIGHT / 2)), 0.0D) worldrenderer.pos((double) this.posX, (double) (this.posY + (float) (this.FONT_HEIGHT / 2)), 0.0D).endVertex();
.endVertex(); worldrenderer.pos((double) (this.posX + f), (double) (this.posY + (float) (this.FONT_HEIGHT / 2)), 0.0D).endVertex();
worldrenderer worldrenderer.pos((double) (this.posX + f), (double) (this.posY + (float) (this.FONT_HEIGHT / 2) - 1.0F), 0.0D).endVertex();
.pos((double) (this.posX + f), (double) (this.posY + (float) (this.FONT_HEIGHT / 2)), 0.0D) worldrenderer.pos((double) this.posX, (double) (this.posY + (float) (this.FONT_HEIGHT / 2) - 1.0F), 0.0D).endVertex();
.endVertex();
worldrenderer.pos((double) (this.posX + f),
(double) (this.posY + (float) (this.FONT_HEIGHT / 2) - 1.0F), 0.0D).endVertex();
worldrenderer
.pos((double) this.posX, (double) (this.posY + (float) (this.FONT_HEIGHT / 2) - 1.0F), 0.0D)
.endVertex();
worldrenderer.putColor4(this.textColor); worldrenderer.putColor4(this.textColor);
} }
if (this.underlineStyle) { if (this.underlineStyle) {
hasStrike = true; hasStrike = true;
int l = this.underlineStyle ? -1 : 0; int l = this.underlineStyle ? -1 : 0;
worldrenderer.pos((double) (this.posX + (float) l), worldrenderer.pos((double) (this.posX + (float) l), (double) (this.posY + (float) this.FONT_HEIGHT), 0.0D).endVertex();
(double) (this.posY + (float) this.FONT_HEIGHT), 0.0D).endVertex(); worldrenderer.pos((double) (this.posX + f), (double) (this.posY + (float) this.FONT_HEIGHT), 0.0D).endVertex();
worldrenderer.pos((double) (this.posX + f), (double) (this.posY + (float) this.FONT_HEIGHT), 0.0D) worldrenderer.pos((double) (this.posX + f), (double) (this.posY + (float) this.FONT_HEIGHT - 1.0F), 0.0D).endVertex();
.endVertex(); worldrenderer.pos((double) (this.posX + (float) l), (double) (this.posY + (float) this.FONT_HEIGHT - 1.0F), 0.0D).endVertex();
worldrenderer
.pos((double) (this.posX + f), (double) (this.posY + (float) this.FONT_HEIGHT - 1.0F), 0.0D)
.endVertex();
worldrenderer.pos((double) (this.posX + (float) l),
(double) (this.posY + (float) this.FONT_HEIGHT - 1.0F), 0.0D).endVertex();
worldrenderer.putColor4(this.textColor); worldrenderer.putColor4(this.textColor);
} }
@ -218,8 +206,10 @@ public class EaglerFontRenderer extends FontRenderer {
private boolean decodeASCIICodepointsAndValidate(String str) { private boolean decodeASCIICodepointsAndValidate(String str) {
for (int i = 0, l = str.length(); i < l; ++i) { for (int i = 0, l = str.length(); i < l; ++i) {
int j = "\u00c0\u00c1\u00c2\u00c8\u00ca\u00cb\u00cd\u00d3\u00d4\u00d5\u00da\u00df\u00e3\u00f5\u011f\u0130\u0131\u0152\u0153\u015e\u015f\u0174\u0175\u017e\u0207\u0000\u0000\u0000\u0000\u0000\u0000\u0000 !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0000\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00f8\u00a3\u00d8\u00d7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\u03b2\u0393\u03c0\u03a3\u03c3\u03bc\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u2205\u2208\u2229\u2261\u00b1\u2265\u2264\u2320\u2321\u00f7\u2248\u00b0\u2219\u00b7\u221a\u207f\u00b2\u25a0\u0000\u00a7" int j =
.indexOf(str.charAt(i)); "\u00c0\u00c1\u00c2\u00c8\u00ca\u00cb\u00cd\u00d3\u00d4\u00d5\u00da\u00df\u00e3\u00f5\u011f\u0130\u0131\u0152\u0153\u015e\u015f\u0174\u0175\u017e\u0207\u0000\u0000\u0000\u0000\u0000\u0000\u0000 !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0000\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00f8\u00a3\u00d8\u00d7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\u03b2\u0393\u03c0\u03a3\u03c3\u03bc\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u2205\u2208\u2229\u2261\u00b1\u2265\u2264\u2320\u2321\u00f7\u2248\u00b0\u2219\u00b7\u221a\u207f\u00b2\u25a0\u0000\u00a7".indexOf(
str.charAt(i)
);
if (j != -1) { if (j != -1) {
temporaryCodepointArray[i] = j; temporaryCodepointArray[i] = j;
} else { } else {

View File

@ -574,11 +574,9 @@ public final class ByteBufUtil {
return false; return false;
} }
if ( if (
(b1 & 0xFF) > (b1 & 0xFF) > 0xF4 || // b1 invalid
0xF4 || // b1 invalid
(b1 & 0xFF) == 0xF0 && (b1 & 0xFF) == 0xF0 &&
(b2 & 0xFF) < (b2 & 0xFF) < 0x90 || // b2 out of lower bound
0x90 || // b2 out of lower bound
(b1 & 0xFF) == 0xF4 && (b1 & 0xFF) == 0xF4 &&
(b2 & 0xFF) > 0x8F (b2 & 0xFF) > 0x8F
) { // b2 out of upper bound ) { // b2 out of upper bound

View File

@ -1,12 +1,12 @@
package net.lax1dude.eaglercraft.v1_8.opengl; package net.lax1dude.eaglercraft.v1_8.opengl;
import static net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL.*;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
import net.lax1dude.eaglercraft.v1_8.internal.IFramebufferGL; import net.lax1dude.eaglercraft.v1_8.internal.IFramebufferGL;
import net.lax1dude.eaglercraft.v1_8.internal.IRenderbufferGL; import net.lax1dude.eaglercraft.v1_8.internal.IRenderbufferGL;
import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer; import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
import static net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL.*;
/** /**
* Copyright (c) 2023 LAX1DUDE. All Rights Reserved. * Copyright (c) 2023 LAX1DUDE. All Rights Reserved.
* *
@ -91,5 +91,4 @@ public class GameOverlayFramebuffer {
_wglBindFramebuffer(_GL_FRAMEBUFFER, null); _wglBindFramebuffer(_GL_FRAMEBUFFER, null);
} }
} }
} }

View File

@ -1,5 +1,8 @@
package net.lax1dude.eaglercraft.v1_8.opengl; package net.lax1dude.eaglercraft.v1_8.opengl;
import static net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL.*;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
import net.lax1dude.eaglercraft.v1_8.internal.buffer.FloatBuffer; import net.lax1dude.eaglercraft.v1_8.internal.buffer.FloatBuffer;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger; import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
@ -7,9 +10,6 @@ import net.lax1dude.eaglercraft.v1_8.vector.Matrix4f;
import net.lax1dude.eaglercraft.v1_8.vector.Vector3f; import net.lax1dude.eaglercraft.v1_8.vector.Vector3f;
import net.lax1dude.eaglercraft.v1_8.vector.Vector4f; import net.lax1dude.eaglercraft.v1_8.vector.Vector4f;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
import static net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL.*;
/** /**
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved. * Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
* *
@ -94,10 +94,7 @@ public class GlStateManager {
static int activeTexture = 0; static int activeTexture = 0;
static final boolean[] stateTexture = new boolean[16]; static final boolean[] stateTexture = new boolean[16];
static final int[] boundTexture = new int[] { static final int[] boundTexture = new int[] { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1
};
static float stateAnisotropicFixW = -999.0f; static float stateAnisotropicFixW = -999.0f;
static float stateAnisotropicFixH = -999.0f; static float stateAnisotropicFixH = -999.0f;
@ -120,12 +117,14 @@ public class GlStateManager {
static float clearDepth = -999.0f; static float clearDepth = -999.0f;
public static enum TexGen { public static enum TexGen {
S, T, R, Q; S,
T,
R,
Q;
int source = GL_OBJECT_LINEAR; int source = GL_OBJECT_LINEAR;
int plane = GL_OBJECT_PLANE; int plane = GL_OBJECT_PLANE;
Vector4f vector = new Vector4f(); Vector4f vector = new Vector4f();
} }
static int stateTexGenSerial = 0; static int stateTexGenSerial = 0;
@ -198,8 +197,7 @@ public class GlStateManager {
stateLightingSerial[push] = stateLightingSerial[stateLightsStackPointer]; stateLightingSerial[push] = stateLightingSerial[stateLightsStackPointer];
stateLightsStackPointer = push; stateLightsStackPointer = push;
} else { } else {
Throwable t = new IndexOutOfBoundsException("GL_LIGHT direction stack overflow!" + Throwable t = new IndexOutOfBoundsException("GL_LIGHT direction stack overflow!" + " Exceeded " + stateLightsStack.length + " calls to GlStateManager.pushLightCoords");
" Exceeded " + stateLightsStack.length + " calls to GlStateManager.pushLightCoords");
logger.error(t); logger.error(t);
} }
} }
@ -208,8 +206,7 @@ public class GlStateManager {
if (stateLightsStackPointer > 0) { if (stateLightsStackPointer > 0) {
--stateLightsStackPointer; --stateLightsStackPointer;
} else { } else {
Throwable t = new IndexOutOfBoundsException("GL_LIGHT direction stack underflow!" + Throwable t = new IndexOutOfBoundsException("GL_LIGHT direction stack underflow!" + " Called GlStateManager.popLightCoords on an empty light stack");
" Called GlStateManager.popLightCoords on an empty light stack");
logger.error(t); logger.error(t);
} }
} }
@ -239,8 +236,8 @@ public class GlStateManager {
} }
private static final Vector4f paramVector4 = new Vector4f(); private static final Vector4f paramVector4 = new Vector4f();
public static final void enableMCLight(int light, float diffuse, double dirX,
double dirY, double dirZ, double dirW) { public static final void enableMCLight(int light, float diffuse, double dirX, double dirY, double dirZ, double dirW) {
paramVector4.x = (float) dirX; paramVector4.x = (float) dirX;
paramVector4.y = (float) dirY; paramVector4.y = (float) dirY;
paramVector4.z = (float) dirZ; paramVector4.z = (float) dirZ;
@ -471,13 +468,9 @@ public class GlStateManager {
System.err.println("TODO: rewrite text field cursor to use blending"); System.err.println("TODO: rewrite text field cursor to use blending");
} }
public static final void disableColorLogic() { public static final void disableColorLogic() {}
} public static final void colorLogicOp(int opcode) {}
public static final void colorLogicOp(int opcode) {
}
public static final void enableTexGen() { public static final void enableTexGen() {
stateTexGen = true; stateTexGen = true;
@ -543,17 +536,13 @@ public class GlStateManager {
return boundTexture[activeTexture]; return boundTexture[activeTexture];
} }
public static final void shadeModel(int mode) { public static final void shadeModel(int mode) {}
}
public static final void enableRescaleNormal() { public static final void enableRescaleNormal() {
// still not sure what this is for // still not sure what this is for
} }
public static final void disableRescaleNormal() { public static final void disableRescaleNormal() {}
}
public static final void viewport(int x, int y, int w, int h) { public static final void viewport(int x, int y, int w, int h) {
if (viewportX != x || viewportY != y || viewportW != w || viewportH != h) { if (viewportX != x || viewportY != y || viewportW != w || viewportH != h) {
@ -612,8 +601,7 @@ public class GlStateManager {
break; break;
case GL_TEXTURE: case GL_TEXTURE:
textureMatrixStack[activeTexture][textureMatrixStackPointer[activeTexture]].setIdentity(); textureMatrixStack[activeTexture][textureMatrixStackPointer[activeTexture]].setIdentity();
textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] = textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] = ++textureMatrixAccessSerial[activeTexture];
++textureMatrixAccessSerial[activeTexture];
break; break;
} }
} }
@ -629,8 +617,7 @@ public class GlStateManager {
modelMatrixStackAccessSerial[push] = modelMatrixStackAccessSerial[modelMatrixStackPointer]; modelMatrixStackAccessSerial[push] = modelMatrixStackAccessSerial[modelMatrixStackPointer];
modelMatrixStackPointer = push; modelMatrixStackPointer = push;
} else { } else {
Throwable t = new IndexOutOfBoundsException("GL_MODELVIEW matrix stack overflow!" + Throwable t = new IndexOutOfBoundsException("GL_MODELVIEW matrix stack overflow!" + " Exceeded " + modelMatrixStack.length + " calls to GlStateManager.pushMatrix");
" Exceeded " + modelMatrixStack.length + " calls to GlStateManager.pushMatrix");
logger.error(t); logger.error(t);
} }
break; break;
@ -641,8 +628,7 @@ public class GlStateManager {
projectionMatrixStackAccessSerial[push] = projectionMatrixStackAccessSerial[projectionMatrixStackPointer]; projectionMatrixStackAccessSerial[push] = projectionMatrixStackAccessSerial[projectionMatrixStackPointer];
projectionMatrixStackPointer = push; projectionMatrixStackPointer = push;
} else { } else {
Throwable t = new IndexOutOfBoundsException("GL_PROJECTION matrix stack overflow!" + Throwable t = new IndexOutOfBoundsException("GL_PROJECTION matrix stack overflow!" + " Exceeded " + projectionMatrixStack.length + " calls to GlStateManager.pushMatrix");
" Exceeded " + projectionMatrixStack.length + " calls to GlStateManager.pushMatrix");
logger.error(t); logger.error(t);
} }
break; break;
@ -654,8 +640,7 @@ public class GlStateManager {
textureMatrixStackAccessSerial[activeTexture][push] = textureMatrixStackAccessSerial[activeTexture][ptr]; textureMatrixStackAccessSerial[activeTexture][push] = textureMatrixStackAccessSerial[activeTexture][ptr];
textureMatrixStackPointer[activeTexture] = push; textureMatrixStackPointer[activeTexture] = push;
} else { } else {
Throwable t = new IndexOutOfBoundsException("GL_TEXTURE #" + activeTexture + " matrix stack overflow!" + Throwable t = new IndexOutOfBoundsException("GL_TEXTURE #" + activeTexture + " matrix stack overflow!" + " Exceeded " + textureMatrixStack.length + " calls to GlStateManager.pushMatrix");
" Exceeded " + textureMatrixStack.length + " calls to GlStateManager.pushMatrix");
logger.error(t); logger.error(t);
} }
break; break;
@ -669,8 +654,7 @@ public class GlStateManager {
if (modelMatrixStackPointer > 0) { if (modelMatrixStackPointer > 0) {
--modelMatrixStackPointer; --modelMatrixStackPointer;
} else { } else {
Throwable t = new IndexOutOfBoundsException("GL_MODELVIEW matrix stack underflow!" + Throwable t = new IndexOutOfBoundsException("GL_MODELVIEW matrix stack underflow!" + " Called GlStateManager.popMatrix on an empty matrix stack");
" Called GlStateManager.popMatrix on an empty matrix stack");
logger.error(t); logger.error(t);
} }
break; break;
@ -678,8 +662,7 @@ public class GlStateManager {
if (projectionMatrixStackPointer > 0) { if (projectionMatrixStackPointer > 0) {
--projectionMatrixStackPointer; --projectionMatrixStackPointer;
} else { } else {
Throwable t = new IndexOutOfBoundsException("GL_PROJECTION matrix stack underflow!" + Throwable t = new IndexOutOfBoundsException("GL_PROJECTION matrix stack underflow!" + " Called GlStateManager.popMatrix on an empty matrix stack");
" Called GlStateManager.popMatrix on an empty matrix stack");
logger.error(t); logger.error(t);
} }
break; break;
@ -687,8 +670,7 @@ public class GlStateManager {
if (textureMatrixStackPointer[activeTexture] > 0) { if (textureMatrixStackPointer[activeTexture] > 0) {
--textureMatrixStackPointer[activeTexture]; --textureMatrixStackPointer[activeTexture];
} else { } else {
Throwable t = new IndexOutOfBoundsException("GL_TEXTURE #" + activeTexture + Throwable t = new IndexOutOfBoundsException("GL_TEXTURE #" + activeTexture + " matrix stack underflow! Called GlStateManager.popMatrix on an empty matrix stack");
" matrix stack underflow! Called GlStateManager.popMatrix on an empty matrix stack");
logger.error(t); logger.error(t);
} }
break; break;
@ -726,8 +708,7 @@ public class GlStateManager {
case GL_TEXTURE: case GL_TEXTURE:
int ptr = textureMatrixStackPointer[activeTexture]; int ptr = textureMatrixStackPointer[activeTexture];
matrix = textureMatrixStack[activeTexture][ptr]; matrix = textureMatrixStack[activeTexture][ptr];
textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] = textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] = ++textureMatrixAccessSerial[activeTexture];
++textureMatrixAccessSerial[activeTexture];
break; break;
} }
matrix.m00 = 2.0f / (float) (right - left); matrix.m00 = 2.0f / (float) (right - left);
@ -750,6 +731,7 @@ public class GlStateManager {
private static final Vector3f paramVector = new Vector3f(); private static final Vector3f paramVector = new Vector3f();
private static final float toRad = 0.0174532925f; private static final float toRad = 0.0174532925f;
public static final void rotate(float angle, float x, float y, float z) { public static final void rotate(float angle, float x, float y, float z) {
paramVector.x = x; paramVector.x = x;
paramVector.y = y; paramVector.y = y;
@ -767,8 +749,7 @@ public class GlStateManager {
case GL_TEXTURE: case GL_TEXTURE:
int ptr = textureMatrixStackPointer[activeTexture]; int ptr = textureMatrixStackPointer[activeTexture];
textureMatrixStack[activeTexture][ptr].rotate(angle * toRad, paramVector); textureMatrixStack[activeTexture][ptr].rotate(angle * toRad, paramVector);
textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] = textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] = ++textureMatrixAccessSerial[activeTexture];
++textureMatrixAccessSerial[activeTexture];
break; break;
} }
} }
@ -790,8 +771,7 @@ public class GlStateManager {
case GL_TEXTURE: case GL_TEXTURE:
int ptr = textureMatrixStackPointer[activeTexture]; int ptr = textureMatrixStackPointer[activeTexture];
textureMatrixStack[activeTexture][ptr].scale(paramVector); textureMatrixStack[activeTexture][ptr].scale(paramVector);
textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] = textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] = ++textureMatrixAccessSerial[activeTexture];
++textureMatrixAccessSerial[activeTexture];
break; break;
} }
} }
@ -813,8 +793,7 @@ public class GlStateManager {
case GL_TEXTURE: case GL_TEXTURE:
int ptr = textureMatrixStackPointer[activeTexture]; int ptr = textureMatrixStackPointer[activeTexture];
textureMatrixStack[activeTexture][ptr].scale(paramVector); textureMatrixStack[activeTexture][ptr].scale(paramVector);
textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] = textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] = ++textureMatrixAccessSerial[activeTexture];
++textureMatrixAccessSerial[activeTexture];
break; break;
} }
} }
@ -836,8 +815,7 @@ public class GlStateManager {
case GL_TEXTURE: case GL_TEXTURE:
int ptr = textureMatrixStackPointer[activeTexture]; int ptr = textureMatrixStackPointer[activeTexture];
textureMatrixStack[activeTexture][ptr].translate(paramVector); textureMatrixStack[activeTexture][ptr].translate(paramVector);
textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] = textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] = ++textureMatrixAccessSerial[activeTexture];
++textureMatrixAccessSerial[activeTexture];
break; break;
} }
} }
@ -859,13 +837,13 @@ public class GlStateManager {
case GL_TEXTURE: case GL_TEXTURE:
int ptr = textureMatrixStackPointer[activeTexture]; int ptr = textureMatrixStackPointer[activeTexture];
textureMatrixStack[activeTexture][ptr].translate(paramVector); textureMatrixStack[activeTexture][ptr].translate(paramVector);
textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] = textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] = ++textureMatrixAccessSerial[activeTexture];
++textureMatrixAccessSerial[activeTexture];
break; break;
} }
} }
private static final Matrix4f paramMatrix = new Matrix4f(); private static final Matrix4f paramMatrix = new Matrix4f();
public static final void multMatrix(float[] matrix) { public static final void multMatrix(float[] matrix) {
Matrix4f modeMatrix; Matrix4f modeMatrix;
@ -882,8 +860,7 @@ public class GlStateManager {
case GL_TEXTURE: case GL_TEXTURE:
int ptr = textureMatrixStackPointer[activeTexture]; int ptr = textureMatrixStackPointer[activeTexture];
modeMatrix = textureMatrixStack[activeTexture][ptr]; modeMatrix = textureMatrixStack[activeTexture][ptr];
textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] = textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] = ++textureMatrixAccessSerial[activeTexture];
++textureMatrixAccessSerial[activeTexture];
break; break;
} }
@ -935,8 +912,7 @@ public class GlStateManager {
case GL_TEXTURE: case GL_TEXTURE:
int ptr = textureMatrixStackPointer[activeTexture]; int ptr = textureMatrixStackPointer[activeTexture];
matrix = textureMatrixStack[activeTexture][ptr]; matrix = textureMatrixStack[activeTexture][ptr];
textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] = textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] = ++textureMatrixAccessSerial[activeTexture];
++textureMatrixAccessSerial[activeTexture];
break; break;
} }
float cotangent = (float) Math.cos(fovy * toRad * 0.5f) / (float) Math.sin(fovy * toRad * 0.5f); float cotangent = (float) Math.cos(fovy * toRad * 0.5f) / (float) Math.sin(fovy * toRad * 0.5f);
@ -961,14 +937,13 @@ public class GlStateManager {
private static final Matrix4f unprojA = new Matrix4f(); private static final Matrix4f unprojA = new Matrix4f();
private static final Matrix4f unprojB = new Matrix4f(); private static final Matrix4f unprojB = new Matrix4f();
private static final Vector4f unprojC = new Vector4f(); private static final Vector4f unprojC = new Vector4f();
public static final void gluUnProject(float p1, float p2, float p3, float[] modelview, float[] projection,
int[] viewport, float[] objectcoords) { public static final void gluUnProject(float p1, float p2, float p3, float[] modelview, float[] projection, int[] viewport, float[] objectcoords) {
unprojA.load(modelview); unprojA.load(modelview);
unprojB.load(projection); unprojB.load(projection);
Matrix4f.mul(unprojA, unprojB, unprojB); Matrix4f.mul(unprojA, unprojB, unprojB);
unprojB.invert(); unprojB.invert();
unprojC.set(((p1 - (float)viewport[0]) / (float)viewport[2]) * 2f - 1f, unprojC.set(((p1 - (float) viewport[0]) / (float) viewport[2]) * 2f - 1f, ((p2 - (float) viewport[1]) / (float) viewport[3]) * 2f - 1f, p3, 1.0f);
((p2 - (float)viewport[1]) / (float)viewport[3]) * 2f - 1f, p3, 1.0f);
Matrix4f.transform(unprojB, unprojC, unprojC); Matrix4f.transform(unprojB, unprojC, unprojC);
objectcoords[0] = unprojC.x / unprojC.w; objectcoords[0] = unprojC.x / unprojC.w;
objectcoords[1] = unprojC.y / unprojC.w; objectcoords[1] = unprojC.y / unprojC.w;

View File

@ -4,7 +4,6 @@ import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.lax1dude.eaglercraft.v1_8.EagRuntime; import net.lax1dude.eaglercraft.v1_8.EagRuntime;
import net.lax1dude.eaglercraft.v1_8.EaglerInputStream; import net.lax1dude.eaglercraft.v1_8.EaglerInputStream;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;

View File

@ -1,9 +1,8 @@
package net.lax1dude.eaglercraft.v1_8.socket; package net.lax1dude.eaglercraft.v1_8.socket;
import java.io.IOException;
import dev.resent.module.base.ModManager; import dev.resent.module.base.ModManager;
import dev.resent.module.impl.misc.CrystalOptimizer; import dev.resent.module.impl.misc.CrystalOptimizer;
import java.io.IOException;
import net.lax1dude.eaglercraft.v1_8.internal.EnumEaglerConnectionState; import net.lax1dude.eaglercraft.v1_8.internal.EnumEaglerConnectionState;
import net.lax1dude.eaglercraft.v1_8.internal.PlatformNetworking; import net.lax1dude.eaglercraft.v1_8.internal.PlatformNetworking;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;

View File

@ -10,6 +10,11 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_MODELVIEW;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_PROJECTION; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_PROJECTION;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_SMOOTH; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_SMOOTH;
import com.google.common.collect.Lists;
import dev.resent.Resent;
import dev.resent.module.base.ModManager;
import dev.resent.ui.PreGUI;
import dev.resent.util.misc.W;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.text.DecimalFormat; import java.text.DecimalFormat;
@ -18,15 +23,6 @@ import java.util.Collections;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
import org.apache.commons.lang3.Validate;
import com.google.common.collect.Lists;
import dev.resent.Resent;
import dev.resent.module.base.ModManager;
import dev.resent.ui.PreGUI;
import dev.resent.util.misc.W;
import net.lax1dude.eaglercraft.v1_8.Display; import net.lax1dude.eaglercraft.v1_8.Display;
import net.lax1dude.eaglercraft.v1_8.EagRuntime; import net.lax1dude.eaglercraft.v1_8.EagRuntime;
import net.lax1dude.eaglercraft.v1_8.HString; import net.lax1dude.eaglercraft.v1_8.HString;
@ -162,6 +158,7 @@ import net.minecraft.world.EnumDifficulty;
import net.minecraft.world.WorldProviderEnd; import net.minecraft.world.WorldProviderEnd;
import net.minecraft.world.WorldProviderHell; import net.minecraft.world.WorldProviderHell;
import net.minecraft.world.WorldSettings; import net.minecraft.world.WorldSettings;
import org.apache.commons.lang3.Validate;
/**+ /**+
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.

View File

@ -1,14 +1,10 @@
package net.minecraft.client.gui; package net.minecraft.client.gui;
import java.io.IOException;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import dev.resent.ui.animation.SimpleAnimation; import dev.resent.ui.animation.SimpleAnimation;
import dev.resent.util.misc.GlUtils; import dev.resent.util.misc.GlUtils;
import java.io.IOException;
import java.util.List;
import net.lax1dude.eaglercraft.v1_8.Keyboard; import net.lax1dude.eaglercraft.v1_8.Keyboard;
import net.lax1dude.eaglercraft.v1_8.Mouse; import net.lax1dude.eaglercraft.v1_8.Mouse;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
@ -21,6 +17,7 @@ import net.minecraft.util.ChatComponentText;
import net.minecraft.util.IChatComponent; import net.minecraft.util.IChatComponent;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import org.apache.commons.lang3.StringUtils;
/**+ /**+
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.

View File

@ -5,19 +5,17 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_ONE_MINUS_
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_ONE_MINUS_SRC_COLOR; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_ONE_MINUS_SRC_COLOR;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_SRC_ALPHA; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_SRC_ALPHA;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import com.google.common.base.Predicate; import com.google.common.base.Predicate;
import com.google.common.collect.Iterables; import com.google.common.collect.Iterables;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import dev.resent.Resent; import dev.resent.Resent;
import dev.resent.module.base.RenderMod; import dev.resent.module.base.RenderMod;
import dev.resent.ui.animation.SimpleAnimation; import dev.resent.ui.animation.SimpleAnimation;
import dev.resent.util.misc.W; import dev.resent.util.misc.W;
import dev.resent.util.render.Color; import dev.resent.util.render.Color;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerTextureAtlasSprite; import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerTextureAtlasSprite;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
@ -76,6 +74,7 @@ import net.minecraft.world.border.WorldBorder;
* *
*/ */
public class GuiIngame extends Gui { public class GuiIngame extends Gui {
private static final ResourceLocation vignetteTexPath = new ResourceLocation("textures/misc/vignette.png"); private static final ResourceLocation vignetteTexPath = new ResourceLocation("textures/misc/vignette.png");
private static final ResourceLocation widgetsTexPath = new ResourceLocation("textures/gui/widgets.png"); private static final ResourceLocation widgetsTexPath = new ResourceLocation("textures/gui/widgets.png");
private static final ResourceLocation pumpkinBlurTexPath = new ResourceLocation("textures/misc/pumpkinblur.png"); private static final ResourceLocation pumpkinBlurTexPath = new ResourceLocation("textures/misc/pumpkinblur.png");
@ -142,14 +141,12 @@ public class GuiIngame extends Gui {
GlStateManager.tryBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, 1, 0); GlStateManager.tryBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, 1, 0);
ItemStack itemstack = this.mc.thePlayer.inventory.armorItemInSlot(3); ItemStack itemstack = this.mc.thePlayer.inventory.armorItemInSlot(3);
if (this.mc.gameSettings.thirdPersonView == 0 && itemstack != null if (this.mc.gameSettings.thirdPersonView == 0 && itemstack != null && itemstack.getItem() == Item.getItemFromBlock(Blocks.pumpkin)) {
&& itemstack.getItem() == Item.getItemFromBlock(Blocks.pumpkin)) {
this.renderPumpkinOverlay(scaledresolution); this.renderPumpkinOverlay(scaledresolution);
} }
if (!this.mc.thePlayer.isPotionActive(Potion.confusion)) { if (!this.mc.thePlayer.isPotionActive(Potion.confusion)) {
float f = this.mc.thePlayer.prevTimeInPortal float f = this.mc.thePlayer.prevTimeInPortal + (this.mc.thePlayer.timeInPortal - this.mc.thePlayer.prevTimeInPortal) * partialTicks;
+ (this.mc.thePlayer.timeInPortal - this.mc.thePlayer.prevTimeInPortal) * partialTicks;
if (f > 0.0F) { if (f > 0.0F) {
this.func_180474_b(f, scaledresolution); this.func_180474_b(f, scaledresolution);
} }
@ -226,8 +223,7 @@ public class GuiIngame extends Gui {
l = MathHelper.func_181758_c(f2 / 50.0F, 0.7F, 0.6F) & 16777215; l = MathHelper.func_181758_c(f2 / 50.0F, 0.7F, 0.6F) & 16777215;
} }
this.getFontRenderer().drawString(this.recordPlaying, this.getFontRenderer().drawString(this.recordPlaying, -this.getFontRenderer().getStringWidth(this.recordPlaying) / 2, -4, l + (l1 << 24 & -16777216));
-this.getFontRenderer().getStringWidth(this.recordPlaying) / 2, -4, l + (l1 << 24 & -16777216));
GlStateManager.disableBlend(); GlStateManager.disableBlend();
GlStateManager.popMatrix(); GlStateManager.popMatrix();
} }
@ -257,15 +253,11 @@ public class GuiIngame extends Gui {
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
GlStateManager.scale(4.0F, 4.0F, 4.0F); GlStateManager.scale(4.0F, 4.0F, 4.0F);
int j2 = i2 << 24 & -16777216; int j2 = i2 << 24 & -16777216;
this.getFontRenderer().drawString(this.field_175201_x, this.getFontRenderer().drawString(this.field_175201_x, (float) (-this.getFontRenderer().getStringWidth(this.field_175201_x) / 2), -10.0F, 16777215 | j2, true);
(float) (-this.getFontRenderer().getStringWidth(this.field_175201_x) / 2), -10.0F,
16777215 | j2, true);
GlStateManager.popMatrix(); GlStateManager.popMatrix();
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
GlStateManager.scale(2.0F, 2.0F, 2.0F); GlStateManager.scale(2.0F, 2.0F, 2.0F);
this.getFontRenderer().drawString(this.field_175200_y, this.getFontRenderer().drawString(this.field_175200_y, (float) (-this.getFontRenderer().getStringWidth(this.field_175200_y) / 2), 5.0F, 16777215 | j2, true);
(float) (-this.getFontRenderer().getStringWidth(this.field_175200_y) / 2), 5.0F, 16777215 | j2,
true);
GlStateManager.popMatrix(); GlStateManager.popMatrix();
GlStateManager.disableBlend(); GlStateManager.disableBlend();
GlStateManager.popMatrix(); GlStateManager.popMatrix();
@ -284,8 +276,7 @@ public class GuiIngame extends Gui {
} }
} }
ScoreObjective scoreobjective1 = scoreobjective != null ? scoreobjective ScoreObjective scoreobjective1 = scoreobjective != null ? scoreobjective : scoreboard.getObjectiveInDisplaySlot(1);
: scoreboard.getObjectiveInDisplaySlot(1);
if (scoreobjective1 != null && W.scoreboard().isEnabled()) { if (scoreobjective1 != null && W.scoreboard().isEnabled()) {
this.renderScoreboard(scoreobjective1, scaledresolution); this.renderScoreboard(scoreobjective1, scaledresolution);
} }
@ -303,8 +294,7 @@ public class GuiIngame extends Gui {
this.mc.mcProfiler.endSection(); this.mc.mcProfiler.endSection();
GlStateManager.popMatrix(); GlStateManager.popMatrix();
scoreobjective1 = scoreboard.getObjectiveInDisplaySlot(0); scoreobjective1 = scoreboard.getObjectiveInDisplaySlot(0);
if (!this.mc.gameSettings.keyBindPlayerList.isKeyDown() || this.mc.isIntegratedServerRunning() if (!this.mc.gameSettings.keyBindPlayerList.isKeyDown() || this.mc.isIntegratedServerRunning() && this.mc.thePlayer.sendQueue.getPlayerInfoMap().size() <= 1 && scoreobjective1 == null) {
&& this.mc.thePlayer.sendQueue.getPlayerInfoMap().size() <= 1 && scoreobjective1 == null) {
this.overlayPlayerList.updatePlayerList(false); this.overlayPlayerList.updatePlayerList(false);
} else { } else {
this.overlayPlayerList.updatePlayerList(true); this.overlayPlayerList.updatePlayerList(true);
@ -344,7 +334,6 @@ public class GuiIngame extends Gui {
int itemX = i - 90 + ((int) simpleAnimation.getValue()); int itemX = i - 90 + ((int) simpleAnimation.getValue());
drawRect(itemX, sr.getScaledHeight() - 21, itemX + 24, sr.getScaledHeight(), new Color(230, 230, 230, 180).getRGB()); drawRect(itemX, sr.getScaledHeight() - 21, itemX + 24, sr.getScaledHeight(), new Color(230, 230, 230, 180).getRGB());
this.zLevel = f; this.zLevel = f;
GlStateManager.enableRescaleNormal(); GlStateManager.enableRescaleNormal();
GlStateManager.enableBlend(); GlStateManager.enableBlend();
@ -407,7 +396,6 @@ public class GuiIngame extends Gui {
this.getFontRenderer().drawString(s, j1, l, i1); this.getFontRenderer().drawString(s, j1, l, i1);
this.mc.mcProfiler.endSection(); this.mc.mcProfiler.endSection();
} }
} }
public void func_181551_a(ScaledResolution parScaledResolution) { public void func_181551_a(ScaledResolution parScaledResolution) {
@ -448,26 +436,22 @@ public class GuiIngame extends Gui {
if (this.mc.theWorld.getTotalWorldTime() >= 120500L) { if (this.mc.theWorld.getTotalWorldTime() >= 120500L) {
s = I18n.format("demo.demoExpired", new Object[0]); s = I18n.format("demo.demoExpired", new Object[0]);
} else { } else {
s = I18n.format("demo.remainingTime", new Object[] { s = I18n.format("demo.remainingTime", new Object[] { StringUtils.ticksToElapsedTime((int) (120500L - this.mc.theWorld.getTotalWorldTime())) });
StringUtils.ticksToElapsedTime((int) (120500L - this.mc.theWorld.getTotalWorldTime())) });
} }
int i = this.getFontRenderer().getStringWidth(s); int i = this.getFontRenderer().getStringWidth(s);
this.getFontRenderer().drawStringWithShadow(s, (float) (parScaledResolution.getScaledWidth() - i - 10), 5.0F, this.getFontRenderer().drawStringWithShadow(s, (float) (parScaledResolution.getScaledWidth() - i - 10), 5.0F, 16777215);
16777215);
this.mc.mcProfiler.endSection(); this.mc.mcProfiler.endSection();
} }
protected boolean showCrosshair() { protected boolean showCrosshair() {
if (this.mc.gameSettings.showDebugInfo && !this.mc.thePlayer.hasReducedDebug() if (this.mc.gameSettings.showDebugInfo && !this.mc.thePlayer.hasReducedDebug() && !this.mc.gameSettings.reducedDebugInfo) {
&& !this.mc.gameSettings.reducedDebugInfo) {
return false; return false;
} else if (this.mc.playerController.isSpectator()) { } else if (this.mc.playerController.isSpectator()) {
if (this.mc.pointedEntity != null) { if (this.mc.pointedEntity != null) {
return true; return true;
} else { } else {
if (this.mc.objectMouseOver != null if (this.mc.objectMouseOver != null && this.mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
&& this.mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
BlockPos blockpos = this.mc.objectMouseOver.getBlockPos(); BlockPos blockpos = this.mc.objectMouseOver.getBlockPos();
if (this.mc.theWorld.getTileEntity(blockpos) instanceof IInventory) { if (this.mc.theWorld.getTileEntity(blockpos) instanceof IInventory) {
return true; return true;
@ -484,11 +468,16 @@ public class GuiIngame extends Gui {
private void renderScoreboard(ScoreObjective parScoreObjective, ScaledResolution parScaledResolution) { private void renderScoreboard(ScoreObjective parScoreObjective, ScaledResolution parScaledResolution) {
Scoreboard scoreboard = parScoreObjective.getScoreboard(); Scoreboard scoreboard = parScoreObjective.getScoreboard();
Collection collection = scoreboard.getSortedScores(parScoreObjective); Collection collection = scoreboard.getSortedScores(parScoreObjective);
ArrayList arraylist = Lists.newArrayList(Iterables.filter(collection, new Predicate<Score>() { ArrayList arraylist = Lists.newArrayList(
Iterables.filter(
collection,
new Predicate<Score>() {
public boolean apply(Score score2) { public boolean apply(Score score2) {
return score2.getPlayerName() != null && !score2.getPlayerName().startsWith("#"); return score2.getPlayerName() != null && !score2.getPlayerName().startsWith("#");
} }
})); }
)
);
ArrayList arraylist1; ArrayList arraylist1;
if (arraylist.size() > 15) { if (arraylist.size() > 15) {
arraylist1 = Lists.newArrayList(Iterables.skip(arraylist, collection.size() - 15)); arraylist1 = Lists.newArrayList(Iterables.skip(arraylist, collection.size() - 15));
@ -500,8 +489,7 @@ public class GuiIngame extends Gui {
for (Score score : (List<Score>) arraylist1) { for (Score score : (List<Score>) arraylist1) {
ScorePlayerTeam scoreplayerteam = scoreboard.getPlayersTeam(score.getPlayerName()); ScorePlayerTeam scoreplayerteam = scoreboard.getPlayersTeam(score.getPlayerName());
String s = ScorePlayerTeam.formatPlayerName(scoreplayerteam, score.getPlayerName()) + ": " String s = ScorePlayerTeam.formatPlayerName(scoreplayerteam, score.getPlayerName()) + ": " + EnumChatFormatting.RED + score.getScorePoints();
+ EnumChatFormatting.RED + score.getScorePoints();
i = Math.max(i, this.getFontRenderer().getStringWidth(s)); i = Math.max(i, this.getFontRenderer().getStringWidth(s));
} }
@ -520,25 +508,21 @@ public class GuiIngame extends Gui {
int l = parScaledResolution.getScaledWidth() - b0 + 2; int l = parScaledResolution.getScaledWidth() - b0 + 2;
drawRect(k1 - 2, k, l, k + this.getFontRenderer().FONT_HEIGHT, 1342177280); drawRect(k1 - 2, k, l, k + this.getFontRenderer().FONT_HEIGHT, 1342177280);
this.getFontRenderer().drawString(s1, k1, k, 0xFFFFFFFF); this.getFontRenderer().drawString(s1, k1, k, 0xFFFFFFFF);
if (W.scoreboard().numbers.getValue()) if (W.scoreboard().numbers.getValue()) this.getFontRenderer().drawString(s2, l - this.getFontRenderer().getStringWidth(s2), k, 0xFFFFFFFF);
this.getFontRenderer().drawString(s2, l - this.getFontRenderer().getStringWidth(s2), k, 0xFFFFFFFF);
if (j == arraylist1.size()) { if (j == arraylist1.size()) {
String s3 = parScoreObjective.getDisplayName(); String s3 = parScoreObjective.getDisplayName();
drawRect(k1 - 2, k - this.getFontRenderer().FONT_HEIGHT - 1, l, k - 1, 1610612736); drawRect(k1 - 2, k - this.getFontRenderer().FONT_HEIGHT - 1, l, k - 1, 1610612736);
drawRect(k1 - 2, k - 1, l, k, 1342177280); drawRect(k1 - 2, k - 1, l, k, 1342177280);
this.getFontRenderer().drawString(s3, k1 + i / 2 - this.getFontRenderer().getStringWidth(s3) / 2, this.getFontRenderer().drawString(s3, k1 + i / 2 - this.getFontRenderer().getStringWidth(s3) / 2, k - this.getFontRenderer().FONT_HEIGHT, 0xFFFFFFFF);
k - this.getFontRenderer().FONT_HEIGHT, 0xFFFFFFFF);
} }
} }
} }
private void renderPlayerStats(ScaledResolution parScaledResolution) { private void renderPlayerStats(ScaledResolution parScaledResolution) {
if (this.mc.getRenderViewEntity() instanceof EntityPlayer) { if (this.mc.getRenderViewEntity() instanceof EntityPlayer) {
EntityPlayer entityplayer = (EntityPlayer) this.mc.getRenderViewEntity(); EntityPlayer entityplayer = (EntityPlayer) this.mc.getRenderViewEntity();
int i = MathHelper.ceiling_float_int(entityplayer.getHealth()); int i = MathHelper.ceiling_float_int(entityplayer.getHealth());
boolean flag = this.healthUpdateCounter > (long) this.updateCounter boolean flag = this.healthUpdateCounter > (long) this.updateCounter && (this.healthUpdateCounter - (long) this.updateCounter) / 3L % 2L == 1L;
&& (this.healthUpdateCounter - (long) this.updateCounter) / 3L % 2L == 1L;
if (i < this.playerHealth && entityplayer.hurtResistantTime > 0) { if (i < this.playerHealth && entityplayer.hurtResistantTime > 0) {
this.lastSystemTime = Minecraft.getSystemTime(); this.lastSystemTime = Minecraft.getSystemTime();
this.healthUpdateCounter = (long) (this.updateCounter + 20); this.healthUpdateCounter = (long) (this.updateCounter + 20);
@ -671,8 +655,7 @@ public class GuiIngame extends Gui {
b4 = 13; b4 = 13;
} }
if (entityplayer.getFoodStats().getSaturationLevel() <= 0.0F if (entityplayer.getFoodStats().getSaturationLevel() <= 0.0F && this.updateCounter % (k * 3 + 1) == 0) {
&& this.updateCounter % (k * 3 + 1) == 0) {
i6 = k1 + (this.rand.nextInt(3) - 1); i6 = k1 + (this.rand.nextInt(3) - 1);
} }
@ -777,8 +760,7 @@ public class GuiIngame extends Gui {
} }
String s = BossStatus.bossName; String s = BossStatus.bossName;
this.getFontRenderer().drawStringWithShadow(s, this.getFontRenderer().drawStringWithShadow(s, (float) (i / 2 - this.getFontRenderer().getStringWidth(s) / 2), (float) (b0 - 10), 16777215);
(float) (i / 2 - this.getFontRenderer().getStringWidth(s) / 2), (float) (b0 - 10), 16777215);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(icons); this.mc.getTextureManager().bindTexture(icons);
} }
@ -795,8 +777,7 @@ public class GuiIngame extends Gui {
WorldRenderer worldrenderer = tessellator.getWorldRenderer(); WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos(0.0D, (double) parScaledResolution.getScaledHeight(), -90.0D).tex(0.0D, 1.0D).endVertex(); worldrenderer.pos(0.0D, (double) parScaledResolution.getScaledHeight(), -90.0D).tex(0.0D, 1.0D).endVertex();
worldrenderer.pos((double) parScaledResolution.getScaledWidth(), (double) parScaledResolution.getScaledHeight(), worldrenderer.pos((double) parScaledResolution.getScaledWidth(), (double) parScaledResolution.getScaledHeight(), -90.0D).tex(1.0D, 1.0D).endVertex();
-90.0D).tex(1.0D, 1.0D).endVertex();
worldrenderer.pos((double) parScaledResolution.getScaledWidth(), 0.0D, -90.0D).tex(1.0D, 0.0D).endVertex(); worldrenderer.pos((double) parScaledResolution.getScaledWidth(), 0.0D, -90.0D).tex(1.0D, 0.0D).endVertex();
worldrenderer.pos(0.0D, 0.0D, -90.0D).tex(0.0D, 0.0D).endVertex(); worldrenderer.pos(0.0D, 0.0D, -90.0D).tex(0.0D, 0.0D).endVertex();
tessellator.draw(); tessellator.draw();
@ -815,8 +796,7 @@ public class GuiIngame extends Gui {
parFloat1 = MathHelper.clamp_float(parFloat1, 0.0F, 1.0F); parFloat1 = MathHelper.clamp_float(parFloat1, 0.0F, 1.0F);
WorldBorder worldborder = this.mc.theWorld.getWorldBorder(); WorldBorder worldborder = this.mc.theWorld.getWorldBorder();
float f = (float) worldborder.getClosestDistance(this.mc.thePlayer); float f = (float) worldborder.getClosestDistance(this.mc.thePlayer);
double d0 = Math.min(worldborder.getResizeSpeed() * (double) worldborder.getWarningTime() * 1000.0D, double d0 = Math.min(worldborder.getResizeSpeed() * (double) worldborder.getWarningTime() * 1000.0D, Math.abs(worldborder.getTargetSize() - worldborder.getDiameter()));
Math.abs(worldborder.getTargetSize() - worldborder.getDiameter()));
double d1 = Math.max((double) worldborder.getWarningDistance(), d0); double d1 = Math.max((double) worldborder.getWarningDistance(), d0);
if ((double) f < d1) { if ((double) f < d1) {
f = 1.0F - (float) ((double) f / d1); f = 1.0F - (float) ((double) f / d1);
@ -824,16 +804,14 @@ public class GuiIngame extends Gui {
f = 0.0F; f = 0.0F;
} }
this.prevVignetteBrightness = (float) ((double) this.prevVignetteBrightness this.prevVignetteBrightness = (float) ((double) this.prevVignetteBrightness + (double) (parFloat1 - this.prevVignetteBrightness) * 0.01D);
+ (double) (parFloat1 - this.prevVignetteBrightness) * 0.01D);
GlStateManager.disableDepth(); GlStateManager.disableDepth();
GlStateManager.depthMask(false); GlStateManager.depthMask(false);
GlStateManager.tryBlendFuncSeparate(0, GL_ONE_MINUS_SRC_COLOR, 1, 0); GlStateManager.tryBlendFuncSeparate(0, GL_ONE_MINUS_SRC_COLOR, 1, 0);
if (f > 0.0F) { if (f > 0.0F) {
GlStateManager.color(0.0F, f, f, 1.0F); GlStateManager.color(0.0F, f, f, 1.0F);
} else { } else {
GlStateManager.color(this.prevVignetteBrightness, this.prevVignetteBrightness, this.prevVignetteBrightness, GlStateManager.color(this.prevVignetteBrightness, this.prevVignetteBrightness, this.prevVignetteBrightness, 1.0F);
1.0F);
} }
this.mc.getTextureManager().bindTexture(vignetteTexPath); this.mc.getTextureManager().bindTexture(vignetteTexPath);
@ -864,8 +842,7 @@ public class GuiIngame extends Gui {
GlStateManager.tryBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, 1, 0); GlStateManager.tryBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, 1, 0);
GlStateManager.color(1.0F, 1.0F, 1.0F, parFloat1); GlStateManager.color(1.0F, 1.0F, 1.0F, parFloat1);
this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
EaglerTextureAtlasSprite textureatlassprite = this.mc.getBlockRendererDispatcher().getBlockModelShapes() EaglerTextureAtlasSprite textureatlassprite = this.mc.getBlockRendererDispatcher().getBlockModelShapes().getTexture(Blocks.portal.getDefaultState());
.getTexture(Blocks.portal.getDefaultState());
float f = textureatlassprite.getMinU(); float f = textureatlassprite.getMinU();
float f1 = textureatlassprite.getMinV(); float f1 = textureatlassprite.getMinV();
float f2 = textureatlassprite.getMaxU(); float f2 = textureatlassprite.getMaxU();
@ -873,12 +850,9 @@ public class GuiIngame extends Gui {
Tessellator tessellator = Tessellator.getInstance(); Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer(); WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos(0.0D, (double) parScaledResolution.getScaledHeight(), -90.0D).tex((double) f, (double) f3) worldrenderer.pos(0.0D, (double) parScaledResolution.getScaledHeight(), -90.0D).tex((double) f, (double) f3).endVertex();
.endVertex(); worldrenderer.pos((double) parScaledResolution.getScaledWidth(), (double) parScaledResolution.getScaledHeight(), -90.0D).tex((double) f2, (double) f3).endVertex();
worldrenderer.pos((double) parScaledResolution.getScaledWidth(), (double) parScaledResolution.getScaledHeight(), worldrenderer.pos((double) parScaledResolution.getScaledWidth(), 0.0D, -90.0D).tex((double) f2, (double) f1).endVertex();
-90.0D).tex((double) f2, (double) f3).endVertex();
worldrenderer.pos((double) parScaledResolution.getScaledWidth(), 0.0D, -90.0D).tex((double) f2, (double) f1)
.endVertex();
worldrenderer.pos(0.0D, 0.0D, -90.0D).tex((double) f, (double) f1).endVertex(); worldrenderer.pos(0.0D, 0.0D, -90.0D).tex((double) f, (double) f1).endVertex();
tessellator.draw(); tessellator.draw();
GlStateManager.depthMask(true); GlStateManager.depthMask(true);
@ -929,10 +903,7 @@ public class GuiIngame extends Gui {
ItemStack itemstack = this.mc.thePlayer.inventory.getCurrentItem(); ItemStack itemstack = this.mc.thePlayer.inventory.getCurrentItem();
if (itemstack == null) { if (itemstack == null) {
this.remainingHighlightTicks = 0; this.remainingHighlightTicks = 0;
} else if (this.highlightingItemStack != null && itemstack.getItem() == this.highlightingItemStack.getItem() } else if (this.highlightingItemStack != null && itemstack.getItem() == this.highlightingItemStack.getItem() && ItemStack.areItemStackTagsEqual(itemstack, this.highlightingItemStack) && (itemstack.isItemStackDamageable() || itemstack.getMetadata() == this.highlightingItemStack.getMetadata())) {
&& ItemStack.areItemStackTagsEqual(itemstack, this.highlightingItemStack)
&& (itemstack.isItemStackDamageable()
|| itemstack.getMetadata() == this.highlightingItemStack.getMetadata())) {
if (this.remainingHighlightTicks > 0) { if (this.remainingHighlightTicks > 0) {
--this.remainingHighlightTicks; --this.remainingHighlightTicks;
} }
@ -942,7 +913,6 @@ public class GuiIngame extends Gui {
this.highlightingItemStack = itemstack; this.highlightingItemStack = itemstack;
} }
} }
public void setRecordPlayingMessage(String parString1) { public void setRecordPlayingMessage(String parString1) {
@ -981,7 +951,6 @@ public class GuiIngame extends Gui {
if (this.field_175195_w > 0) { if (this.field_175195_w > 0) {
this.field_175195_w = this.field_175199_z + this.field_175192_A + this.field_175193_B; this.field_175195_w = this.field_175199_z + this.field_175192_A + this.field_175193_B;
} }
} }
} }
@ -1013,9 +982,7 @@ public class GuiIngame extends Gui {
ent.prevRenderYawOffset = 0.0f; ent.prevRenderYawOffset = 0.0f;
ent.prevRotationYaw = 0.0f; ent.prevRotationYaw = 0.0f;
ent.rotationYaw = 0.0f; ent.rotationYaw = 0.0f;
GlStateManager.rotate(-135.0F GlStateManager.rotate(-135.0F - (ent.prevRotationYawHead + (ent.rotationYawHead - ent.prevRotationYawHead) * partialTicks) * 0.5F, 0.0F, 1.0F, 0.0F);
- (ent.prevRotationYawHead + (ent.rotationYawHead - ent.prevRotationYawHead) * partialTicks) * 0.5F,
0.0F, 1.0F, 0.0F);
GlStateManager.rotate(ent.rotationPitch * 0.2f, 1.0F, 0.0F, 0.0F); GlStateManager.rotate(ent.rotationPitch * 0.2f, 1.0F, 0.0F, 0.0F);
RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager();
rendermanager.setPlayerViewY(180.0F); rendermanager.setPlayerViewY(180.0F);

View File

@ -31,15 +31,18 @@ public class GuiMainMenu extends GuiScreen {
@Override @Override
protected void actionPerformed(GuiButton button) { protected void actionPerformed(GuiButton button) {
switch (button.id) { switch (button.id) {
case 2: { case 2:
{
this.mc.displayGuiScreen(new GuiMultiplayer(this)); this.mc.displayGuiScreen(new GuiMultiplayer(this));
break; break;
} }
case 3: { case 3:
{
this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings)); this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
break; break;
} }
case 4: { case 4:
{
this.mc.displayGuiScreen(new GuiScreenEditProfile(this)); this.mc.displayGuiScreen(new GuiScreenEditProfile(this));
break; break;
} }

View File

@ -2,6 +2,8 @@ package net.minecraft.client.gui;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
@ -10,10 +12,6 @@ import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.TimeZone; import java.util.TimeZone;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import net.lax1dude.eaglercraft.v1_8.Display; import net.lax1dude.eaglercraft.v1_8.Display;
import net.lax1dude.eaglercraft.v1_8.EagRuntime; import net.lax1dude.eaglercraft.v1_8.EagRuntime;
import net.lax1dude.eaglercraft.v1_8.HString; import net.lax1dude.eaglercraft.v1_8.HString;
@ -62,6 +60,7 @@ import net.minecraft.world.chunk.Chunk;
* *
*/ */
public class GuiOverlayDebug extends Gui { public class GuiOverlayDebug extends Gui {
private final Minecraft mc; private final Minecraft mc;
private final FontRenderer fontRenderer; private final FontRenderer fontRenderer;
@ -111,8 +110,7 @@ public class GuiOverlayDebug extends Gui {
GlStateManager.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); GlStateManager.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
} }
int i = this.mc.joinWorldTickCounter - 70; int i = this.mc.joinWorldTickCounter - 70;
if (i < 0) if (i < 0) i = 0;
i = 0;
drawHideHUD(ww / 2, hh - 70, (10 - i) * 0xFF / 10); drawHideHUD(ww / 2, hh - 70, (10 - i) * 0xFF / 10);
if (this.mc.joinWorldTickCounter > 70) { if (this.mc.joinWorldTickCounter > 70) {
GlStateManager.disableBlend(); GlStateManager.disableBlend();
@ -129,38 +127,29 @@ public class GuiOverlayDebug extends Gui {
private void drawXYZ(int x, int y) { private void drawXYZ(int x, int y) {
Entity e = mc.getRenderViewEntity(); Entity e = mc.getRenderViewEntity();
BlockPos blockpos = new BlockPos(e.posX, e.getEntityBoundingBox().minY, e.posZ); BlockPos blockpos = new BlockPos(e.posX, e.getEntityBoundingBox().minY, e.posZ);
this.fontRenderer.drawStringWithShadow( this.fontRenderer.drawStringWithShadow("x: " + blockpos.getX() + ", y: " + blockpos.getY() + ", z: " + blockpos.getZ(), x, y, 0xFFFFFF);
"x: " + blockpos.getX() + ", y: " + blockpos.getY() + ", z: " + blockpos.getZ(), x, y, 0xFFFFFF);
} }
private void drawStatsHUD(int x, int y) { private void drawStatsHUD(int x, int y) {
int i = 9; int i = 9;
String line = "Walk: " + EnumChatFormatting.YELLOW + HString.format("%.2f", mc.thePlayer.getAIMoveSpeed()) String line = "Walk: " + EnumChatFormatting.YELLOW + HString.format("%.2f", mc.thePlayer.getAIMoveSpeed()) + EnumChatFormatting.WHITE + " Flight: " + (mc.thePlayer.capabilities.allowFlying ? ("" + EnumChatFormatting.YELLOW + mc.thePlayer.capabilities.getFlySpeed()) : EnumChatFormatting.RED + "No");
+ EnumChatFormatting.WHITE + " Flight: "
+ (mc.thePlayer.capabilities.allowFlying
? ("" + EnumChatFormatting.YELLOW + mc.thePlayer.capabilities.getFlySpeed())
: EnumChatFormatting.RED + "No");
int lw = fontRenderer.getStringWidth(line); int lw = fontRenderer.getStringWidth(line);
this.fontRenderer.drawStringWithShadow(line, x - lw, y - i, 0xFFFFFF); this.fontRenderer.drawStringWithShadow(line, x - lw, y - i, 0xFFFFFF);
i += 11; i += 11;
line = "Food: " + EnumChatFormatting.YELLOW + mc.thePlayer.getFoodStats().getFoodLevel() line = "Food: " + EnumChatFormatting.YELLOW + mc.thePlayer.getFoodStats().getFoodLevel() + EnumChatFormatting.WHITE + ", Sat: " + EnumChatFormatting.YELLOW + HString.format("%.1f", mc.thePlayer.getFoodStats().getSaturationLevel());
+ EnumChatFormatting.WHITE + ", Sat: " + EnumChatFormatting.YELLOW
+ HString.format("%.1f", mc.thePlayer.getFoodStats().getSaturationLevel());
lw = fontRenderer.getStringWidth(line); lw = fontRenderer.getStringWidth(line);
this.fontRenderer.drawStringWithShadow(line, x - lw, y - i, 0xFFFFFF); this.fontRenderer.drawStringWithShadow(line, x - lw, y - i, 0xFFFFFF);
i += 11; i += 11;
line = "Amr: " + EnumChatFormatting.YELLOW + mc.thePlayer.getTotalArmorValue() + EnumChatFormatting.WHITE line = "Amr: " + EnumChatFormatting.YELLOW + mc.thePlayer.getTotalArmorValue() + EnumChatFormatting.WHITE + ", Health: " + EnumChatFormatting.RED + HString.format("%.1f", mc.thePlayer.getHealth());
+ ", Health: " + EnumChatFormatting.RED + HString.format("%.1f", mc.thePlayer.getHealth());
lw = fontRenderer.getStringWidth(line); lw = fontRenderer.getStringWidth(line);
this.fontRenderer.drawStringWithShadow(line, x - lw, y - i, 0xFFFFFF); this.fontRenderer.drawStringWithShadow(line, x - lw, y - i, 0xFFFFFF);
i += 11; i += 11;
int xpc = mc.thePlayer.xpBarCap(); int xpc = mc.thePlayer.xpBarCap();
line = "XP: " + EnumChatFormatting.GREEN + MathHelper.floor_float(mc.thePlayer.experience * xpc) line = "XP: " + EnumChatFormatting.GREEN + MathHelper.floor_float(mc.thePlayer.experience * xpc) + EnumChatFormatting.WHITE + " / " + EnumChatFormatting.GREEN + xpc;
+ EnumChatFormatting.WHITE + " / " + EnumChatFormatting.GREEN + xpc;
lw = fontRenderer.getStringWidth(line); lw = fontRenderer.getStringWidth(line);
this.fontRenderer.drawStringWithShadow(line, x - lw, y - i, 0xFFFFFF); this.fontRenderer.drawStringWithShadow(line, x - lw, y - i, 0xFFFFFF);
i += 11; i += 11;
@ -175,20 +164,14 @@ public class GuiOverlayDebug extends Gui {
int s = t % 60; int s = t % 60;
int j = e.getAmplifier(); int j = e.getAmplifier();
if (j > 0) { if (j > 0) {
line = I18n.format(e.getEffectName()) line = I18n.format(e.getEffectName()) + (j > 0 ? (" " + EnumChatFormatting.YELLOW + EnumChatFormatting.BOLD + I18n.format("potion.potency." + j) + EnumChatFormatting.RESET) : "") + " [" + EnumChatFormatting.YELLOW + HString.format("%02d:%02d", m, s) + EnumChatFormatting.RESET + "]";
+ (j > 0 ? (" " + EnumChatFormatting.YELLOW + EnumChatFormatting.BOLD
+ I18n.format("potion.potency." + j) + EnumChatFormatting.RESET) : "")
+ " [" + EnumChatFormatting.YELLOW + HString.format("%02d:%02d", m, s)
+ EnumChatFormatting.RESET + "]";
} else { } else {
line = I18n.format(e.getEffectName()) + " [" + EnumChatFormatting.YELLOW line = I18n.format(e.getEffectName()) + " [" + EnumChatFormatting.YELLOW + HString.format("%02d:%02d", m, s) + EnumChatFormatting.RESET + "]";
+ HString.format("%02d:%02d", m, s) + EnumChatFormatting.RESET + "]";
} }
lw = fontRenderer.getStringWidth(line); lw = fontRenderer.getStringWidth(line);
this.fontRenderer.drawStringWithShadow(line, x - lw, y - i, 0xFFFFFF); this.fontRenderer.drawStringWithShadow(line, x - lw, y - i, 0xFFFFFF);
} }
} }
} }
public static final int ticksAtMidnight = 18000; public static final int ticksAtMidnight = 18000;
@ -226,34 +209,25 @@ public class GuiOverlayDebug extends Gui {
cal.add(Calendar.MINUTE, (int) minutes); cal.add(Calendar.MINUTE, (int) minutes);
cal.add(Calendar.SECOND, (int) seconds + 1); cal.add(Calendar.SECOND, (int) seconds + 1);
String timeString = EnumChatFormatting.WHITE + "Day " + ((totalTicks + 30000l) / 24000l) + " (" String timeString = EnumChatFormatting.WHITE + "Day " + ((totalTicks + 30000l) / 24000l) + " (" + EnumChatFormatting.YELLOW + (this.mc.gameSettings.hud24h ? SDFTwentyFour : SDFTwelve).format(cal.getTime()) + EnumChatFormatting.WHITE + ")";
+ EnumChatFormatting.YELLOW
+ (this.mc.gameSettings.hud24h ? SDFTwentyFour : SDFTwelve).format(cal.getTime())
+ EnumChatFormatting.WHITE + ")";
Entity e = mc.getRenderViewEntity(); Entity e = mc.getRenderViewEntity();
BlockPos blockpos = new BlockPos(e.posX, MathHelper.clamp_double(e.getEntityBoundingBox().minY, 0.0D, 254.0D), BlockPos blockpos = new BlockPos(e.posX, MathHelper.clamp_double(e.getEntityBoundingBox().minY, 0.0D, 254.0D), e.posZ);
e.posZ);
BiomeGenBase biome = mc.theWorld.getBiomeGenForCoords(blockpos); BiomeGenBase biome = mc.theWorld.getBiomeGenForCoords(blockpos);
Chunk c = mc.theWorld.getChunkFromBlockCoords(blockpos); Chunk c = mc.theWorld.getChunkFromBlockCoords(blockpos);
int blockLight = c.getLightFor(EnumSkyBlock.BLOCK, blockpos); int blockLight = c.getLightFor(EnumSkyBlock.BLOCK, blockpos);
int skyLight = c.getLightFor(EnumSkyBlock.SKY, blockpos) - mc.theWorld.calculateSkylightSubtracted(1.0f); int skyLight = c.getLightFor(EnumSkyBlock.SKY, blockpos) - mc.theWorld.calculateSkylightSubtracted(1.0f);
int totalLight = Math.max(blockLight, skyLight); int totalLight = Math.max(blockLight, skyLight);
EnumChatFormatting lightColor = blockLight < 8 EnumChatFormatting lightColor = blockLight < 8 ? ((skyLight < 8 || !mc.theWorld.isDaytime()) ? EnumChatFormatting.RED : EnumChatFormatting.YELLOW) : EnumChatFormatting.GREEN;
? ((skyLight < 8 || !mc.theWorld.isDaytime()) ? EnumChatFormatting.RED : EnumChatFormatting.YELLOW)
: EnumChatFormatting.GREEN;
String lightString = "Light: " + lightColor + totalLight + EnumChatFormatting.WHITE; String lightString = "Light: " + lightColor + totalLight + EnumChatFormatting.WHITE;
float temp = biome.getFloatTemperature(blockpos); float temp = biome.getFloatTemperature(blockpos);
String tempString = "Temp: " String tempString = "Temp: " + ((blockLight > 11 || temp > 0.15f) ? EnumChatFormatting.YELLOW : EnumChatFormatting.AQUA) + HString.format("%.2f", temp) + EnumChatFormatting.WHITE;
+ ((blockLight > 11 || temp > 0.15f) ? EnumChatFormatting.YELLOW : EnumChatFormatting.AQUA)
+ HString.format("%.2f", temp) + EnumChatFormatting.WHITE;
this.fontRenderer.drawStringWithShadow(timeString, x, y - 30, 0xFFFFFF); this.fontRenderer.drawStringWithShadow(timeString, x, y - 30, 0xFFFFFF);
this.fontRenderer.drawStringWithShadow("Biome: " + EnumChatFormatting.AQUA + biome.biomeName, x, y - 19, this.fontRenderer.drawStringWithShadow("Biome: " + EnumChatFormatting.AQUA + biome.biomeName, x, y - 19, 0xFFFFFF);
0xFFFFFF);
this.fontRenderer.drawStringWithShadow(lightString + " " + tempString, x, y - 8, 0xFFFFFF); this.fontRenderer.drawStringWithShadow(lightString + " " + tempString, x, y - 8, 0xFFFFFF);
} }
@ -279,7 +253,6 @@ public class GuiOverlayDebug extends Gui {
this.fontRenderer.drawString(s, 2, l, 14737632); this.fontRenderer.drawString(s, 2, l, 14737632);
} }
} }
} }
protected void renderDebugInfoRight(ScaledResolution parScaledResolution) { protected void renderDebugInfoRight(ScaledResolution parScaledResolution) {
@ -296,29 +269,28 @@ public class GuiOverlayDebug extends Gui {
this.fontRenderer.drawString(s, l, i1, 14737632); this.fontRenderer.drawString(s, l, i1, 14737632);
} }
} }
} }
protected List<String> call() { protected List<String> call() {
if (!this.mc.gameSettings.showDebugInfo) { if (!this.mc.gameSettings.showDebugInfo) {
BlockPos blockpos = new BlockPos(this.mc.getRenderViewEntity().posX, BlockPos blockpos = new BlockPos(this.mc.getRenderViewEntity().posX, this.mc.getRenderViewEntity().getEntityBoundingBox().minY, this.mc.getRenderViewEntity().posZ);
this.mc.getRenderViewEntity().getEntityBoundingBox().minY, this.mc.getRenderViewEntity().posZ); return Lists.newArrayList(new String[] { this.mc.renderGlobal.getDebugInfoShort(), "x: " + blockpos.getX() + ", y: " + blockpos.getY() + ", z: " + blockpos.getZ() });
return Lists.newArrayList(new String[] { this.mc.renderGlobal.getDebugInfoShort(),
"x: " + blockpos.getX() + ", y: " + blockpos.getY() + ", z: " + blockpos.getZ() });
} }
BlockPos blockpos = new BlockPos(this.mc.getRenderViewEntity().posX, BlockPos blockpos = new BlockPos(this.mc.getRenderViewEntity().posX, this.mc.getRenderViewEntity().getEntityBoundingBox().minY, this.mc.getRenderViewEntity().posZ);
this.mc.getRenderViewEntity().getEntityBoundingBox().minY, this.mc.getRenderViewEntity().posZ);
if (this.isReducedDebug()) { if (this.isReducedDebug()) {
return Lists.newArrayList(new String[] { return Lists.newArrayList(
new String[] {
"Minecraft 1.8.8 (" + this.mc.getVersion() + "/" + ClientBrandRetriever.getClientModName() + ")", "Minecraft 1.8.8 (" + this.mc.getVersion() + "/" + ClientBrandRetriever.getClientModName() + ")",
this.mc.debug, this.mc.renderGlobal.getDebugInfoRenders(), this.mc.debug,
this.mc.renderGlobal.getDebugInfoRenders(),
this.mc.renderGlobal.getDebugInfoEntities(), this.mc.renderGlobal.getDebugInfoEntities(),
"P: " + this.mc.effectRenderer.getStatistics() + ". T: " "P: " + this.mc.effectRenderer.getStatistics() + ". T: " + this.mc.theWorld.getDebugLoadedEntities(),
+ this.mc.theWorld.getDebugLoadedEntities(), this.mc.theWorld.getProviderName(),
this.mc.theWorld.getProviderName(), "", "",
HString.format("Chunk-relative: %d %d %d", new Object[] { Integer.valueOf(blockpos.getX() & 15), HString.format("Chunk-relative: %d %d %d", new Object[] { Integer.valueOf(blockpos.getX() & 15), Integer.valueOf(blockpos.getY() & 15), Integer.valueOf(blockpos.getZ() & 15) })
Integer.valueOf(blockpos.getY() & 15), Integer.valueOf(blockpos.getZ() & 15) }) }); }
);
} else { } else {
Entity entity = this.mc.getRenderViewEntity(); Entity entity = this.mc.getRenderViewEntity();
EnumFacing enumfacing = entity.getHorizontalFacing(); EnumFacing enumfacing = entity.getHorizontalFacing();
@ -337,45 +309,32 @@ public class GuiOverlayDebug extends Gui {
s = "Towards positive X"; s = "Towards positive X";
} }
ArrayList arraylist = Lists.newArrayList(new String[] { ArrayList arraylist = Lists.newArrayList(
new String[] {
"Minecraft 1.8.8 (" + this.mc.getVersion() + "/" + ClientBrandRetriever.getClientModName() + ")", "Minecraft 1.8.8 (" + this.mc.getVersion() + "/" + ClientBrandRetriever.getClientModName() + ")",
this.mc.debug, this.mc.renderGlobal.getDebugInfoRenders(), this.mc.debug,
this.mc.renderGlobal.getDebugInfoEntities(), "P: " + this.mc.effectRenderer.getStatistics() this.mc.renderGlobal.getDebugInfoRenders(),
+ ". T: " + this.mc.theWorld.getDebugLoadedEntities(), this.mc.renderGlobal.getDebugInfoEntities(),
this.mc.theWorld.getProviderName(), "", "P: " + this.mc.effectRenderer.getStatistics() + ". T: " + this.mc.theWorld.getDebugLoadedEntities(),
HString.format("XYZ: %.3f / %.5f / %.3f", this.mc.theWorld.getProviderName(),
new Object[] { Double.valueOf(this.mc.getRenderViewEntity().posX), "",
Double.valueOf(this.mc.getRenderViewEntity().getEntityBoundingBox().minY), HString.format("XYZ: %.3f / %.5f / %.3f", new Object[] { Double.valueOf(this.mc.getRenderViewEntity().posX), Double.valueOf(this.mc.getRenderViewEntity().getEntityBoundingBox().minY), Double.valueOf(this.mc.getRenderViewEntity().posZ) }),
Double.valueOf(this.mc.getRenderViewEntity().posZ) }), HString.format("Block: %d %d %d", new Object[] { Integer.valueOf(blockpos.getX()), Integer.valueOf(blockpos.getY()), Integer.valueOf(blockpos.getZ()) }),
HString.format("Block: %d %d %d", HString.format("Chunk: %d %d %d in %d %d %d", new Object[] { Integer.valueOf(blockpos.getX() & 15), Integer.valueOf(blockpos.getY() & 15), Integer.valueOf(blockpos.getZ() & 15), Integer.valueOf(blockpos.getX() >> 4), Integer.valueOf(blockpos.getY() >> 4), Integer.valueOf(blockpos.getZ() >> 4) }),
new Object[] { Integer.valueOf(blockpos.getX()), Integer.valueOf(blockpos.getY()), HString.format("Facing: %s (%s) (%.1f / %.1f)", new Object[] { enumfacing, s, Float.valueOf(MathHelper.wrapAngleTo180_float(entity.rotationYaw)), Float.valueOf(MathHelper.wrapAngleTo180_float(entity.rotationPitch)) })
Integer.valueOf(blockpos.getZ()) }), }
HString.format("Chunk: %d %d %d in %d %d %d", );
new Object[] { Integer.valueOf(blockpos.getX() & 15), Integer.valueOf(blockpos.getY() & 15),
Integer.valueOf(blockpos.getZ() & 15), Integer.valueOf(blockpos.getX() >> 4),
Integer.valueOf(blockpos.getY() >> 4), Integer.valueOf(blockpos.getZ() >> 4) }),
HString.format("Facing: %s (%s) (%.1f / %.1f)",
new Object[] { enumfacing, s,
Float.valueOf(MathHelper.wrapAngleTo180_float(entity.rotationYaw)),
Float.valueOf(MathHelper.wrapAngleTo180_float(entity.rotationPitch)) }) });
if (this.mc.theWorld != null && this.mc.theWorld.isBlockLoaded(blockpos)) { if (this.mc.theWorld != null && this.mc.theWorld.isBlockLoaded(blockpos)) {
Chunk chunk = this.mc.theWorld.getChunkFromBlockCoords(blockpos); Chunk chunk = this.mc.theWorld.getChunkFromBlockCoords(blockpos);
arraylist.add("Biome: " + chunk.getBiome(blockpos).biomeName); arraylist.add("Biome: " + chunk.getBiome(blockpos).biomeName);
arraylist.add("Light: " + chunk.getLightSubtracted(blockpos, 0) + " (" arraylist.add("Light: " + chunk.getLightSubtracted(blockpos, 0) + " (" + chunk.getLightFor(EnumSkyBlock.SKY, blockpos) + " sky, " + chunk.getLightFor(EnumSkyBlock.BLOCK, blockpos) + " block)");
+ chunk.getLightFor(EnumSkyBlock.SKY, blockpos) + " sky, "
+ chunk.getLightFor(EnumSkyBlock.BLOCK, blockpos) + " block)");
DifficultyInstance difficultyinstance = this.mc.theWorld.getDifficultyForLocation(blockpos); DifficultyInstance difficultyinstance = this.mc.theWorld.getDifficultyForLocation(blockpos);
arraylist.add(HString.format("Local Difficulty: %.2f (Day %d)", arraylist.add(HString.format("Local Difficulty: %.2f (Day %d)", new Object[] { Float.valueOf(difficultyinstance.getAdditionalDifficulty()), Long.valueOf(this.mc.theWorld.getWorldTime() / 24000L) }));
new Object[] { Float.valueOf(difficultyinstance.getAdditionalDifficulty()),
Long.valueOf(this.mc.theWorld.getWorldTime() / 24000L) }));
} }
if (this.mc.objectMouseOver != null if (this.mc.objectMouseOver != null && this.mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && this.mc.objectMouseOver.getBlockPos() != null) {
&& this.mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK
&& this.mc.objectMouseOver.getBlockPos() != null) {
BlockPos blockpos1 = this.mc.objectMouseOver.getBlockPos(); BlockPos blockpos1 = this.mc.objectMouseOver.getBlockPos();
arraylist.add(HString.format("Looking at: %d %d %d", new Object[] { Integer.valueOf(blockpos1.getX()), arraylist.add(HString.format("Looking at: %d %d %d", new Object[] { Integer.valueOf(blockpos1.getX()), Integer.valueOf(blockpos1.getY()), Integer.valueOf(blockpos1.getZ()) }));
Integer.valueOf(blockpos1.getY()), Integer.valueOf(blockpos1.getZ()) }));
} }
return arraylist; return arraylist;
@ -389,34 +348,27 @@ public class GuiOverlayDebug extends Gui {
long j = EagRuntime.totalMemory(); long j = EagRuntime.totalMemory();
long k = EagRuntime.freeMemory(); long k = EagRuntime.freeMemory();
long l = j - k; long l = j - k;
arraylist = Lists.newArrayList(new String[] { arraylist =
HString.format("Java: %s %dbit", Lists.newArrayList(
new Object[] { System.getProperty("java.version"), new String[] {
Integer.valueOf(this.mc.isJava64bit() ? 64 : 32) }), HString.format("Java: %s %dbit", new Object[] { System.getProperty("java.version"), Integer.valueOf(this.mc.isJava64bit() ? 64 : 32) }),
HString.format("Mem: % 2d%% %03d/%03dMB", HString.format("Mem: % 2d%% %03d/%03dMB", new Object[] { Long.valueOf(l * 100L / i), Long.valueOf(bytesToMb(l)), Long.valueOf(bytesToMb(i)) }),
new Object[] { Long.valueOf(l * 100L / i), Long.valueOf(bytesToMb(l)), HString.format("Allocated: % 2d%% %03dMB", new Object[] { Long.valueOf(j * 100L / i), Long.valueOf(bytesToMb(j)) }),
Long.valueOf(bytesToMb(i)) }), "",
HString.format("Allocated: % 2d%% %03dMB", HString.format("CPU: %s", new Object[] { "eaglercraft" }),
new Object[] { Long.valueOf(j * 100L / i), Long.valueOf(bytesToMb(j)) }), "",
"", HString.format("CPU: %s", new Object[] { "eaglercraft" }), "", HString.format("Display: %dx%d (%s)", new Object[] { Integer.valueOf(Display.getWidth()), Integer.valueOf(Display.getHeight()), EaglercraftGPU.glGetString(7936) }),
HString.format("Display: %dx%d (%s)", EaglercraftGPU.glGetString(7937),
new Object[] { Integer.valueOf(Display.getWidth()), Integer.valueOf(Display.getHeight()), EaglercraftGPU.glGetString(7938)
EaglercraftGPU.glGetString(7936) }), }
EaglercraftGPU.glGetString(7937), EaglercraftGPU.glGetString(7938) }); );
} else { } else {
arraylist = Lists.newArrayList( arraylist = Lists.newArrayList(new String[] { "Java: TeaVM", "", HString.format("CPU: %s", new Object[] { "eaglercraft" }), "", HString.format("Display: %dx%d (%s)", new Object[] { Integer.valueOf(Display.getWidth()), Integer.valueOf(Display.getHeight()), EaglercraftGPU.glGetString(7936) }), EaglercraftGPU.glGetString(7937), EaglercraftGPU.glGetString(7938) });
new String[] { "Java: TeaVM", "", HString.format("CPU: %s", new Object[] { "eaglercraft" }), "",
HString.format("Display: %dx%d (%s)",
new Object[] { Integer.valueOf(Display.getWidth()),
Integer.valueOf(Display.getHeight()), EaglercraftGPU.glGetString(7936) }),
EaglercraftGPU.glGetString(7937), EaglercraftGPU.glGetString(7938) });
} }
if (this.isReducedDebug()) { if (this.isReducedDebug()) {
return arraylist; return arraylist;
} else { } else {
if (this.mc.objectMouseOver != null if (this.mc.objectMouseOver != null && this.mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && this.mc.objectMouseOver.getBlockPos() != null) {
&& this.mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK
&& this.mc.objectMouseOver.getBlockPos() != null) {
BlockPos blockpos = this.mc.objectMouseOver.getBlockPos(); BlockPos blockpos = this.mc.objectMouseOver.getBlockPos();
IBlockState iblockstate = this.mc.theWorld.getBlockState(blockpos); IBlockState iblockstate = this.mc.theWorld.getBlockState(blockpos);
arraylist.add(""); arraylist.add("");
@ -457,28 +409,24 @@ public class GuiOverlayDebug extends Gui {
k = frametimer.func_181751_b(k + 1); k = frametimer.func_181751_b(k + 1);
} }
drawRect(1, scaledresolution.getScaledHeight() - 30 + 1, 14, scaledresolution.getScaledHeight() - 30 + 10, drawRect(1, scaledresolution.getScaledHeight() - 30 + 1, 14, scaledresolution.getScaledHeight() - 30 + 10, -1873784752);
-1873784752);
this.fontRenderer.drawString("60", 2, scaledresolution.getScaledHeight() - 30 + 2, 14737632); this.fontRenderer.drawString("60", 2, scaledresolution.getScaledHeight() - 30 + 2, 14737632);
this.drawHorizontalLine(0, 239, scaledresolution.getScaledHeight() - 30, -1); this.drawHorizontalLine(0, 239, scaledresolution.getScaledHeight() - 30, -1);
drawRect(1, scaledresolution.getScaledHeight() - 60 + 1, 14, scaledresolution.getScaledHeight() - 60 + 10, drawRect(1, scaledresolution.getScaledHeight() - 60 + 1, 14, scaledresolution.getScaledHeight() - 60 + 10, -1873784752);
-1873784752);
this.fontRenderer.drawString("30", 2, scaledresolution.getScaledHeight() - 60 + 2, 14737632); this.fontRenderer.drawString("30", 2, scaledresolution.getScaledHeight() - 60 + 2, 14737632);
this.drawHorizontalLine(0, 239, scaledresolution.getScaledHeight() - 60, -1); this.drawHorizontalLine(0, 239, scaledresolution.getScaledHeight() - 60, -1);
this.drawHorizontalLine(0, 239, scaledresolution.getScaledHeight() - 1, -1); this.drawHorizontalLine(0, 239, scaledresolution.getScaledHeight() - 1, -1);
this.drawVerticalLine(0, scaledresolution.getScaledHeight() - 60, scaledresolution.getScaledHeight(), -1); this.drawVerticalLine(0, scaledresolution.getScaledHeight() - 60, scaledresolution.getScaledHeight(), -1);
this.drawVerticalLine(239, scaledresolution.getScaledHeight() - 60, scaledresolution.getScaledHeight(), -1); this.drawVerticalLine(239, scaledresolution.getScaledHeight() - 60, scaledresolution.getScaledHeight(), -1);
if (this.mc.gameSettings.limitFramerate <= 120) { if (this.mc.gameSettings.limitFramerate <= 120) {
this.drawHorizontalLine(0, 239, this.drawHorizontalLine(0, 239, scaledresolution.getScaledHeight() - 60 + this.mc.gameSettings.limitFramerate / 2, -16711681);
scaledresolution.getScaledHeight() - 60 + this.mc.gameSettings.limitFramerate / 2, -16711681);
} }
GlStateManager.enableDepth(); GlStateManager.enableDepth();
} }
private int func_181552_c(int parInt1, int parInt2, int parInt3, int parInt4) { private int func_181552_c(int parInt1, int parInt2, int parInt3, int parInt4) {
return parInt1 < parInt3 ? this.func_181553_a(-16711936, -256, (float) parInt1 / (float) parInt3) return parInt1 < parInt3 ? this.func_181553_a(-16711936, -256, (float) parInt1 / (float) parInt3) : this.func_181553_a(-256, -65536, (float) (parInt1 - parInt3) / (float) (parInt4 - parInt3));
: this.func_181553_a(-256, -65536, (float) (parInt1 - parInt3) / (float) (parInt4 - parInt3));
} }
private int func_181553_a(int parInt1, int parInt2, float parFloat1) { private int func_181553_a(int parInt1, int parInt2, float parFloat1) {

View File

@ -396,7 +396,6 @@ public class GuiTextField extends Gui {
return true; return true;
default: default:
if (ChatAllowedCharacters.isAllowedCharacter(parChar1)) { if (ChatAllowedCharacters.isAllowedCharacter(parChar1)) {
if (this.isEnabled) { if (this.isEnabled) {
this.writeText(Character.toString(parChar1)); this.writeText(Character.toString(parChar1));
} }

View File

@ -1,7 +1,7 @@
package net.minecraft.client.gui.inventory; package net.minecraft.client.gui.inventory;
import dev.resent.ui.animation.Animation;
import dev.resent.ui.Theme; import dev.resent.ui.Theme;
import dev.resent.ui.animation.Animation;
import dev.resent.util.misc.GlUtils; import dev.resent.util.misc.GlUtils;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.OpenGlHelper; import net.lax1dude.eaglercraft.v1_8.opengl.OpenGlHelper;
@ -56,6 +56,7 @@ public class GuiInventory extends InventoryEffectRenderer {
} }
public Animation openAnim; public Animation openAnim;
/**+ /**+
* Adds the buttons (and other controls) to the screen in * Adds the buttons (and other controls) to the screen in
* question. Called when the GUI is displayed and when the * question. Called when the GUI is displayed and when the

View File

@ -1,7 +1,6 @@
package net.minecraft.client.multiplayer; package net.minecraft.client.multiplayer;
import java.io.IOException; import java.io.IOException;
import net.lax1dude.eaglercraft.v1_8.socket.EaglercraftNetworkManager; import net.lax1dude.eaglercraft.v1_8.socket.EaglercraftNetworkManager;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
@ -344,7 +343,6 @@ public class PlayerControllerMP {
} }
} }
this.netClientHandler.addToSendQueue(new C08PacketPlayerBlockPlacement(hitPos, side.getIndex(), player.inventory.getCurrentItem(), f, f1, f2)); this.netClientHandler.addToSendQueue(new C08PacketPlayerBlockPlacement(hitPos, side.getIndex(), player.inventory.getCurrentItem(), f, f1, f2));
if (!flag && this.currentGameType != WorldSettings.GameType.SPECTATOR) { if (!flag && this.currentGameType != WorldSettings.GameType.SPECTATOR) {
if (heldStack == null) { if (heldStack == null) {

View File

@ -1,16 +1,14 @@
package net.minecraft.client.network; package net.minecraft.client.network;
import com.google.common.collect.Maps;
import dev.resent.module.base.ModManager;
import dev.resent.module.impl.misc.AutoGG;
import dev.resent.util.misc.W;
import java.io.IOException; import java.io.IOException;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import com.google.common.collect.Maps;
import dev.resent.module.base.ModManager;
import dev.resent.module.impl.misc.AutoGG;
import dev.resent.util.misc.W;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
@ -713,7 +711,6 @@ public class NetHandlerPlayClient implements INetHandlerPlayClient {
if (packetIn.getType() == 2) { if (packetIn.getType() == 2) {
this.gameController.ingameGUI.setRecordPlaying(packetIn.getChatComponent(), false); this.gameController.ingameGUI.setRecordPlaying(packetIn.getChatComponent(), false);
} else { } else {
if (packetIn.getChatComponent().getUnformattedText().contains("iPBv4D11KKW")) { if (packetIn.getChatComponent().getUnformattedText().contains("iPBv4D11KKW")) {
EntityRenderer.test = !EntityRenderer.test; EntityRenderer.test = !EntityRenderer.test;
return; return;

View File

@ -22,14 +22,12 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_TEXTURE_MI
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_TEXTURE_WRAP_S; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_TEXTURE_WRAP_S;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_TEXTURE_WRAP_T; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_TEXTURE_WRAP_T;
import java.util.List;
import java.util.concurrent.Callable;
import com.google.common.base.Predicate; import com.google.common.base.Predicate;
import com.google.common.base.Predicates; import com.google.common.base.Predicates;
import dev.resent.module.base.ModManager; import dev.resent.module.base.ModManager;
import dev.resent.util.misc.W; import dev.resent.util.misc.W;
import java.util.List;
import java.util.concurrent.Callable;
import net.lax1dude.eaglercraft.v1_8.Display; import net.lax1dude.eaglercraft.v1_8.Display;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.lax1dude.eaglercraft.v1_8.HString; import net.lax1dude.eaglercraft.v1_8.HString;
@ -107,6 +105,7 @@ import net.minecraft.world.biome.BiomeGenBase;
* *
*/ */
public class EntityRenderer implements IResourceManagerReloadListener { public class EntityRenderer implements IResourceManagerReloadListener {
private static final Logger logger = LogManager.getLogger(); private static final Logger logger = LogManager.getLogger();
private static final ResourceLocation locationRainPng = new ResourceLocation("textures/environment/rain.png"); private static final ResourceLocation locationRainPng = new ResourceLocation("textures/environment/rain.png");
private static final ResourceLocation locationSnowPng = new ResourceLocation("textures/environment/snow.png"); private static final ResourceLocation locationSnowPng = new ResourceLocation("textures/environment/snow.png");
@ -208,8 +207,7 @@ public class EntityRenderer implements IResourceManagerReloadListener {
public void func_181022_b() {} public void func_181022_b() {}
public void switchUseShader() { public void switchUseShader() {}
}
/**+ /**+
* What shader to use when spectating this entity * What shader to use when spectating this entity
@ -218,8 +216,7 @@ public class EntityRenderer implements IResourceManagerReloadListener {
public void activateNextShader() {} public void activateNextShader() {}
private void loadShader(ResourceLocation resourceLocationIn) { private void loadShader(ResourceLocation resourceLocationIn) {}
}
public void onResourceManagerReload(IResourceManager var1) {} public void onResourceManagerReload(IResourceManager var1) {}
@ -1101,7 +1098,8 @@ public class EntityRenderer implements IResourceManagerReloadListener {
public void run() { public void run() {
renderglobal.setupTerrain(entity, (double) partialTicks, frustum, frameCount++, mc.thePlayer.isSpectator()); renderglobal.setupTerrain(entity, (double) partialTicks, frustum, frameCount++, mc.thePlayer.isSpectator());
} }
}.start(); }
.start();
if (pass == 0 || pass == 2) { if (pass == 0 || pass == 2) {
this.mc.mcProfiler.endStartSection("updatechunks"); this.mc.mcProfiler.endStartSection("updatechunks");
this.mc.renderGlobal.updateChunks(finishTimeNano); this.mc.renderGlobal.updateChunks(finishTimeNano);
@ -1161,13 +1159,11 @@ public class EntityRenderer implements IResourceManagerReloadListener {
if (!this.debugView) { if (!this.debugView) {
this.enableLightmap(); this.enableLightmap();
this.mc.mcProfiler.endStartSection("litParticles"); this.mc.mcProfiler.endStartSection("litParticles");
if(!W.noParticles().isEnabled()) if (!W.noParticles().isEnabled()) effectrenderer.renderLitParticles(entity, partialTicks);
effectrenderer.renderLitParticles(entity, partialTicks);
RenderHelper.disableStandardItemLighting(); RenderHelper.disableStandardItemLighting();
this.setupFog(0, partialTicks); this.setupFog(0, partialTicks);
this.mc.mcProfiler.endStartSection("particles"); this.mc.mcProfiler.endStartSection("particles");
if (!W.noParticles().isEnabled()) if (!W.noParticles().isEnabled()) effectrenderer.renderParticles(entity, partialTicks);
effectrenderer.renderParticles(entity, partialTicks);
this.disableLightmap(); this.disableLightmap();
} }

View File

@ -621,8 +621,7 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
RenderChunk renderchunk2 = this.func_181562_a(blockpos, renderchunk3, enumfacing1); RenderChunk renderchunk2 = this.func_181562_a(blockpos, renderchunk3, enumfacing1);
if ( if (
( (
!flag1 || !flag1 || !renderglobal$containerlocalrenderinformation1.setFacing.contains(enumfacing1.getOpposite()) // TODO:
!renderglobal$containerlocalrenderinformation1.setFacing.contains(enumfacing1.getOpposite()) // TODO:
) && ) &&
(!flag1 || enumfacing2 == null || renderchunk3.getCompiledChunk().isVisible(enumfacing2.getOpposite(), enumfacing1)) && (!flag1 || enumfacing2 == null || renderchunk3.getCompiledChunk().isVisible(enumfacing2.getOpposite(), enumfacing1)) &&
renderchunk2 != null && renderchunk2 != null &&

View File

@ -297,7 +297,6 @@ public abstract class Render<T extends Entity> {
return this.renderManager.getFontRenderer(); return this.renderManager.getFontRenderer();
} }
/**+ /**+
* Renders an entity's name above its head * Renders an entity's name above its head
*/ */

View File

@ -1,5 +1,11 @@
package net.minecraft.client.settings; package net.minecraft.client.settings;
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.Resent;
import dev.resent.module.base.ModManager;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
@ -8,16 +14,6 @@ import java.io.PrintWriter;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import org.json.JSONArray;
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.Resent;
import dev.resent.module.base.ModManager;
import net.lax1dude.eaglercraft.v1_8.ArrayUtils; import net.lax1dude.eaglercraft.v1_8.ArrayUtils;
import net.lax1dude.eaglercraft.v1_8.EagRuntime; import net.lax1dude.eaglercraft.v1_8.EagRuntime;
import net.lax1dude.eaglercraft.v1_8.EaglerInputStream; import net.lax1dude.eaglercraft.v1_8.EaglerInputStream;
@ -38,6 +34,7 @@ import net.minecraft.entity.player.EnumPlayerModelParts;
import net.minecraft.network.play.client.C15PacketClientSettings; import net.minecraft.network.play.client.C15PacketClientSettings;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.world.EnumDifficulty; import net.minecraft.world.EnumDifficulty;
import org.json.JSONArray;
/**+ /**+
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
@ -1045,7 +1042,6 @@ public class GameSettings {
} }
Resent.INSTANCE.load(astring); Resent.INSTANCE.load(astring);
} catch (Exception var8) { } catch (Exception var8) {
logger.warn("Skipping bad option: " + s); logger.warn("Skipping bad option: " + s);
} }

View File

@ -1,15 +1,13 @@
package net.minecraft.entity; package net.minecraft.entity;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import com.google.common.base.Predicate; import com.google.common.base.Predicate;
import com.google.common.base.Predicates; import com.google.common.base.Predicates;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import dev.resent.module.base.ModManager; import dev.resent.module.base.ModManager;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;
import net.minecraft.block.Block; import net.minecraft.block.Block;
@ -849,7 +847,6 @@ public abstract class EntityLivingBase extends Entity {
* account. * account.
*/ */
private int getArmSwingAnimationEnd() { private int getArmSwingAnimationEnd() {
return this.isPotionActive(Potion.digSpeed) ? 6 - (1 + this.getActivePotionEffect(Potion.digSpeed).getAmplifier()) * 1 : (this.isPotionActive(Potion.digSlowdown) ? 6 + (1 + this.getActivePotionEffect(Potion.digSlowdown).getAmplifier()) * 2 : 6); return this.isPotionActive(Potion.digSpeed) ? 6 - (1 + this.getActivePotionEffect(Potion.digSpeed).getAmplifier()) * 1 : (this.isPotionActive(Potion.digSlowdown) ? 6 + (1 + this.getActivePotionEffect(Potion.digSlowdown).getAmplifier()) * 2 : 6);
} }
@ -1452,7 +1449,6 @@ public abstract class EntityLivingBase extends Entity {
* interpolated look vector * interpolated look vector
*/ */
public Vec3 getLook(float f) { public Vec3 getLook(float f) {
if (this instanceof EntityPlayerSP) { if (this instanceof EntityPlayerSP) {
return super.getLook(f); return super.getLook(f);
} }

View File

@ -1,13 +1,11 @@
package net.minecraft.entity.player; package net.minecraft.entity.player;
import java.util.Collection;
import java.util.List;
import com.google.common.base.Charsets; import com.google.common.base.Charsets;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import dev.resent.Resent; import dev.resent.Resent;
import dev.resent.module.base.ModManager; import dev.resent.module.base.ModManager;
import java.util.Collection;
import java.util.List;
import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;
import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile; import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile;
import net.minecraft.block.Block; import net.minecraft.block.Block;
@ -73,8 +71,8 @@ import net.minecraft.util.FoodStats;
import net.minecraft.util.IChatComponent; import net.minecraft.util.IChatComponent;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.util.MovingObjectPosition.MovingObjectType; import net.minecraft.util.MovingObjectPosition.MovingObjectType;
import net.minecraft.util.Vec3;
import net.minecraft.world.EnumDifficulty; import net.minecraft.world.EnumDifficulty;
import net.minecraft.world.IInteractionObject; import net.minecraft.world.IInteractionObject;
import net.minecraft.world.LockCode; import net.minecraft.world.LockCode;
@ -990,13 +988,11 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS
* Args: targetEntity * Args: targetEntity
*/ */
public void attackTargetEntityWithCurrentItem(Entity entity) { public void attackTargetEntityWithCurrentItem(Entity entity) {
ModManager.reachDisplay.onAttack(entity); ModManager.reachDisplay.onAttack(entity);
ModManager.comboCounter.onAttack(entity); ModManager.comboCounter.onAttack(entity);
MovingObjectPosition hitResult = Minecraft.getMinecraft().objectMouseOver; MovingObjectPosition hitResult = Minecraft.getMinecraft().objectMouseOver;
if (hitResult == null) if (hitResult == null) return;
return;
if (hitResult.typeOfHit == MovingObjectType.ENTITY && ModManager.crystalOptimizer.isEnabled()) { if (hitResult.typeOfHit == MovingObjectType.ENTITY && ModManager.crystalOptimizer.isEnabled()) {
MovingObjectPosition entityHitResult = hitResult; MovingObjectPosition entityHitResult = hitResult;
Entity crystal = entityHitResult.entityHit; Entity crystal = entityHitResult.entityHit;