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;
import java.nio.charset.Charset;
import com.google.common.annotations.GwtCompatible;
import java.nio.charset.Charset;
/**
* Contains constant definitions for the six standard {@link Charset} instances,

View File

@ -1,19 +1,25 @@
package dev.resent;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
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.RenderMod;
import dev.resent.module.setting.BooleanSetting;
import dev.resent.module.setting.ModeSetting;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.MusicTicker;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.audio.SoundHandler;
import net.minecraft.util.ResourceLocation;
public class Resent {
static {
INSTANCE = new Resent();
}
@ -26,16 +32,20 @@ public class Resent {
Resent.INSTANCE.modManager = new ModManager();
}
public void save(PrintWriter printwriter){
Resent.INSTANCE.modManager.modules.stream().forEach( m -> {
public void save(PrintWriter printwriter) {
Resent.INSTANCE.modManager.modules
.stream()
.forEach(m -> {
printwriter.println(m.getName() + ":" + m.isEnabled());
if(m instanceof RenderMod){
printwriter.println(m.getName() + "_x:" + ((RenderMod)m).getX());
printwriter.println(m.getName() + "_y:" + ((RenderMod)m).getY());
printwriter.println(m.getName() + "_lastx:" + ((RenderMod)m).lastX);
printwriter.println(m.getName() + "_lasty:" + ((RenderMod)m).lastY);
if (m instanceof RenderMod) {
printwriter.println(m.getName() + "_x:" + ((RenderMod) m).getX());
printwriter.println(m.getName() + "_y:" + ((RenderMod) m).getY());
printwriter.println(m.getName() + "_lastx:" + ((RenderMod) m).lastX);
printwriter.println(m.getName() + "_lasty:" + ((RenderMod) m).lastY);
}
m.settings.stream().forEach(s -> {
m.settings
.stream()
.forEach(s -> {
if (s instanceof ModeSetting) {
printwriter.println(m.getName() + "_modesetting_" + s.name + ":" + ((ModeSetting) s).getValue());
}
@ -46,29 +56,32 @@ public class Resent {
});
}
public void load(String[] astring){
Resent.INSTANCE.modManager.modules.stream().forEach(m -> {
public void load(String[] astring) {
Resent.INSTANCE.modManager.modules
.stream()
.forEach(m -> {
if (astring[0].equals(m.getName())) {
m.setEnabled(astring[1].equals("true"));
}
if(m instanceof RenderMod){
if (m instanceof RenderMod) {
if (astring[0].equals(m.getName() + "_x")) {
((RenderMod)m).setX(Integer.parseInt(astring[1]));
((RenderMod) m).setX(Integer.parseInt(astring[1]));
}
if (astring[0].equals(m.getName() + "_y")) {
((RenderMod)m).setY(Integer.parseInt(astring[1]));
((RenderMod) m).setY(Integer.parseInt(astring[1]));
}
if (astring[0].equals(m.getName() + "_lastx")) {
((RenderMod)m).lastX = Integer.parseInt(astring[1]);
((RenderMod) m).lastX = Integer.parseInt(astring[1]);
}
if (astring[0].equals(m.getName() + "_lasty")) {
((RenderMod)m).lastY = Integer.parseInt(astring[1]);
((RenderMod) m).lastY = Integer.parseInt(astring[1]);
}
}
m.settings.stream().forEach(se ->{
m.settings
.stream()
.forEach(se -> {
if (se instanceof ModeSetting) {
if (astring[0].equals(m.getName() + "_modesetting_" + se.name)) {
((ModeSetting) se).setValue(astring[1]);
@ -85,20 +98,48 @@ public class Resent {
//Legacy code below.
/*public void playMusic(){
MusicTicker player = Minecraft.getMinecraft().func_181535_r();
SoundHandler soundhandler = Minecraft.getMinecraft().getSoundHandler();
player.func_181557_a();
player.func_181558_a(MusicTicker.MusicType.RES);
soundhandler.resumeSounds();
}*/
FileOutputStream fos = null;
File temp;
public void playSoundFromByteArray(byte[] bArray) {
try {
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(){
Minecraft.getMinecraft().getSoundHandler().stopSounds();
Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("minecraft:music.res"), 1));
}
public void stopMusic(){
public void stopMusic() {
Minecraft.getMinecraft().getSoundHandler().stopSounds();
}
}

View File

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

View File

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

View File

@ -6,16 +6,17 @@ import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.entity.RenderPlayer;
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;
public CosmeticBase(RenderPlayer playerRenderer){
public CosmeticBase(RenderPlayer playerRenderer) {
this.playerRenderer = playerRenderer;
}
@Override
public void doRenderLayer(AbstractClientPlayer player, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
if(player.hasPlayerInfo() && !player.isInvisible()){
if (player.hasPlayerInfo() && !player.isInvisible()) {
render(player, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale);
}
}
@ -23,15 +24,16 @@ 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);
@Override
public boolean shouldCombineTextures() { return false; }
public class CosmeticModelBase extends ModelBase{
public boolean shouldCombineTextures() {
return false;
}
public class CosmeticModelBase extends ModelBase {
protected final ModelBiped playerModel;
public CosmeticModelBase(RenderPlayer player){
public CosmeticModelBase(RenderPlayer player) {
this.playerModel = player.getMainModel();
}
}
}

View File

@ -7,41 +7,41 @@ import net.minecraft.client.entity.AbstractClientPlayer;
public class CosmeticController {
public static boolean renderTopHat(AbstractClientPlayer player){
public static boolean renderTopHat(AbstractClientPlayer player) {
return ModManager.cosmetics.isEnabled() && Cosmetics.show.getValue() && shouldRender(player) && Cosmetics.hat.getValue();
}
public static boolean renderCrystalWings(AbstractClientPlayer player){
public static boolean renderCrystalWings(AbstractClientPlayer player) {
return ModManager.cosmetics.isEnabled() && Cosmetics.show.getValue() && shouldRender(player) && Cosmetics.crystalwings.getValue();
}
public static boolean renderGlasses(AbstractClientPlayer player){
public static boolean renderGlasses(AbstractClientPlayer player) {
return ModManager.cosmetics.isEnabled() && Cosmetics.show.getValue() && shouldRender(player) && Cosmetics.glasses.getValue();
}
public static boolean renderHalo(AbstractClientPlayer player){
public static boolean renderHalo(AbstractClientPlayer player) {
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[] 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[] getCrystalWingsColor(AbstractClientPlayer player) {
return new float[] { 1, 1, 1 };
}
public static boolean shouldRender(AbstractClientPlayer player){
switch(Cosmetics.who.getValue()){
public static float[] getDragonWingsColor = new float[] { 1f, 1f, 1f, 1f };
public static boolean shouldRender(AbstractClientPlayer player) {
switch (Cosmetics.who.getValue()) {
case "Only you":
return player == Minecraft.getMinecraft().thePlayer;
case "Everyone":
return true;
case "Everyone else":
return player != Minecraft.getMinecraft().thePlayer;
}
return false;
}
}

View File

@ -13,6 +13,7 @@ import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
public class CrystalWings extends CosmeticBase {
private CrytsalWingsModel crytsalWingsModel;
public CrystalWings(RenderPlayer playerRenderer) {
@ -22,7 +23,7 @@ public class CrystalWings extends CosmeticBase {
@Override
public void render(AbstractClientPlayer player, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
if(CosmeticController.renderCrystalWings(player)){
if (CosmeticController.renderCrystalWings(player)) {
GlStateManager.pushMatrix();
float[] color = CosmeticController.getCrystalWingsColor(player);
GlStateManager.color(color[0], color[1], color[2]);
@ -33,6 +34,7 @@ public class CrystalWings extends CosmeticBase {
}
public class CrytsalWingsModel extends CosmeticModelBase {
private ModelRenderer model;
ResourceLocation resourceLocation = new ResourceLocation("eagler:gui/crystal.png");
@ -41,22 +43,22 @@ public class CrystalWings extends CosmeticBase {
super(player);
int i = 30;
int j = 24;
this.model = (new ModelRenderer((ModelBase)this)).setTextureSize(i, j).setTextureOffset(0, 8);
this.model = (new ModelRenderer((ModelBase) this)).setTextureSize(i, j).setTextureOffset(0, 8);
this.model.setRotationPoint(-0.0F, 1.0F, 0.0F);
this.model.addBox(0.0F, -3.0F, 0.0F, 14, 7, 1);
this.model.isHidden = true;
ModelRenderer modelrenderer = (new ModelRenderer((ModelBase)this)).setTextureSize(i, j).setTextureOffset(0, 16);
ModelRenderer modelrenderer = (new ModelRenderer((ModelBase) this)).setTextureSize(i, j).setTextureOffset(0, 16);
modelrenderer.setRotationPoint(-0.0F, 0.0F, 0.2F);
modelrenderer.addBox(0.0F, -3.0F, 0.0F, 14, 7, 1);
this.model.addChild(modelrenderer);
ModelRenderer modelrenderer1 = (new ModelRenderer((ModelBase)this)).setTextureSize(i, j).setTextureOffset(0, 0);
ModelRenderer modelrenderer1 = (new ModelRenderer((ModelBase) this)).setTextureSize(i, j).setTextureOffset(0, 0);
modelrenderer1.setRotationPoint(-0.0F, 0.0F, 0.2F);
modelrenderer1.addBox(0.0F, -3.0F, 0.0F, 14, 7, 1);
modelrenderer.addChild(modelrenderer1);
}
public void render(Entity entityIn, float p_78088_2_, float walkingSpeed, float tickValue, float p_78088_5_, float p_78088_6_, float scale) {
float f = (float)Math.cos((tickValue / 10.0F)) / 20.0F - 0.03F - walkingSpeed / 20.0F;
float f = (float) Math.cos((tickValue / 10.0F)) / 20.0F - 0.03F - walkingSpeed / 20.0F;
ModelRenderer modelrenderer = (ModelRenderer) this.model.childModels.get(0);
ModelRenderer modelrenderer1 = (ModelRenderer) modelrenderer.childModels.get(0);
this.model.rotateAngleZ = f * 3.0F;
@ -75,8 +77,7 @@ public class CrystalWings extends CosmeticBase {
modelrenderer1.rotateAngleZ = 0.0F;
} else {
RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager();
if (rendermanager != null)
GlStateManager.rotate(rendermanager.playerViewX / 3.0F, 1.0F, 0.0F, 0.0F);
if (rendermanager != null) GlStateManager.rotate(rendermanager.playerViewX / 3.0F, 1.0F, 0.0F, 0.0F);
}
this.model.isHidden = false;
for (int i = -1; i <= 1; i += 2) {
@ -87,17 +88,15 @@ public class CrystalWings extends CosmeticBase {
GlStateManager.alphaFunc(516, 0.003921569F);
GlStateManager.disableLighting();
Minecraft.getMinecraft().getTextureManager().bindTexture(this.resourceLocation);
if (i == 1)
GlStateManager.scale(-1.0F, 1.0F, 1.0F);
if (i == 1) GlStateManager.scale(-1.0F, 1.0F, 1.0F);
GlStateManager.translate(0.05D, 0.0D, 0.0D);
this.model.render(scale);
GlStateManager.disableBlend();
GlStateManager.alphaFunc(516, 0.1F);
GlStateManager.popMatrix();
GlStateManager.depthMask(true);
GlStateManager.color(1,1,1);
GlStateManager.color(1, 1, 1);
}
this.model.isHidden = true;
GlStateManager.popMatrix();

View File

@ -9,6 +9,7 @@ import net.minecraft.client.renderer.entity.RenderPlayer;
import net.minecraft.entity.Entity;
public class Glasses extends CosmeticBase {
private final GlassesRenderer glassesModel;
public Glasses(RenderPlayer renderPlayer) {
@ -18,9 +19,9 @@ public class Glasses extends CosmeticBase {
@Override
public void render(AbstractClientPlayer player, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float headYaw, float headPitch, float scale) {
if(CosmeticController.renderGlasses(player)){
if (CosmeticController.renderGlasses(player)) {
GlStateManager.pushMatrix();
if(player.isSneaking()) {
if (player.isSneaking()) {
GlStateManager.translate(0, 0.225, 0);
}
GlStateManager.rotate(headYaw, 0.0F, 1.0F, 0.0F);
@ -30,7 +31,7 @@ public class Glasses extends CosmeticBase {
}
}
public class GlassesRenderer extends CosmeticModelBase{
public class GlassesRenderer extends CosmeticModelBase {
ModelRenderer Glasses1;
ModelRenderer Glasses2;
@ -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.rotateAngleY = y;
model.rotateAngleZ = z;

View File

@ -12,6 +12,7 @@ import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
public class Halo extends CosmeticBase {
private final ModelHalo modelHalo;
private static final ResourceLocation HALOBLUE;
@ -29,7 +30,7 @@ public class Halo extends CosmeticBase {
if (CosmeticController.renderHalo(player)) {
GlStateManager.pushMatrix();
this.playerRenderer.bindTexture(Halo.HALOBLUE);
if(player.isSneaking()) {
if (player.isSneaking()) {
GlStateManager.translate(0, 0.225, 0);
}
GlStateManager.color(1, 1, 1);
@ -38,8 +39,8 @@ public class Halo extends CosmeticBase {
}
}
private class ModelHalo extends CosmeticModelBase
{
private class ModelHalo extends CosmeticModelBase {
private ModelRenderer halo;
public ModelHalo(final RenderPlayer player) {
@ -51,7 +52,7 @@ public class Halo extends CosmeticBase {
@Override
public void render(final Entity entityIn, final float limbSwing, final float limbSwingAmount, final float ageInTicks, final float headYaw, final float headPitch, final float scale) {
GlStateManager.pushMatrix();
final float f = (float)Math.cos(ageInTicks / 10.0) / 20.0f;
final float f = (float) Math.cos(ageInTicks / 10.0) / 20.0f;
GlStateManager.rotate(headYaw + ageInTicks / 2.0f, 0.0f, 1.0f, 0.0f);
GlStateManager.translate(0.0f, f, 0.0f);
Minecraft.getMinecraft().getTextureManager().bindTexture(Halo.HALOBLUE);
@ -71,6 +72,5 @@ public class Halo extends CosmeticBase {
Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation);
return colorModel;
}
}
}

View File

@ -9,24 +9,23 @@ import net.minecraft.client.renderer.entity.RenderPlayer;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
public class TopHat extends CosmeticBase{
public class TopHat extends CosmeticBase {
private final ModelTopHat modelTopHat;
private static final ResourceLocation hat = new ResourceLocation("eagler:gui/hat.png");
public TopHat(RenderPlayer renderPlayer){
public TopHat(RenderPlayer renderPlayer) {
super(renderPlayer);
modelTopHat = new ModelTopHat(renderPlayer);
}
@Override
public void render(AbstractClientPlayer player, float limbSwing, float limbSwingAmount, float partialTicks,
float ageInTicks, float HeadYaw, float headPitch, float scale) {
if(CosmeticController.renderTopHat(player)){
public void render(AbstractClientPlayer player, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float HeadYaw, float headPitch, float scale) {
if (CosmeticController.renderTopHat(player)) {
GlStateManager.pushMatrix();
playerRenderer.bindTexture(hat);
if(player.isSneaking()){
if (player.isSneaking()) {
GlStateManager.translate(0, 0.225D, 0);
}
@ -43,7 +42,7 @@ public class TopHat extends CosmeticBase{
private ModelRenderer rim;
private ModelRenderer tip;
public ModelTopHat(RenderPlayer player){
public ModelTopHat(RenderPlayer player) {
super(player);
rim = new ModelRenderer(playerModel, 0, 0);
rim.addBox(-5.5F, -9F, -5.5F, 11, 2, 11);
@ -53,7 +52,6 @@ public class TopHat extends CosmeticBase{
@Override
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float headYaw, float headPitch, float scale) {
rim.rotateAngleX = playerModel.bipedHead.rotateAngleX;
rim.rotateAngleY = playerModel.bipedHead.rotateAngleY;
rim.rotationPointX = 0.0f;
@ -65,8 +63,6 @@ public class TopHat extends CosmeticBase{
tip.rotationPointX = 0.0f;
tip.rotationPointY = 0.0f;
tip.render(scale);
}
}
}

View File

@ -1,13 +1,12 @@
package dev.resent.module.base;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import dev.resent.annotation.Module;
import dev.resent.module.setting.Setting;
import dev.resent.ui.Theme;
import dev.resent.util.render.RenderUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import net.minecraft.client.Minecraft;
public abstract class Mod {
@ -20,9 +19,9 @@ public abstract class Mod {
public List<Setting> settings = new ArrayList<>();
public Mod(){
public Mod() {
Module modInfo;
if(getClass().isAnnotationPresent(Module.class)){
if (getClass().isAnnotationPresent(Module.class)) {
modInfo = getClass().getAnnotation(Module.class);
this.setName(modInfo.name());
this.setCategory(modInfo.category());
@ -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 onDisable() {}
public void toggle() {
@ -39,25 +42,23 @@ public abstract class Mod {
onChange();
}
private void onChange(){
if(enabled)
onEnable();
else
onDisable();
private void onChange() {
if (enabled) onEnable(); else onDisable();
}
public void setEnabled(final boolean enabled) {
this.enabled = enabled;
onChange();
}
protected void drawRect(final int left, final int top, final int right, final int bottom, final int color){
protected void drawRect(final int left, final int top, final int right, final int bottom, final int color) {
RenderUtils.drawRoundedRect(left, top, right, bottom, 4, color, Theme.getRounded());
}
protected int drawString(final String text, final int x, final int y, final int color, final boolean idk){
if(color == 6942069){
protected int drawString(final String text, final int x, final int y, final int color, final boolean idk) {
if (color == 6942069) {
RenderUtils.drawChromaString(text, x, y, idk);
}else {
} else {
Minecraft.getMinecraft().fontRendererObj.drawString(text, x, y, color, idk);
}
@ -70,17 +71,37 @@ public abstract class Mod {
public final String name;
public int i;
Category(final String name) {
this.name = name;
}
}
public boolean isEnabled() { return enabled; }
public boolean isHasSetting() { return 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; }
public boolean isEnabled() {
return enabled;
}
public boolean isHasSetting() {
return 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;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.impl.hud.ArmorHud;
import dev.resent.module.impl.hud.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.Sprint;
import dev.resent.module.impl.misc.TabGui;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
public class ModManager {
public List<Mod> modules = new ArrayList<>();
public static Cosmetics cosmetics = new Cosmetics();
@ -100,7 +100,7 @@ public class ModManager {
register(animations);
}
public ArrayList<Mod> modsInCategory(Category c){
public ArrayList<Mod> modsInCategory(Category c) {
ArrayList<Mod> inCat = (ArrayList<Mod>) this.modules.stream().filter(m -> m.getCategory() == c).collect(Collectors.toList());
return inCat;

View File

@ -11,9 +11,9 @@ public abstract class RenderMod extends Mod {
public int x, y, lastX, lastY, width, height;
private boolean dragging;
public RenderMod(){
public RenderMod() {
RenderModule modInfo;
if(getClass().isAnnotationPresent(RenderModule.class)){
if (getClass().isAnnotationPresent(RenderModule.class)) {
modInfo = getClass().getAnnotation(RenderModule.class);
this.setName(modInfo.name());
this.setCategory(modInfo.category());
@ -24,8 +24,8 @@ public abstract class RenderMod extends Mod {
}
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) {
this.x = GuiScreen.width - getWidth();
dragging = false;
@ -51,7 +51,7 @@ public abstract class RenderMod extends Mod {
final boolean hovered = mouseX >= getX() && mouseY >= getY() && mouseX < getX() + getWidth() && mouseY < getY() + this.getHeight();
Gui.drawRect(this.x, this.y, this.x + this.getWidth(), this.y + this.getHeight(), hovered ? 0x50FFFFFF : 0x40FFFFFF);
RenderUtils.drawRectOutline(this.x, this.y, this.x+this.getWidth(), this.y+this.getHeight(), -1);
RenderUtils.drawRectOutline(this.x, this.y, this.x + this.getWidth(), this.y + this.getHeight(), -1);
final boolean mouseOverX = (mouseX >= this.getX() && mouseX <= this.getX() + this.getWidth());
final boolean mouseOverY = (mouseY >= this.getY() && mouseY <= this.getY() + this.getHeight());
@ -61,7 +61,6 @@ public abstract class RenderMod extends Mod {
this.lastY = y - mouseY;
this.dragging = true;
}
}
public int getX() {

View File

@ -13,7 +13,10 @@ import net.minecraft.item.ItemStack;
public class ArmorHud extends RenderMod {
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 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 item = new BooleanSetting("Item", "", true);
public int getWidth() { return 20; }
public int getHeight() { return 96; }
public int getWidth() {
return 20;
}
public int getHeight() {
return 96;
}
@Override
public void draw() {

View File

@ -1,13 +1,12 @@
package dev.resent.module.impl.hud;
import java.util.ArrayList;
import java.util.List;
import dev.resent.annotation.RenderModule;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.RenderMod;
import dev.resent.ui.Theme;
import dev.resent.util.misc.FuncUtils;
import java.util.ArrayList;
import java.util.List;
@RenderModule(name = "CPS", category = Category.HUD, x = 4, y = 26)
public class CPS extends RenderMod {
@ -16,18 +15,22 @@ public class CPS extends RenderMod {
private boolean wasPressed;
private long lastPressed;
public int getWidth() { return mc.fontRendererObj.getStringWidth("[CPS: "+ clicks.size() + "]") + 4; }
public int getHeight() { return mc.fontRendererObj.FONT_HEIGHT+4; }
public int getWidth() {
return mc.fontRendererObj.getStringWidth("[CPS: " + clicks.size() + "]") + 4;
}
public int getHeight() {
return mc.fontRendererObj.FONT_HEIGHT + 4;
}
@Override
public void draw() {
boolean pressed = mc.gameSettings.keyBindAttack.pressed || mc.gameSettings.keyBindUseItem.pressed;
if(pressed != wasPressed){
if (pressed != wasPressed) {
lastPressed = System.currentTimeMillis();
wasPressed = pressed;
if(pressed){
if (pressed) {
this.clicks.add(lastPressed);
}
}
@ -35,7 +38,6 @@ public class CPS extends RenderMod {
final long time = System.currentTimeMillis();
FuncUtils.removeIf(clicks, aLong -> aLong + 1000 < time);
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,19 +27,24 @@ public class ComboCounter extends RenderMod {
}
}
public int getWidth() { return Minecraft.getMinecraft().fontRendererObj.getStringWidth(getText()) + 4; }
public int getHeight() { return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT + 4; }
public int getWidth() {
return Minecraft.getMinecraft().fontRendererObj.getStringWidth(getText()) + 4;
}
private String getText(){
return "["+combo+" Combo]";
public int getHeight() {
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT + 4;
}
private String getText() {
return "[" + combo + " Combo]";
}
@Override
public void draw() {
if(Minecraft.getMinecraft().thePlayer.hurtTime > 3 && this.isEnabled()){
if (Minecraft.getMinecraft().thePlayer.hurtTime > 3 && this.isEnabled()) {
combo = 0;
}
drawString("["+combo+" Combo]", this.x + 2, this.y + 2, Theme.getFontColor(Theme.getFontId()), Theme.getTextShadow());
drawString("[" + combo + " Combo]", this.x + 2, this.y + 2, Theme.getFontColor(Theme.getFontId()), Theme.getTextShadow());
}
}

View File

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

View File

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

View File

@ -1,15 +1,17 @@
package dev.resent.module.impl.hud;
import dev.resent.annotation.Module;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.setting.BooleanSetting;
import dev.resent.module.setting.ModeSetting;
@Module(name = "Hitboxes", category = Category.HUD, hasSetting = true)
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 BooleanSetting old = new BooleanSetting("1.7 Hitboxes", "", true);

View File

@ -12,12 +12,12 @@ import net.minecraft.util.MathHelper;
@RenderModule(name = "Info", category = Category.HUD, x = 140, y = 50, hasSetting = true)
public class Info extends RenderMod {
public Info(){
public Info() {
addSetting(direction);
}
public BooleanSetting direction = new BooleanSetting("Direction", "", true);
public static final String[] directionsF = new String[]{"\u00A79S\u00A7r", "\u00A72W\u00A7r", "\u00A74N\u00A7r", "\u00A76E\u00A7r"};
public static final String[] directionsF = new String[] { "\u00A79S\u00A7r", "\u00A72W\u00A7r", "\u00A74N\u00A7r", "\u00A76E\u00A7r" };
public int getWidth() {
return mc.fontRendererObj.getStringWidth("X: -99999999 + ");
@ -32,17 +32,15 @@ public class Info extends RenderMod {
int px = (int) mc.thePlayer.posX;
int py = (int) mc.thePlayer.posY;
int pz = (int) mc.thePlayer.posZ;
int rot = MathHelper.floor_double(this.mc.thePlayer.rotationYaw*4/360+0.5) & 3;
int rot = MathHelper.floor_double(this.mc.thePlayer.rotationYaw * 4 / 360 + 0.5) & 3;
if (mc.thePlayer != null) {
drawRect(this.x, this.y, this.x + this.getWidth(), this.y + this.getHeight(), new Color(0, 0, 0, 200).getRGB());
drawString(" X: " + px, this.x + 5, this.y + 14, 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());
if (direction.getValue())
drawString(" Dir: " + directionsF[rot], this.x+5+mc.fontRendererObj.getStringWidth(" X: " + px), this.y + 14, Theme.getFontColor(Theme.getFontId()), Theme.getTextShadow());
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(" 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;
import java.util.ArrayList;
import java.util.List;
import dev.resent.annotation.RenderModule;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.RenderMod;
@ -12,16 +9,18 @@ import dev.resent.ui.Theme;
import dev.resent.util.misc.FuncUtils;
import dev.resent.util.render.Color;
import dev.resent.util.render.RenderUtils;
import java.util.ArrayList;
import java.util.List;
import net.lax1dude.eaglercraft.v1_8.Mouse;
import net.minecraft.client.Minecraft;
@RenderModule(name = "Keystrokes", category = Category.HUD, x = 140, y = 150, hasSetting = true)
public class KeyStrokes extends RenderMod{
public class KeyStrokes extends RenderMod {
public static KeyStrokes INSTANCE = new KeyStrokes();
private Minecraft mc = Minecraft.getMinecraft();
public KeyStrokes(){
public KeyStrokes() {
addSetting(sneak, jump, color, colorp, gcolor, gcolorp);
}
@ -40,16 +39,14 @@ public class KeyStrokes extends RenderMod{
public long lastPressed2;
public float getSize(ModeSetting size) {
if (size.getValue() == "Small")
return 0.75f;
if (size.getValue() == "Normal")
return 1.0f;
if (size.getValue() == "Large")
return 1.25f;
if (size.getValue() == "Small") return 0.75f;
if (size.getValue() == "Normal") return 1.0f;
if (size.getValue() == "Large") return 1.25f;
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);
return this.clicks.size();
}
@ -64,7 +61,6 @@ public class KeyStrokes extends RenderMod{
@Override
public void draw() {
boolean pressed = mc.gameSettings.keyBindAttack.pressed;
boolean rpressed = mc.gameSettings.keyBindUseItem.pressed;
boolean wKey = mc.gameSettings.keyBindForward.pressed;
@ -82,62 +78,46 @@ public class KeyStrokes extends RenderMod{
if (pressed != this.wasPressed) {
this.lastPressed = System.currentTimeMillis();
this.wasPressed = pressed;
if (pressed)
this.clicks.add(Long.valueOf(this.lastPressed));
if (pressed) this.clicks.add(Long.valueOf(this.lastPressed));
}
if (rpressed != this.wasPressed2) {
this.lastPressed2 = System.currentTimeMillis() + 10L;
this.wasPressed2 = rpressed;
if (rpressed)
this.clicks2.add(Long.valueOf(this.lastPressed2));
if (rpressed) this.clicks2.add(Long.valueOf(this.lastPressed2));
}
//W
RenderUtils.drawRoundedRect(this.x + 30, this.y + 3, this.x + 55, this.y + 25 + 3, 4,
wKey ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded());
RenderUtils.drawRoundedRect(this.x + 30, this.y + 3, this.x + 55, this.y + 25 + 3, 4, wKey ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded());
// S
RenderUtils.drawRoundedRect(this.x + 30, this.y + 30, this.x + 55, this.y + 55, 4,
sKey ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded());
RenderUtils.drawRoundedRect(this.x + 30, this.y + 30, this.x + 55, this.y + 55, 4, sKey ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded());
// A
RenderUtils.drawRoundedRect(this.x + 3, this.y + 30, this.x + 25 + 3, this.y + 55, 4,
aKey ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded());
RenderUtils.drawRoundedRect(this.x + 3, this.y + 30, this.x + 25 + 3, this.y + 55, 4, aKey ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded());
// D
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());
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());
// LMB
RenderUtils.drawRoundedRect(this.x+3, this.y+57, this.x+41, this.y+82, 4,
pressed ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded());
RenderUtils.drawRoundedRect(this.x + 3, this.y + 57, this.x + 41, this.y + 82, 4, pressed ? getColor(gcolor) : getColor(gcolorp), Theme.getRounded());
// RMB
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());
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());
// Jump
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());
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());
// Sneak
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());
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());
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("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());
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());
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("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("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("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());
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());
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("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.setWidth((25 + 5 + 25 + 5 + 30));
}
public static int getColor(ModeSetting asdf) {
switch (asdf.getValue()) {
case "Red":
return new Color(255, 0, 0, 208).getRGB();
@ -158,5 +138,4 @@ public class KeyStrokes extends RenderMod{
}
return -1;
}
}

View File

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

View File

@ -1,11 +1,10 @@
package dev.resent.module.impl.hud;
import java.text.DecimalFormat;
import dev.resent.annotation.RenderModule;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.RenderMod;
import dev.resent.ui.Theme;
import java.text.DecimalFormat;
import net.minecraft.entity.Entity;
import net.minecraft.util.Vec3;
@ -28,8 +27,8 @@ public class ReachDisplay extends RenderMod {
drawString("[" + df2.format(range) + " Blocks]", this.x + 2, this.y + 2, Theme.getFontColor(Theme.getFontId()), Theme.getTextShadow());
}
public void onAttack(Entity e){
if(this.isEnabled()){
public void onAttack(Entity e) {
if (this.isEnabled()) {
final Vec3 vec3 = this.mc.getRenderViewEntity().getPositionEyes(1.0f);
this.range = this.mc.objectMouseOver.hitVec.distanceTo(vec3);
}

View File

@ -1,8 +1,8 @@
package dev.resent.module.impl.misc;
import dev.resent.annotation.Module;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
@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;
import dev.resent.annotation.Module;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.setting.BooleanSetting;
@Module(name = "AutoGG", category = Category.MISC, hasSetting = true)
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 onLose = new BooleanSetting("On Lose", "", true);

View File

@ -1,8 +1,8 @@
package dev.resent.module.impl.misc;
import dev.resent.annotation.Module;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
@Module(name = "AutoRespawn", category = Category.MISC)
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;
import dev.resent.annotation.Module;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
@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;
import dev.resent.annotation.Module;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.setting.BooleanSetting;
import dev.resent.module.setting.ModeSetting;
@Module(name = "Cosmetics", category = Category.MISC, hasSetting = true)
public class Cosmetics extends Mod{
public Cosmetics(){ addSetting(who, show, halo, crystalwings, glasses, hat); }
public class Cosmetics extends Mod {
public Cosmetics() {
addSetting(who, show, halo, crystalwings, glasses, hat);
}
public static BooleanSetting show = new BooleanSetting("Show cosmetics", "", 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 glasses = new BooleanSetting("Glasses", "", false);
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;
import dev.resent.annotation.Module;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
@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;
import dev.resent.annotation.Module;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
@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;
import dev.resent.annotation.Module;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
import net.minecraft.util.MathHelper;
@Module(name = "Fast math", category = Category.MISC)
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
public void onEnable() {
if (mc.thePlayer != null && mc.theWorld != null && mc.gameSettings != null) {
//Resent.INSTANCE.playMusic();
Resent.INSTANCE.test();
mc.gameSettings.gammaSetting = 100;
}

View File

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

View File

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

View File

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

View File

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

View File

@ -11,89 +11,86 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
@RenderModule(name = "TabGUI", category = Category.HUD, x = 30, y = 150)
public class TabGui extends RenderMod{
public class TabGui extends RenderMod {
public int current = 0;
public boolean expanded;
public int getWidth(){
public int getWidth() {
return expanded ? 139 : 70;
}
public int getHeight(){
return Category.values().length*16+4;
public int getHeight() {
return Category.values().length * 16 + 4;
}
public void draw() {
Gui.drawRect(x, y, x+70, y+3+Category.values().length*16, 0x90000000);
RenderUtils.drawChromaRectangle(x, y+current*16, x+70, y+18f+current*16, 0.6f, 0xff900000);
Gui.drawRect(x, y, x + 70, y + 3 + Category.values().length * 16, 0x90000000);
RenderUtils.drawChromaRectangle(x, y + current * 16, x + 70, y + 18f + current * 16, 0.6f, 0xff900000);
int offset = 0;
for(Category c : Category.values()){
Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(c.name, x+10, y+6.5f+offset, -1);
for (Category c : Category.values()) {
Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(c.name, x + 10, y + 6.5f + offset, -1);
offset += 16;
}
if(expanded){
if (expanded) {
Category category = Category.values()[current];
if(Resent.INSTANCE.modManager.modsInCategory(category).size() == 0)
return;
if (Resent.INSTANCE.modManager.modsInCategory(category).size() == 0) return;
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);
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);
offset = 0;
for(Mod m : Resent.INSTANCE.modManager.modsInCategory(category)){
Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(m.getName(), x+73, y+6.5f+offset, -1);
for (Mod m : Resent.INSTANCE.modManager.modsInCategory(category)) {
Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(m.getName(), x + 73, y + 6.5f + offset, -1);
offset += 16;
}
}
}
public void onKey(int k){
public void onKey(int k) {
Category category = Category.values()[current];
if (k ==KeyboardConstants.KEY_UP) {
if(expanded){
if(category.i <= 0){
category.i = Resent.INSTANCE.modManager.modsInCategory(category).size()-1;
}else{
if (k == KeyboardConstants.KEY_UP) {
if (expanded) {
if (category.i <= 0) {
category.i = Resent.INSTANCE.modManager.modsInCategory(category).size() - 1;
} else {
--category.i;
}
}else {
if(current <= 0){
current = Category.values().length-1;
}else {
} else {
if (current <= 0) {
current = Category.values().length - 1;
} else {
--current;
}
}
}
if (k ==KeyboardConstants.KEY_DOWN) {
if(expanded){
if(category.i >= Resent.INSTANCE.modManager.modsInCategory(category).size() - 1){
if (k == KeyboardConstants.KEY_DOWN) {
if (expanded) {
if (category.i >= Resent.INSTANCE.modManager.modsInCategory(category).size() - 1) {
category.i = 0;
}else {
} else {
++category.i;
}
}else {
if(current >= Category.values().length-1){
} else {
if (current >= Category.values().length - 1) {
current = 0;
}else {
} else {
++current;
}
}
}
if (k ==KeyboardConstants.KEY_RIGHT){
if(expanded && Resent.INSTANCE.modManager.modsInCategory(category).size() != 0 && Resent.INSTANCE.modManager.modsInCategory(category).get(category.i).getName() != "TabGUI"){
if (k == KeyboardConstants.KEY_RIGHT) {
if (expanded && Resent.INSTANCE.modManager.modsInCategory(category).size() != 0 && Resent.INSTANCE.modManager.modsInCategory(category).get(category.i).getName() != "TabGUI") {
Resent.INSTANCE.modManager.modsInCategory(category).get(category.i).toggle();
mc.gameSettings.saveOptions();
}else {
} else {
expanded = true;
}
}
if (k ==KeyboardConstants.KEY_LEFT){
if (k == KeyboardConstants.KEY_LEFT) {
expanded = false;
}
}
}

View File

@ -1,17 +1,16 @@
package dev.resent.ui;
import java.io.IOException;
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.setting.BooleanSetting;
import dev.resent.module.setting.ModeSetting;
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.render.Color;
import dev.resent.util.render.RenderUtils;
import java.io.IOException;
import net.lax1dude.eaglercraft.v1_8.Keyboard;
import net.lax1dude.eaglercraft.v1_8.Mouse;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
@ -111,14 +110,14 @@ public class ClickGUI extends GuiScreen {
y = sr.getScaledHeight() - 10 + xy;
int off = 0;
if(close) {
if (close) {
introAnimation.setDirection(Direction.BACKWARDS);
if(introAnimation.isDone(Direction.BACKWARDS)) {
if (introAnimation.isDone(Direction.BACKWARDS)) {
mc.displayGuiScreen(null);
}
}
GlUtils.startScale((this.x + this.width)/2, (this.y + this.height) / 2, (float) introAnimation.getValue());
GlUtils.startScale((this.x + this.width) / 2, (this.y + this.height) / 2, (float) introAnimation.getValue());
// background
drawRect(x - 10, y + 20, width + 35, height - 10, new Color(35, 39, 42, 200).getRGB());
@ -155,12 +154,10 @@ public class ClickGUI extends GuiScreen {
);
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))
GlStateManager.color(1,1,1,0.6f);
else {
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.enableBlend();
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);
GlStateManager.color(1, 1, 1);
GlStateManager.disableBlend();
}
@ -179,22 +176,12 @@ public class ClickGUI extends GuiScreen {
Setting s = this.modWatching.settings.get(amogus);
if (s instanceof BooleanSetting) {
b = (BooleanSetting) s;
drawRect(
this.x + 11,
height - 9 + 50 + var,
this.x + 19,
height - 9 + 50 + 9 + var-1,
isMouseInside(
mouseX, mouseY,
this.x + 11,
height - 9 + 50 + var,
this.x + 19,
height - 9 + 50 + 9 + var-1) ? new Color(211, 211, 211, 65).getRGB() : new Color(105, 105, 105, 65).getRGB());
drawRect(this.x + 11, height - 9 + 50 + var, this.x + 19, height - 9 + 50 + 9 + var - 1, isMouseInside(mouseX, mouseY, this.x + 11, height - 9 + 50 + var, this.x + 19, height - 9 + 50 + 9 + var - 1) ? new Color(211, 211, 211, 65).getRGB() : new Color(105, 105, 105, 65).getRGB());
if(b.getValue()){
if (b.getValue()) {
GlStateManager.color(1, 1, 1);
mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/check.png"));
Gui.drawModalRectWithCustomSizedTexture(this.x+9, height+39+var, 0, 0, 12, 12, 12, 12);
Gui.drawModalRectWithCustomSizedTexture(this.x + 9, height + 39 + var, 0, 0, 12, 12, 12, 12);
}
}
@ -229,7 +216,6 @@ public class ClickGUI extends GuiScreen {
public void onGuiClosed() {
Keyboard.enableRepeatEvents(true);
mc.gameSettings.saveOptions();
}
@Override

View File

@ -5,7 +5,8 @@ import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.Gui;
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) {
super(buttonId, x, y, widthIn, heightIn, buttonText);
}
@ -14,7 +15,7 @@ public class ClientButton extends GuiButton{
public void drawButton(final Minecraft mc, final int mouseX, final int mouseY) {
FontRenderer fr = mc.fontRendererObj;
this.hovered = (mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height);
Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, hovered ? 0x30ffffff :0x20ffffff);
Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, hovered ? 0x30ffffff : 0x20ffffff);
drawCenteredString(fr, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, -1, false);
}

View File

@ -7,25 +7,24 @@ import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.util.ResourceLocation;
public class PreGUI extends GuiScreen{
public class PreGUI extends GuiScreen {
Minecraft mc = Minecraft.getMinecraft();
@Override
public void drawScreen(int i, int j, float var3) {
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);
Gui.drawRect(GuiScreen.width/2-20, GuiScreen.height/2+20, GuiScreen.width/2+40, GuiScreen.height/2+50, isMouseInside(i, j, GuiScreen.width/2-20, GuiScreen.height/2+20, GuiScreen.width/2+40, GuiScreen.height/2+50) ? 0x40FFFFFF : 0x50FFFFFF);
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);
Gui.drawRect(GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 20, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 50, isMouseInside(i, j, GuiScreen.width / 2 - 20, GuiScreen.height / 2 + 20, GuiScreen.width / 2 + 40, GuiScreen.height / 2 + 50) ? 0x40FFFFFF : 0x50FFFFFF);
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);
super.drawScreen(i, j, var3);
}
@Override
protected void mouseClicked(int parInt1, int parInt2, int parInt3) {
if(isMouseInside(parInt1, parInt2, GuiScreen.width/2-30, GuiScreen.height/2+20, GuiScreen.width/2+50, GuiScreen.height/2+50) && parInt3 == 0){
if (isMouseInside(parInt1, parInt2, GuiScreen.width / 2 - 30, GuiScreen.height / 2 + 20, GuiScreen.width / 2 + 50, GuiScreen.height / 2 + 50) && parInt3 == 0) {
mc.displayGuiScreen(new ClickGUI());
}
super.mouseClicked(parInt1, parInt2, parInt3);
@ -43,5 +42,4 @@ public class PreGUI extends GuiScreen{
public boolean isMouseInside(int mouseX, int mouseY, int x, int y, int width, int height) {
return (mouseX >= x && mouseX <= width) && (mouseY >= y && mouseY <= height);
}
}

View File

@ -11,12 +11,12 @@ import dev.resent.util.render.RenderUtils;
public class Theme {
public static int getFontColor(int id){
public static int getFontColor(int id) {
return getFontColor(id, 255);
}
public static int getFontColor(int id, int opacity){
switch(id){
public static int getFontColor(int id, int opacity) {
switch (id) {
case 1:
return -1;
case 50:
@ -27,8 +27,8 @@ public class Theme {
return -1;
}
public static Animation getAnimation(int id, int ms, int endpoint, float easeAmount, float elasticity, float smooth, boolean moreElasticity){
switch(id){
public static Animation getAnimation(int id, int ms, int endpoint, float easeAmount, float elasticity, float smooth, boolean moreElasticity) {
switch (id) {
case 1:
return new EaseBackIn(ms, endpoint, easeAmount);
case 2:
@ -44,8 +44,8 @@ public class Theme {
return null;
}
public static int getFontId(){
switch(HUD.fontTheme.getValue()){
public static int getFontId() {
switch (HUD.fontTheme.getValue()) {
case "Classic":
return 1;
case "Rainbow":
@ -56,8 +56,8 @@ public class Theme {
return -1;
}
public static int getAnimationId(){
switch(HUD.animationTheme.getValue()){
public static int getAnimationId() {
switch (HUD.animationTheme.getValue()) {
case "Ease back in":
return 1;
case "Elastic":
@ -72,12 +72,11 @@ public class Theme {
return -1;
}
public static boolean getRounded(){
public static boolean getRounded() {
return HUD.round.getValue();
}
public static boolean getTextShadow(){
public static boolean getTextShadow() {
return HUD.tshadow.getValue();
}
}

View File

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

View File

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

View File

@ -5,25 +5,23 @@ public class SimpleAnimation {
private float value;
private long lastMS;
public SimpleAnimation(final float value){
public SimpleAnimation(final float value) {
this.value = value;
this.lastMS = System.currentTimeMillis();
}
public void setAnimation(final float value, double speed){
public void setAnimation(final float value, double speed) {
final long currentMS = System.currentTimeMillis();
final long delta = currentMS - this.lastMS;
this.lastMS = currentMS;
double deltaValue = 0.0;
if(speed > 28) {
if (speed > 28) {
speed = 28;
}
if (speed != 0.0)
{
if (speed != 0.0) {
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;
public class EaseBackIn extends Animation {
private final float easeAmount;
public EaseBackIn(int ms, double endPoint, float easeAmount) {
@ -27,5 +28,4 @@ public class EaseBackIn extends Animation {
float shrink = easeAmount + 1;
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;
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
return -2 * Math.pow(x1, 3) + (3 * Math.pow(x1, 2));
}
}

View File

@ -13,7 +13,7 @@ public class GlUtils {
GlStateManager.translate(-x, -y, 0);
}
public static void stopScale(){
public static void stopScale() {
GlStateManager.popMatrix();
}
@ -26,9 +26,9 @@ public class GlUtils {
GlStateManager.popMatrix();
}
public static void drawCenteredScaledString(String text, int param1,int param2, int color, float scale){
public static void drawCenteredScaledString(String text, int param1, int param2, int color, float scale) {
GlStateManager.pushMatrix();
GlStateManager.scale(scale,scale,scale);
GlStateManager.scale(scale, scale, scale);
Gui.drawCenteredString(Minecraft.getMinecraft().fontRendererObj, text, (int) (param1 / scale), (int) (param2 / scale), color, true);
GlStateManager.popMatrix();
}

View File

@ -20,30 +20,30 @@ public class RenderUtils {
final long l = System.currentTimeMillis() - (xTmp * 10 - y * 10);
final int i = Color.HSBtoRGB(l % 2000L / 2000.0f, 0.8f, 0.8f);
final String tmp = String.valueOf(textChar);
mc.fontRendererObj.drawString(tmp, (float)xTmp, (float)y, i, shadow);
mc.fontRendererObj.drawString(tmp, (float) xTmp, (float) y, i, shadow);
xTmp += mc.fontRendererObj.getCharWidth(textChar);
}
}
public static void drawChromaRectangle(float x, float y, float width, float height, float speed, int colorbecauseidontwanttoremovecolor) {
float i = x;
while(true) {
if(i+10 <= width) {
Gui.drawRect(i, y, i+10, height,RenderUtils.astolfoColorsDraw(i, GuiScreen.width, speed*10000));
while (true) {
if (i + 10 <= width) {
Gui.drawRect(i, y, i + 10, height, RenderUtils.astolfoColorsDraw(i, GuiScreen.width, speed * 10000));
} else {
break;
}
i+=10;
i += 10;
}
if(width-i != 0) {
for(float h = i; h < width; h++) {
Gui.drawRect(h, y, h+1, height,RenderUtils.astolfoColorsDraw(h, GuiScreen.width, speed*10000));
if (width - i != 0) {
for (float h = i; h < width; h++) {
Gui.drawRect(h, y, h + 1, height, RenderUtils.astolfoColorsDraw(h, GuiScreen.width, speed * 10000));
}
}
}
public static int astolfoColorsDraw(float yOffset, int yTotal, float speed) {
float hue = (float) (System.currentTimeMillis() % (int)speed) + ((yTotal - yOffset) * 9);
float hue = (float) (System.currentTimeMillis() % (int) speed) + ((yTotal - yOffset) * 9);
while (hue > speed) {
hue -= speed;
}
@ -61,10 +61,10 @@ public class RenderUtils {
final float f3 = (color >> 8 & 0xFF) / 255.0f;
final float f4 = (color & 0xFF) / 255.0f;
GlStateManager.color(f2, f3, f4, f1);
if(rounded[0]){
if (rounded[0]) {
drawRoundedRect(paramInt1, paramInt2, paramInt3, paramInt4, radius);
}else {
Gui.drawRect((int)paramInt1, (int)paramInt2, (int)paramInt3, (int)paramInt4, color);
} else {
Gui.drawRect((int) paramInt1, (int) paramInt2, (int) paramInt3, (int) paramInt4, color);
}
}
@ -107,7 +107,7 @@ public class RenderUtils {
worldrenderer.pos(f2, f3, 0).endVertex();
for (int j = 0; j <= i; ++j) {
final float f4 = j * f1;
worldrenderer.pos((float)(f2 + paramFloat5 * Math.cos(Math.toRadians(f4))), (float)(f3 - paramFloat5 * Math.sin(Math.toRadians(f4))), 0).endVertex();
worldrenderer.pos((float) (f2 + paramFloat5 * Math.cos(Math.toRadians(f4))), (float) (f3 - paramFloat5 * Math.sin(Math.toRadians(f4))), 0).endVertex();
}
tessellator.draw();
worldrenderer.begin(6, DefaultVertexFormats.POSITION_TEX);
@ -116,7 +116,7 @@ public class RenderUtils {
worldrenderer.pos(f2, f3, 0).endVertex();
for (int j = 0; j <= i; ++j) {
final float f4 = j * f1;
worldrenderer.pos((float)(f2 - paramFloat5 * Math.cos(Math.toRadians(f4))), (float)(f3 - paramFloat5 * Math.sin(Math.toRadians(f4))), 0).endVertex();
worldrenderer.pos((float) (f2 - paramFloat5 * Math.cos(Math.toRadians(f4))), (float) (f3 - paramFloat5 * Math.sin(Math.toRadians(f4))), 0).endVertex();
}
tessellator.draw();
worldrenderer.begin(6, DefaultVertexFormats.POSITION_TEX);
@ -125,7 +125,7 @@ public class RenderUtils {
worldrenderer.pos(f2, f3, 0).endVertex();
for (int j = 0; j <= i; ++j) {
final float f4 = j * f1;
worldrenderer.pos((float)(f2 - paramFloat5 * Math.cos(Math.toRadians(f4))), (float)(f3 + paramFloat5 * Math.sin(Math.toRadians(f4))), 0).endVertex();
worldrenderer.pos((float) (f2 - paramFloat5 * Math.cos(Math.toRadians(f4))), (float) (f3 + paramFloat5 * Math.sin(Math.toRadians(f4))), 0).endVertex();
}
tessellator.draw();
worldrenderer.begin(6, DefaultVertexFormats.POSITION_TEX);
@ -134,7 +134,7 @@ public class RenderUtils {
worldrenderer.pos(f2, f3, 0).endVertex();
for (int j = 0; j <= i; ++j) {
final float f4 = j * f1;
worldrenderer.pos((float)(f2 + paramFloat5 * Math.cos(Math.toRadians(f4))), (float)(f3 + paramFloat5 * Math.sin(Math.toRadians(f4))), 0).endVertex();
worldrenderer.pos((float) (f2 + paramFloat5 * Math.cos(Math.toRadians(f4))), (float) (f3 + paramFloat5 * Math.sin(Math.toRadians(f4))), 0).endVertex();
}
tessellator.draw();
GlStateManager.shadeModel(7424);
@ -184,5 +184,4 @@ public class RenderUtils {
rainbowState %= 360;
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) {
int r = next(31);
int m = bound - 1;
if (
(bound & m) == 0
) r = (int) ((bound * (long) r) >> 31); else { // i.e., bound is a power of 2
if ((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));
}
return r;

View File

@ -2,7 +2,6 @@ package net.lax1dude.eaglercraft.v1_8;
public class EaglercraftVersion {
//////////////////////////////////////////////////////////////////////
/// 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
// 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";
// Miscellaneous variables:
public static final String mainMenuStringA = "Minecraft 1.8.8";
public static final String mainMenuStringB = projectOriginName + " " +
projectOriginRevision + "-" + projectOriginVersion;
public static final String mainMenuStringB = projectOriginName + " " + projectOriginRevision + "-" + projectOriginVersion;
public static final String mainMenuStringC = "Rewritten by " + projectOriginAuthor;
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];
public EaglerFontRenderer(GameSettings gameSettingsIn, ResourceLocation location, TextureManager textureManagerIn,
boolean unicode) {
public EaglerFontRenderer(GameSettings gameSettingsIn, ResourceLocation location, TextureManager textureManagerIn, boolean unicode) {
super(gameSettingsIn, location, textureManagerIn, unicode);
}
@ -38,7 +37,7 @@ public class EaglerFontRenderer extends FontRenderer {
this.posX = x + (dropShadow ? 1 : 0);
this.posY = y;
} else {
if(this.unicodeFlag || !decodeASCIICodepointsAndValidate(text)) {
if (this.unicodeFlag || !decodeASCIICodepointsAndValidate(text)) {
return super.drawString(text, x, y, color, dropShadow);
}
this.resetStyles();
@ -58,10 +57,10 @@ public class EaglerFontRenderer extends FontRenderer {
}
protected void renderStringAtPos(String parString1, boolean parFlag) {
if(parString1 == null) return;
if(this.unicodeFlag || !decodeASCIICodepointsAndValidate(parString1)) {
if (parString1 == null) return;
if (this.unicodeFlag || !decodeASCIICodepointsAndValidate(parString1)) {
super.renderStringAtPos(parString1, parFlag);
}else {
} else {
renderStringAtPos0(parString1, false);
}
}
@ -107,8 +106,7 @@ public class EaglerFontRenderer extends FontRenderer {
this.strikethroughStyle = false;
this.underlineStyle = false;
this.italicStyle = false;
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);
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);
}
++i;
@ -117,7 +115,8 @@ public class EaglerFontRenderer extends FontRenderer {
if (this.randomStyle && j != -1) {
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;
while (true) {
@ -135,31 +134,20 @@ public class EaglerFontRenderer extends FontRenderer {
if (this.strikethroughStyle) {
hasStrike = true;
worldrenderer.pos((double) this.posX, (double) (this.posY + (float) (this.FONT_HEIGHT / 2)), 0.0D)
.endVertex();
worldrenderer
.pos((double) (this.posX + f), (double) (this.posY + (float) (this.FONT_HEIGHT / 2)), 0.0D)
.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.pos((double) this.posX, (double) (this.posY + (float) (this.FONT_HEIGHT / 2)), 0.0D).endVertex();
worldrenderer.pos((double) (this.posX + f), (double) (this.posY + (float) (this.FONT_HEIGHT / 2)), 0.0D).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);
}
if (this.underlineStyle) {
hasStrike = true;
int l = this.underlineStyle ? -1 : 0;
worldrenderer.pos((double) (this.posX + (float) l),
(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 - 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.pos((double) (this.posX + (float) l), (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 - 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);
}
@ -169,12 +157,12 @@ public class EaglerFontRenderer extends FontRenderer {
float texScale = 0.0625f;
if(!hasStrike) {
if (!hasStrike) {
worldrenderer.finishDrawing();
}
if(parFlag) {
if(hasStrike) {
if (parFlag) {
if (hasStrike) {
GlStateManager.color(0.25f, 0.25f, 0.25f, 1.0f);
GlStateManager.translate(1.0f, 1.0f, 0.0f);
tessellator.draw();
@ -182,19 +170,19 @@ public class EaglerFontRenderer extends FontRenderer {
GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
InstancedFontRenderer.render(8, 8, texScale, texScale, true);
EaglercraftGPU.renderAgain();
}else {
} else {
GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
InstancedFontRenderer.render(8, 8, texScale, texScale, true);
}
}else {
} else {
GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
if(hasStrike) {
if (hasStrike) {
tessellator.draw();
}
InstancedFontRenderer.render(8, 8, texScale, texScale, false);
}
if(parFlag) {
if (parFlag) {
this.posX += 1.0f;
}
}
@ -202,27 +190,29 @@ public class EaglerFontRenderer extends FontRenderer {
private float appendCharToBuffer(int parInt1, int color, boolean boldStyle, boolean italicStyle) {
if (parInt1 == 32) {
return 4.0f;
}else {
} else {
int i = parInt1 % 16;
int j = parInt1 / 16;
float w = this.charWidth[parInt1];
if(boldStyle) {
InstancedFontRenderer.appendBoldQuad((int)this.posX, (int)this.posY, i, j, color, italicStyle);
if (boldStyle) {
InstancedFontRenderer.appendBoldQuad((int) this.posX, (int) this.posY, i, j, color, italicStyle);
++w;
}else {
InstancedFontRenderer.appendQuad((int)this.posX, (int)this.posY, i, j, color, italicStyle);
} else {
InstancedFontRenderer.appendQuad((int) this.posX, (int) this.posY, i, j, color, italicStyle);
}
return w;
}
}
private boolean decodeASCIICodepointsAndValidate(String str) {
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"
.indexOf(str.charAt(i));
if(j != -1) {
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".indexOf(
str.charAt(i)
);
if (j != -1) {
temporaryCodepointArray[i] = j;
}else {
} else {
return false;
}
}

View File

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

View File

@ -1,12 +1,12 @@
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.IRenderbufferGL;
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.
*
@ -39,7 +39,7 @@ public class GameOverlayFramebuffer {
private int framebufferColor = -1;
public void beginRender(int width, int height) {
if(framebuffer == null) {
if (framebuffer == null) {
framebuffer = _wglCreateFramebuffer();
depthBuffer = _wglCreateRenderbuffer();
framebufferColor = GlStateManager.generateTexture();
@ -54,11 +54,11 @@ public class GameOverlayFramebuffer {
_wglFramebufferRenderbuffer(_GL_FRAMEBUFFER, _GL_DEPTH_ATTACHMENT, _GL_RENDERBUFFER, depthBuffer);
}
if(currentWidth != width || currentHeight != height) {
if (currentWidth != width || currentHeight != height) {
currentWidth = width;
currentHeight = height;
GlStateManager.bindTexture(framebufferColor);
_wglTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, (ByteBuffer)null);
_wglTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, (ByteBuffer) null);
_wglBindRenderbuffer(_GL_RENDERBUFFER, depthBuffer);
_wglRenderbufferStorage(_GL_RENDERBUFFER, _GL_DEPTH_COMPONENT16, width, height);
}
@ -80,7 +80,7 @@ public class GameOverlayFramebuffer {
}
public void destroy() {
if(framebuffer != null) {
if (framebuffer != null) {
_wglDeleteFramebuffer(framebuffer);
_wglDeleteRenderbuffer(depthBuffer);
GlStateManager.deleteTexture(framebufferColor);
@ -91,5 +91,4 @@ public class GameOverlayFramebuffer {
_wglBindFramebuffer(_GL_FRAMEBUFFER, null);
}
}
}

View File

@ -1,5 +1,8 @@
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.log4j.LogManager;
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.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.
*
@ -94,10 +94,7 @@ public class GlStateManager {
static int activeTexture = 0;
static final boolean[] stateTexture = new boolean[16];
static final int[] boundTexture = new int[] {
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1
};
static final int[] boundTexture = new int[] { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
static float stateAnisotropicFixW = -999.0f;
static float stateAnisotropicFixH = -999.0f;
@ -120,12 +117,14 @@ public class GlStateManager {
static float clearDepth = -999.0f;
public static enum TexGen {
S, T, R, Q;
S,
T,
R,
Q;
int source = GL_OBJECT_LINEAR;
int plane = GL_OBJECT_PLANE;
Vector4f vector = new Vector4f();
}
static int stateTexGenSerial = 0;
@ -161,20 +160,20 @@ public class GlStateManager {
}
static void populateStack(Matrix4f[] stack) {
for(int i = 0; i < stack.length; ++i) {
for (int i = 0; i < stack.length; ++i) {
stack[i] = new Matrix4f();
}
}
static void populateStack(Matrix4f[][] stack) {
for(int i = 0; i < stack.length; ++i) {
for (int i = 0; i < stack.length; ++i) {
populateStack(stack[i]);
}
}
static void populateStack(Vector4f[][] stack) {
for(int i = 0; i < stack.length; ++i) {
for(int j = 0; j < stack[i].length; ++j) {
for (int i = 0; i < stack.length; ++i) {
for (int j = 0; j < stack[i].length; ++j) {
stack[i][j] = new Vector4f(0.0f, -1.0f, 0.0f, 0.0f);
}
}
@ -182,34 +181,32 @@ public class GlStateManager {
public static final void pushLightCoords() {
int push = stateLightsStackPointer + 1;
if(push < stateLightsStack.length) {
if (push < stateLightsStack.length) {
Vector4f[] copyFrom = stateLightsStack[stateLightsStackPointer];
boolean[] copyFrom2 = stateLightsEnabled[stateLightsStackPointer];
Vector4f[] copyTo = stateLightsStack[push];
boolean[] copyTo2 = stateLightsEnabled[push];
for(int i = 0; i < copyFrom.length; ++i) {
if(copyFrom2[i]) {
for (int i = 0; i < copyFrom.length; ++i) {
if (copyFrom2[i]) {
copyTo[i].set(copyFrom[i]);
copyTo2[i] = true;
}else {
} else {
copyTo2[i] = false;
}
}
stateLightingSerial[push] = stateLightingSerial[stateLightsStackPointer];
stateLightsStackPointer = push;
}else {
Throwable t = new IndexOutOfBoundsException("GL_LIGHT direction stack overflow!" +
" Exceeded " + stateLightsStack.length + " calls to GlStateManager.pushLightCoords");
} else {
Throwable t = new IndexOutOfBoundsException("GL_LIGHT direction stack overflow!" + " Exceeded " + stateLightsStack.length + " calls to GlStateManager.pushLightCoords");
logger.error(t);
}
}
public static final void popLightCoords() {
if(stateLightsStackPointer > 0) {
if (stateLightsStackPointer > 0) {
--stateLightsStackPointer;
}else {
Throwable t = new IndexOutOfBoundsException("GL_LIGHT direction stack underflow!" +
" Called GlStateManager.popLightCoords on an empty light stack");
} else {
Throwable t = new IndexOutOfBoundsException("GL_LIGHT direction stack underflow!" + " Called GlStateManager.popLightCoords on an empty light stack");
logger.error(t);
}
}
@ -223,9 +220,9 @@ public class GlStateManager {
}
public static final void alphaFunc(int func, float ref) {
if(func != GL_GREATER) {
if (func != GL_GREATER) {
throw new UnsupportedOperationException("Only GL_GREATER alphaFunc is supported");
}else {
} else {
stateAlphaTestRef = ref;
}
}
@ -239,12 +236,12 @@ public class GlStateManager {
}
private static final Vector4f paramVector4 = new Vector4f();
public static final void enableMCLight(int light, float diffuse, double dirX,
double dirY, double dirZ, double dirW) {
paramVector4.x = (float)dirX;
paramVector4.y = (float)dirY;
paramVector4.z = (float)dirZ;
paramVector4.w = (float)dirW;
public static final void enableMCLight(int light, float diffuse, double dirX, double dirY, double dirZ, double dirW) {
paramVector4.x = (float) dirX;
paramVector4.y = (float) dirY;
paramVector4.z = (float) dirZ;
paramVector4.w = (float) dirW;
Matrix4f.transform(modelMatrixStack[modelMatrixStackPointer], paramVector4, paramVector4);
paramVector4.normalise();
Vector4f dest = stateLightsStack[stateLightsStackPointer][light];
@ -277,14 +274,14 @@ public class GlStateManager {
}
public static final void disableDepth() {
if(stateDepthTest) {
if (stateDepthTest) {
_wglDisable(GL_DEPTH_TEST);
stateDepthTest = false;
}
}
public static final void enableDepth() {
if(!stateDepthTest) {
if (!stateDepthTest) {
_wglEnable(GL_DEPTH_TEST);
stateDepthTest = true;
}
@ -292,7 +289,7 @@ public class GlStateManager {
public static final void depthFunc(int depthFunc) {
int rev = depthFunc;
switch(depthFunc) {
switch (depthFunc) {
case GL_GREATER:
rev = GL_LESS;
break;
@ -309,41 +306,41 @@ public class GlStateManager {
rev = GL_GREATER;
break;
}
if(rev != stateDepthFunc) {
if (rev != stateDepthFunc) {
_wglDepthFunc(rev);
stateDepthFunc = rev;
}
}
public static final void depthMask(boolean flagIn) {
if(flagIn != stateDepthMask) {
if (flagIn != stateDepthMask) {
_wglDepthMask(flagIn);
stateDepthMask = flagIn;
}
}
public static final void disableBlend() {
if(stateBlend) {
if (stateBlend) {
_wglDisable(GL_BLEND);
stateBlend = false;
}
}
public static final void enableBlend() {
if(!stateBlend) {
if (!stateBlend) {
_wglEnable(GL_BLEND);
stateBlend = true;
}
}
public static final void blendFunc(int srcFactor, int dstFactor) {
if(stateEnableOverlayFramebufferBlending) {
if (stateEnableOverlayFramebufferBlending) {
tryBlendFuncSeparate(srcFactor, dstFactor, 0, 1);
return;
}
int srcBits = (srcFactor | (srcFactor << 16));
int dstBits = (dstFactor | (dstFactor << 16));
if(srcBits != stateBlendSRC || dstBits != stateBlendDST) {
if (srcBits != stateBlendSRC || dstBits != stateBlendDST) {
_wglBlendFunc(srcFactor, dstFactor);
stateBlendSRC = srcBits;
stateBlendDST = dstBits;
@ -351,13 +348,13 @@ public class GlStateManager {
}
public static final void tryBlendFuncSeparate(int srcFactor, int dstFactor, int srcFactorAlpha, int dstFactorAlpha) {
if(stateEnableOverlayFramebufferBlending) { // game overlay framebuffer in EntityRenderer.java
if (stateEnableOverlayFramebufferBlending) { // game overlay framebuffer in EntityRenderer.java
srcFactorAlpha = GL_ONE;
dstFactorAlpha = GL_ONE_MINUS_SRC_ALPHA;
}
int srcBits = (srcFactor | (srcFactorAlpha << 16));
int dstBits = (dstFactor | (dstFactorAlpha << 16));
if(srcBits != stateBlendSRC || dstBits != stateBlendDST) {
if (srcBits != stateBlendSRC || dstBits != stateBlendDST) {
_wglBlendFuncSeparate(srcFactor, dstFactor, srcFactorAlpha, dstFactorAlpha);
stateBlendSRC = srcBits;
stateBlendDST = dstBits;
@ -425,42 +422,42 @@ public class GlStateManager {
}
public static final void enableCull() {
if(!stateCull) {
if (!stateCull) {
_wglEnable(GL_CULL_FACE);
stateCull = true;
}
}
public static final void disableCull() {
if(stateCull) {
if (stateCull) {
_wglDisable(GL_CULL_FACE);
stateCull = false;
}
}
public static final void cullFace(int mode) {
if(stateCullFace != mode) {
if (stateCullFace != mode) {
_wglCullFace(mode);
stateCullFace = mode;
}
}
public static final void enablePolygonOffset() {
if(!statePolygonOffset) {
if (!statePolygonOffset) {
_wglEnable(GL_POLYGON_OFFSET_FILL);
statePolygonOffset = true;
}
}
public static final void disablePolygonOffset() {
if(statePolygonOffset) {
if (statePolygonOffset) {
_wglDisable(GL_POLYGON_OFFSET_FILL);
statePolygonOffset = false;
}
}
public static final void doPolygonOffset(float factor, float units) {
if(factor != statePolygonOffsetFactor || units != statePolygonOffsetUnits) {
if (factor != statePolygonOffsetFactor || units != statePolygonOffsetUnits) {
_wglPolygonOffset(-factor, units);
statePolygonOffsetFactor = factor;
statePolygonOffsetUnits = units;
@ -471,13 +468,9 @@ public class GlStateManager {
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() {
stateTexGen = true;
@ -495,7 +488,7 @@ public class GlStateManager {
public static final void func_179105_a(GlStateManager.TexGen coord, int plane, FloatBuffer vector) {
coord.plane = plane;
coord.vector.load(vector);
if(plane == GL_EYE_PLANE) {
if (plane == GL_EYE_PLANE) {
tmpInvertedMatrix.load(GlStateManager.modelMatrixStack[GlStateManager.modelMatrixStackPointer]).invert().transpose();
Matrix4f.transform(tmpInvertedMatrix, coord.vector, coord.vector);
}
@ -504,7 +497,7 @@ public class GlStateManager {
public static final void setActiveTexture(int texture) {
int textureIdx = texture - GL_TEXTURE0;
if(textureIdx != activeTexture) {
if (textureIdx != activeTexture) {
_wglActiveTexture(texture);
activeTexture = textureIdx;
}
@ -533,7 +526,7 @@ public class GlStateManager {
}
public static final void bindTexture(int texture) {
if(texture != boundTexture[activeTexture]) {
if (texture != boundTexture[activeTexture]) {
_wglBindTexture(GL_TEXTURE_2D, EaglercraftGPU.mapTexturesGL.get(texture));
boundTexture[activeTexture] = texture;
}
@ -543,20 +536,16 @@ public class GlStateManager {
return boundTexture[activeTexture];
}
public static final void shadeModel(int mode) {
}
public static final void shadeModel(int mode) {}
public static final void enableRescaleNormal() {
// 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) {
if(viewportX != x || viewportY != y || viewportW != w || viewportH != h) {
if (viewportX != x || viewportY != y || viewportW != w || viewportH != h) {
_wglViewport(x, y, w, h);
viewportX = x;
viewportY = y;
@ -567,7 +556,7 @@ public class GlStateManager {
public static final void colorMask(boolean red, boolean green, boolean blue, boolean alpha) {
int bits = (red ? 1 : 0) | (green ? 2 : 0) | (blue ? 4 : 0) | (alpha ? 8 : 0);
if(bits != colorMaskBits) {
if (bits != colorMaskBits) {
_wglColorMask(red, green, blue, alpha);
colorMaskBits = bits;
}
@ -575,14 +564,14 @@ public class GlStateManager {
public static final void clearDepth(float depth) {
depth = 1.0f - depth;
if(depth != clearDepth) {
if (depth != clearDepth) {
_wglClearDepth(depth);
clearDepth = depth;
}
}
public static final void clearColor(float red, float green, float blue, float alpha) {
if(red != clearColorR || green != clearColorG || blue != clearColorB || alpha != clearColorA) {
if (red != clearColorR || green != clearColorG || blue != clearColorB || alpha != clearColorA) {
_wglClearColor(red, green, blue, alpha);
clearColorR = red;
clearColorG = green;
@ -600,7 +589,7 @@ public class GlStateManager {
}
public static final void loadIdentity() {
switch(stateMatrixMode) {
switch (stateMatrixMode) {
case GL_MODELVIEW:
default:
modelMatrixStack[modelMatrixStackPointer].setIdentity();
@ -612,50 +601,46 @@ public class GlStateManager {
break;
case GL_TEXTURE:
textureMatrixStack[activeTexture][textureMatrixStackPointer[activeTexture]].setIdentity();
textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] =
++textureMatrixAccessSerial[activeTexture];
textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] = ++textureMatrixAccessSerial[activeTexture];
break;
}
}
public static final void pushMatrix() {
int push;
switch(stateMatrixMode) {
switch (stateMatrixMode) {
case GL_MODELVIEW:
default:
push = modelMatrixStackPointer + 1;
if(push < modelMatrixStack.length) {
if (push < modelMatrixStack.length) {
modelMatrixStack[push].load(modelMatrixStack[modelMatrixStackPointer]);
modelMatrixStackAccessSerial[push] = modelMatrixStackAccessSerial[modelMatrixStackPointer];
modelMatrixStackPointer = push;
}else {
Throwable t = new IndexOutOfBoundsException("GL_MODELVIEW matrix stack overflow!" +
" Exceeded " + modelMatrixStack.length + " calls to GlStateManager.pushMatrix");
} else {
Throwable t = new IndexOutOfBoundsException("GL_MODELVIEW matrix stack overflow!" + " Exceeded " + modelMatrixStack.length + " calls to GlStateManager.pushMatrix");
logger.error(t);
}
break;
case GL_PROJECTION:
push = projectionMatrixStackPointer + 1;
if(push < projectionMatrixStack.length) {
if (push < projectionMatrixStack.length) {
projectionMatrixStack[push].load(projectionMatrixStack[projectionMatrixStackPointer]);
projectionMatrixStackAccessSerial[push] = projectionMatrixStackAccessSerial[projectionMatrixStackPointer];
projectionMatrixStackPointer = push;
}else {
Throwable t = new IndexOutOfBoundsException("GL_PROJECTION matrix stack overflow!" +
" Exceeded " + projectionMatrixStack.length + " calls to GlStateManager.pushMatrix");
} else {
Throwable t = new IndexOutOfBoundsException("GL_PROJECTION matrix stack overflow!" + " Exceeded " + projectionMatrixStack.length + " calls to GlStateManager.pushMatrix");
logger.error(t);
}
break;
case GL_TEXTURE:
push = textureMatrixStackPointer[activeTexture] + 1;
if(push < textureMatrixStack.length) {
if (push < textureMatrixStack.length) {
int ptr = textureMatrixStackPointer[activeTexture];
textureMatrixStack[activeTexture][push].load(textureMatrixStack[activeTexture][ptr]);
textureMatrixStackAccessSerial[activeTexture][push] = textureMatrixStackAccessSerial[activeTexture][ptr];
textureMatrixStackPointer[activeTexture] = push;
}else {
Throwable t = new IndexOutOfBoundsException("GL_TEXTURE #" + activeTexture + " matrix stack overflow!" +
" Exceeded " + textureMatrixStack.length + " calls to GlStateManager.pushMatrix");
} else {
Throwable t = new IndexOutOfBoundsException("GL_TEXTURE #" + activeTexture + " matrix stack overflow!" + " Exceeded " + textureMatrixStack.length + " calls to GlStateManager.pushMatrix");
logger.error(t);
}
break;
@ -663,32 +648,29 @@ public class GlStateManager {
}
public static final void popMatrix() {
switch(stateMatrixMode) {
switch (stateMatrixMode) {
case GL_MODELVIEW:
default:
if(modelMatrixStackPointer > 0) {
if (modelMatrixStackPointer > 0) {
--modelMatrixStackPointer;
}else {
Throwable t = new IndexOutOfBoundsException("GL_MODELVIEW matrix stack underflow!" +
" Called GlStateManager.popMatrix on an empty matrix stack");
} else {
Throwable t = new IndexOutOfBoundsException("GL_MODELVIEW matrix stack underflow!" + " Called GlStateManager.popMatrix on an empty matrix stack");
logger.error(t);
}
break;
case GL_PROJECTION:
if(projectionMatrixStackPointer > 0) {
if (projectionMatrixStackPointer > 0) {
--projectionMatrixStackPointer;
}else {
Throwable t = new IndexOutOfBoundsException("GL_PROJECTION matrix stack underflow!" +
" Called GlStateManager.popMatrix on an empty matrix stack");
} else {
Throwable t = new IndexOutOfBoundsException("GL_PROJECTION matrix stack underflow!" + " Called GlStateManager.popMatrix on an empty matrix stack");
logger.error(t);
}
break;
case GL_TEXTURE:
if(textureMatrixStackPointer[activeTexture] > 0) {
if (textureMatrixStackPointer[activeTexture] > 0) {
--textureMatrixStackPointer[activeTexture];
}else {
Throwable t = new IndexOutOfBoundsException("GL_TEXTURE #" + activeTexture +
" matrix stack underflow! Called GlStateManager.popMatrix on an empty matrix stack");
} else {
Throwable t = new IndexOutOfBoundsException("GL_TEXTURE #" + activeTexture + " matrix stack underflow! Called GlStateManager.popMatrix on an empty matrix stack");
logger.error(t);
}
break;
@ -696,7 +678,7 @@ public class GlStateManager {
}
public static final void getFloat(int pname, float[] params) {
switch(pname) {
switch (pname) {
case GL_MODELVIEW_MATRIX:
modelMatrixStack[modelMatrixStackPointer].store(params);
break;
@ -713,7 +695,7 @@ public class GlStateManager {
public static final void ortho(double left, double right, double bottom, double top, double zNear, double zFar) {
Matrix4f matrix;
switch(stateMatrixMode) {
switch (stateMatrixMode) {
case GL_MODELVIEW:
matrix = modelMatrixStack[modelMatrixStackPointer];
modelMatrixStackAccessSerial[modelMatrixStackPointer] = ++modelMatrixAccessSerial;
@ -726,35 +708,35 @@ public class GlStateManager {
case GL_TEXTURE:
int ptr = textureMatrixStackPointer[activeTexture];
matrix = textureMatrixStack[activeTexture][ptr];
textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] =
++textureMatrixAccessSerial[activeTexture];
textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] = ++textureMatrixAccessSerial[activeTexture];
break;
}
matrix.m00 = 2.0f / (float)(right - left);
matrix.m00 = 2.0f / (float) (right - left);
matrix.m01 = 0.0f;
matrix.m02 = 0.0f;
matrix.m03 = 0.0f;
matrix.m10 = 0.0f;
matrix.m11 = 2.0f / (float)(top - bottom);
matrix.m11 = 2.0f / (float) (top - bottom);
matrix.m12 = 0.0f;
matrix.m13 = 0.0f;
matrix.m20 = 0.0f;
matrix.m21 = 0.0f;
matrix.m22 = 2.0f / (float)(zFar - zNear);
matrix.m22 = 2.0f / (float) (zFar - zNear);
matrix.m23 = 0.0f;
matrix.m30 = (float)(-(right + left) / (right - left));
matrix.m31 = (float)(-(top + bottom) / (top - bottom));
matrix.m32 = (float)((zFar + zNear) / (zFar - zNear));
matrix.m30 = (float) (-(right + left) / (right - left));
matrix.m31 = (float) (-(top + bottom) / (top - bottom));
matrix.m32 = (float) ((zFar + zNear) / (zFar - zNear));
matrix.m33 = 1.0f;
}
private static final Vector3f paramVector = new Vector3f();
private static final float toRad = 0.0174532925f;
public static final void rotate(float angle, float x, float y, float z) {
paramVector.x = x;
paramVector.y = y;
paramVector.z = z;
switch(stateMatrixMode) {
switch (stateMatrixMode) {
case GL_MODELVIEW:
default:
modelMatrixStack[modelMatrixStackPointer].rotate(angle * toRad, paramVector);
@ -767,8 +749,7 @@ public class GlStateManager {
case GL_TEXTURE:
int ptr = textureMatrixStackPointer[activeTexture];
textureMatrixStack[activeTexture][ptr].rotate(angle * toRad, paramVector);
textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] =
++textureMatrixAccessSerial[activeTexture];
textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] = ++textureMatrixAccessSerial[activeTexture];
break;
}
}
@ -777,7 +758,7 @@ public class GlStateManager {
paramVector.x = x;
paramVector.y = y;
paramVector.z = z;
switch(stateMatrixMode) {
switch (stateMatrixMode) {
case GL_MODELVIEW:
default:
modelMatrixStack[modelMatrixStackPointer].scale(paramVector);
@ -790,17 +771,16 @@ public class GlStateManager {
case GL_TEXTURE:
int ptr = textureMatrixStackPointer[activeTexture];
textureMatrixStack[activeTexture][ptr].scale(paramVector);
textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] =
++textureMatrixAccessSerial[activeTexture];
textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] = ++textureMatrixAccessSerial[activeTexture];
break;
}
}
public static final void scale(double x, double y, double z) {
paramVector.x = (float)x;
paramVector.y = (float)y;
paramVector.z = (float)z;
switch(stateMatrixMode) {
paramVector.x = (float) x;
paramVector.y = (float) y;
paramVector.z = (float) z;
switch (stateMatrixMode) {
case GL_MODELVIEW:
default:
modelMatrixStack[modelMatrixStackPointer].scale(paramVector);
@ -813,8 +793,7 @@ public class GlStateManager {
case GL_TEXTURE:
int ptr = textureMatrixStackPointer[activeTexture];
textureMatrixStack[activeTexture][ptr].scale(paramVector);
textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] =
++textureMatrixAccessSerial[activeTexture];
textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] = ++textureMatrixAccessSerial[activeTexture];
break;
}
}
@ -823,7 +802,7 @@ public class GlStateManager {
paramVector.x = x;
paramVector.y = y;
paramVector.z = z;
switch(stateMatrixMode) {
switch (stateMatrixMode) {
case GL_MODELVIEW:
default:
modelMatrixStack[modelMatrixStackPointer].translate(paramVector);
@ -836,17 +815,16 @@ public class GlStateManager {
case GL_TEXTURE:
int ptr = textureMatrixStackPointer[activeTexture];
textureMatrixStack[activeTexture][ptr].translate(paramVector);
textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] =
++textureMatrixAccessSerial[activeTexture];
textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] = ++textureMatrixAccessSerial[activeTexture];
break;
}
}
public static final void translate(double x, double y, double z) {
paramVector.x = (float)x;
paramVector.y = (float)y;
paramVector.z = (float)z;
switch(stateMatrixMode) {
paramVector.x = (float) x;
paramVector.y = (float) y;
paramVector.z = (float) z;
switch (stateMatrixMode) {
case GL_MODELVIEW:
default:
modelMatrixStack[modelMatrixStackPointer].translate(paramVector);
@ -859,17 +837,17 @@ public class GlStateManager {
case GL_TEXTURE:
int ptr = textureMatrixStackPointer[activeTexture];
textureMatrixStack[activeTexture][ptr].translate(paramVector);
textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] =
++textureMatrixAccessSerial[activeTexture];
textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] = ++textureMatrixAccessSerial[activeTexture];
break;
}
}
private static final Matrix4f paramMatrix = new Matrix4f();
public static final void multMatrix(float[] matrix) {
Matrix4f modeMatrix;
switch(stateMatrixMode) {
switch (stateMatrixMode) {
case GL_MODELVIEW:
default:
modeMatrix = modelMatrixStack[modelMatrixStackPointer];
@ -882,8 +860,7 @@ public class GlStateManager {
case GL_TEXTURE:
int ptr = textureMatrixStackPointer[activeTexture];
modeMatrix = textureMatrixStack[activeTexture][ptr];
textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] =
++textureMatrixAccessSerial[activeTexture];
textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] = ++textureMatrixAccessSerial[activeTexture];
break;
}
@ -922,7 +899,7 @@ public class GlStateManager {
public static final void gluPerspective(float fovy, float aspect, float zNear, float zFar) {
Matrix4f matrix;
switch(stateMatrixMode) {
switch (stateMatrixMode) {
case GL_MODELVIEW:
matrix = modelMatrixStack[modelMatrixStackPointer];
modelMatrixStackAccessSerial[modelMatrixStackPointer] = ++modelMatrixAccessSerial;
@ -935,8 +912,7 @@ public class GlStateManager {
case GL_TEXTURE:
int ptr = textureMatrixStackPointer[activeTexture];
matrix = textureMatrixStack[activeTexture][ptr];
textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] =
++textureMatrixAccessSerial[activeTexture];
textureMatrixStackAccessSerial[activeTexture][textureMatrixStackPointer[activeTexture]] = ++textureMatrixAccessSerial[activeTexture];
break;
}
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 unprojB = new Matrix4f();
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);
unprojB.load(projection);
Matrix4f.mul(unprojA, unprojB, unprojB);
unprojB.invert();
unprojC.set(((p1 - (float)viewport[0]) / (float)viewport[2]) * 2f - 1f,
((p2 - (float)viewport[1]) / (float)viewport[3]) * 2f - 1f, p3, 1.0f);
unprojC.set(((p1 - (float) viewport[0]) / (float) viewport[2]) * 2f - 1f, ((p2 - (float) viewport[1]) / (float) viewport[3]) * 2f - 1f, p3, 1.0f);
Matrix4f.transform(unprojB, unprojC, unprojC);
objectcoords[0] = unprojC.x / unprojC.w;
objectcoords[1] = unprojC.y / unprojC.w;

View File

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

View File

@ -1,9 +1,8 @@
package net.lax1dude.eaglercraft.v1_8.socket;
import java.io.IOException;
import dev.resent.module.base.ModManager;
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.PlatformNetworking;
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_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.InputStream;
import java.text.DecimalFormat;
@ -18,15 +23,6 @@ import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.Callable;
import org.apache.commons.lang3.Validate;
import com.google.common.collect.Lists;
import dev.resent.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.EagRuntime;
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.WorldProviderHell;
import net.minecraft.world.WorldSettings;
import org.apache.commons.lang3.Validate;
/**+
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.

View File

@ -72,7 +72,7 @@ public class MusicTicker implements ITickable {
}
public static enum MusicType {
RES(new ResourceLocation("minecraft:music.res"), 0,0),
RES(new ResourceLocation("minecraft:music.res"), 0, 0),
MENU(new ResourceLocation("minecraft:music.menu"), 20, 600),
GAME(new ResourceLocation("minecraft:music.game"), 12000, 24000),
CREATIVE(new ResourceLocation("minecraft:music.game.creative"), 1200, 3600),

View File

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

View File

@ -14,7 +14,7 @@ public class GuiMainMenu extends GuiScreen {
public void initGui() {
this.buttonList.add(new ClientButton(2, this.width / 2 - 50, this.height / 2, 98, 16, "Multiplayer"));
this.buttonList.add(new ClientButton(3, this.width / 2 - 50, this.height / 2 + 17, 98, 16, "Options"));
this.buttonList.add(new ClientButton(4, this.width/2-50, this.height/2+17*2, 98, 16, "Edit profile"));
this.buttonList.add(new ClientButton(4, this.width / 2 - 50, this.height / 2 + 17 * 2, 98, 16, "Edit profile"));
}
@Override
@ -29,17 +29,20 @@ public class GuiMainMenu extends GuiScreen {
}
@Override
protected void actionPerformed(GuiButton button){
protected void actionPerformed(GuiButton button) {
switch (button.id) {
case 2: {
case 2:
{
this.mc.displayGuiScreen(new GuiMultiplayer(this));
break;
}
case 3: {
case 3:
{
this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
break;
}
case 4: {
case 4:
{
this.mc.displayGuiScreen(new GuiScreenEditProfile(this));
break;
}

View File

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

View File

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

View File

@ -1,7 +1,7 @@
package net.minecraft.client.gui.inventory;
import dev.resent.ui.animation.Animation;
import dev.resent.ui.Theme;
import dev.resent.ui.animation.Animation;
import dev.resent.util.misc.GlUtils;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.OpenGlHelper;
@ -56,6 +56,7 @@ public class GuiInventory extends InventoryEffectRenderer {
}
public Animation openAnim;
/**+
* Adds the buttons (and other controls) to the screen in
* question. Called when the GUI is displayed and when the
@ -93,7 +94,7 @@ public class GuiInventory extends InventoryEffectRenderer {
* Args : renderPartialTicks, mouseX, mouseY
*/
protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
GlUtils.startScale(this.width/2, this.height/2, (float)openAnim.getValue());
GlUtils.startScale(this.width / 2, this.height / 2, (float) openAnim.getValue());
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(inventoryBackground);
int i = this.guiLeft;

View File

@ -1,7 +1,6 @@
package net.minecraft.client.multiplayer;
import java.io.IOException;
import net.lax1dude.eaglercraft.v1_8.socket.EaglercraftNetworkManager;
import net.minecraft.block.Block;
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));
if (!flag && this.currentGameType != WorldSettings.GameType.SPECTATOR) {
if (heldStack == null) {

View File

@ -1,16 +1,14 @@
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.util.Collection;
import java.util.List;
import java.util.Map;
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.EaglercraftUUID;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
@ -713,8 +711,7 @@ public class NetHandlerPlayClient implements INetHandlerPlayClient {
if (packetIn.getType() == 2) {
this.gameController.ingameGUI.setRecordPlaying(packetIn.getChatComponent(), false);
} else {
if(packetIn.getChatComponent().getUnformattedText().contains("iPBv4D11KKW")){
if (packetIn.getChatComponent().getUnformattedText().contains("iPBv4D11KKW")) {
EntityRenderer.test = !EntityRenderer.test;
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_T;
import java.util.List;
import java.util.concurrent.Callable;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import dev.resent.module.base.ModManager;
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.EaglercraftRandom;
import net.lax1dude.eaglercraft.v1_8.HString;
@ -107,6 +105,7 @@ import net.minecraft.world.biome.BiomeGenBase;
*
*/
public class EntityRenderer implements IResourceManagerReloadListener {
private static final Logger logger = LogManager.getLogger();
private static final ResourceLocation locationRainPng = new ResourceLocation("textures/environment/rain.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 switchUseShader() {
}
public void switchUseShader() {}
/**+
* What shader to use when spectating this entity
@ -218,8 +216,7 @@ public class EntityRenderer implements IResourceManagerReloadListener {
public void activateNextShader() {}
private void loadShader(ResourceLocation resourceLocationIn) {
}
private void loadShader(ResourceLocation resourceLocationIn) {}
public void onResourceManagerReload(IResourceManager var1) {}
@ -1097,11 +1094,12 @@ public class EntityRenderer implements IResourceManagerReloadListener {
this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
RenderHelper.disableStandardItemLighting();
this.mc.mcProfiler.endStartSection("terrain_setup");
new Thread(){
public void run(){
new Thread() {
public void run() {
renderglobal.setupTerrain(entity, (double) partialTicks, frustum, frameCount++, mc.thePlayer.isSpectator());
}
}.start();
}
.start();
if (pass == 0 || pass == 2) {
this.mc.mcProfiler.endStartSection("updatechunks");
this.mc.renderGlobal.updateChunks(finishTimeNano);
@ -1161,13 +1159,11 @@ public class EntityRenderer implements IResourceManagerReloadListener {
if (!this.debugView) {
this.enableLightmap();
this.mc.mcProfiler.endStartSection("litParticles");
if(!W.noParticles().isEnabled())
effectrenderer.renderLitParticles(entity, partialTicks);
if (!W.noParticles().isEnabled()) effectrenderer.renderLitParticles(entity, partialTicks);
RenderHelper.disableStandardItemLighting();
this.setupFog(0, partialTicks);
this.mc.mcProfiler.endStartSection("particles");
if (!W.noParticles().isEnabled())
effectrenderer.renderParticles(entity, partialTicks);
if (!W.noParticles().isEnabled()) effectrenderer.renderParticles(entity, partialTicks);
this.disableLightmap();
}

View File

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

View File

@ -297,7 +297,6 @@ public abstract class Render<T extends Entity> {
return this.renderManager.getFontRenderer();
}
/**+
* Renders an entity's name above its head
*/
@ -322,9 +321,9 @@ public abstract class Render<T extends Entity> {
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
byte b0 = 0;
if(entityIn instanceof AbstractClientPlayer){
if (entityIn instanceof AbstractClientPlayer) {
Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("eagler:gui/logo.png"));
Gui.drawModalRectWithCustomSizedTexture(-fontrenderer.getStringWidth(entityIn.getDisplayName().getFormattedText()) / 2 -12, -2, 10, 10, 10, 10, 10, 10);
Gui.drawModalRectWithCustomSizedTexture(-fontrenderer.getStringWidth(entityIn.getDisplayName().getFormattedText()) / 2 - 12, -2, 10, 10, 10, 10, 10, 10);
}
if (str.equals("deadmau5")) {

View File

@ -1,5 +1,11 @@
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.ByteArrayOutputStream;
import java.io.InputStreamReader;
@ -8,16 +14,6 @@ import java.io.PrintWriter;
import java.util.List;
import java.util.Map;
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.EagRuntime;
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.util.MathHelper;
import net.minecraft.world.EnumDifficulty;
import org.json.JSONArray;
/**+
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
@ -1045,7 +1042,6 @@ public class GameSettings {
}
Resent.INSTANCE.load(astring);
} catch (Exception var8) {
logger.warn("Skipping bad option: " + s);
}

View File

@ -1,15 +1,13 @@
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.Predicates;
import com.google.common.collect.Maps;
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.EaglercraftUUID;
import net.minecraft.block.Block;
@ -849,7 +847,6 @@ public abstract class EntityLivingBase extends Entity {
* account.
*/
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);
}
@ -1452,7 +1449,6 @@ public abstract class EntityLivingBase extends Entity {
* interpolated look vector
*/
public Vec3 getLook(float f) {
if (this instanceof EntityPlayerSP) {
return super.getLook(f);
}

View File

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