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,79 +32,114 @@ public class Resent {
Resent.INSTANCE.modManager = new ModManager();
}
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);
}
m.settings.stream().forEach(s -> {
if (s instanceof ModeSetting) {
printwriter.println(m.getName() + "_modesetting_" + s.name + ":" + ((ModeSetting) s).getValue());
}
if (s instanceof BooleanSetting) {
printwriter.println(m.getName() + "_boolsetting_" + s.name + ":" + ((BooleanSetting) s).getValue());
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);
}
m.settings
.stream()
.forEach(s -> {
if (s instanceof ModeSetting) {
printwriter.println(m.getName() + "_modesetting_" + s.name + ":" + ((ModeSetting) s).getValue());
}
if (s instanceof BooleanSetting) {
printwriter.println(m.getName() + "_boolsetting_" + s.name + ":" + ((BooleanSetting) s).getValue());
}
});
});
});
}
public void load(String[] astring){
public void load(String[] astring) {
Resent.INSTANCE.modManager.modules
.stream()
.forEach(m -> {
if (astring[0].equals(m.getName())) {
m.setEnabled(astring[1].equals("true"));
}
Resent.INSTANCE.modManager.modules.stream().forEach(m -> {
if (astring[0].equals(m.getName())) {
m.setEnabled(astring[1].equals("true"));
}
if(m instanceof RenderMod){
if (astring[0].equals(m.getName() + "_x")) {
((RenderMod)m).setX(Integer.parseInt(astring[1]));
}
if (astring[0].equals(m.getName() + "_y")) {
((RenderMod)m).setY(Integer.parseInt(astring[1]));
}
if (astring[0].equals(m.getName() + "_lastx")) {
((RenderMod)m).lastX = Integer.parseInt(astring[1]);
}
if (astring[0].equals(m.getName() + "_lasty")) {
((RenderMod)m).lastY = Integer.parseInt(astring[1]);
}
}
m.settings.stream().forEach(se ->{
if (se instanceof ModeSetting) {
if (astring[0].equals(m.getName() + "_modesetting_" + se.name)) {
((ModeSetting) se).setValue(astring[1]);
}
}
if (se instanceof BooleanSetting) {
if (astring[0].equals(m.getName() + "_boolsetting_" + se.name)) {
((BooleanSetting) se).setValue(astring[1].equals("true"));
if (m instanceof RenderMod) {
if (astring[0].equals(m.getName() + "_x")) {
((RenderMod) m).setX(Integer.parseInt(astring[1]));
}
if (astring[0].equals(m.getName() + "_y")) {
((RenderMod) m).setY(Integer.parseInt(astring[1]));
}
if (astring[0].equals(m.getName() + "_lastx")) {
((RenderMod) m).lastX = Integer.parseInt(astring[1]);
}
if (astring[0].equals(m.getName() + "_lasty")) {
((RenderMod) m).lastY = Integer.parseInt(astring[1]);
}
}
m.settings
.stream()
.forEach(se -> {
if (se instanceof ModeSetting) {
if (astring[0].equals(m.getName() + "_modesetting_" + se.name)) {
((ModeSetting) se).setValue(astring[1]);
}
}
if (se instanceof BooleanSetting) {
if (astring[0].equals(m.getName() + "_boolsetting_" + se.name)) {
((BooleanSetting) se).setValue(astring[1].equals("true"));
}
}
});
});
});
}
//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[] getCrystalWingsColor(AbstractClientPlayer player){ return new float[]{1, 1, 1}; }
public static float[] getDragonWingsColor = new float[]{1f,1f,1f,1f};
public static float[] getTopHatColor(AbstractClientPlayer player) {
return new float[] { 1, 0, 0 };
}
public static boolean shouldRender(AbstractClientPlayer player){
switch(Cosmetics.who.getValue()){
public static float[] getCrystalWingsColor(AbstractClientPlayer player) {
return new float[] { 1, 1, 1 };
}
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;
return player == Minecraft.getMinecraft().thePlayer;
case "Everyone":
return true;
return true;
case "Everyone else":
return player != Minecraft.getMinecraft().thePlayer;
return player != Minecraft.getMinecraft().thePlayer;
}
return false;
}
}

View File

@ -13,94 +13,93 @@ import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
public class CrystalWings extends CosmeticBase {
private CrytsalWingsModel crytsalWingsModel;
public CrystalWings(RenderPlayer playerRenderer) {
super(playerRenderer);
this.crytsalWingsModel = new CrytsalWingsModel(playerRenderer);
}
@Override
public void render(AbstractClientPlayer player, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
if(CosmeticController.renderCrystalWings(player)){
GlStateManager.pushMatrix();
float[] color = CosmeticController.getCrystalWingsColor(player);
GlStateManager.color(color[0], color[1], color[2]);
this.crytsalWingsModel.render(player, limbSwing, limbSwingAmount, ageInTicks, headPitch, headPitch, scale);
GlStateManager.color(1, 1, 1);
GlStateManager.popMatrix();
}
}
public class CrytsalWingsModel extends CosmeticModelBase {
private ModelRenderer model;
ResourceLocation resourceLocation = new ResourceLocation("eagler:gui/crystal.png");
public CrytsalWingsModel(RenderPlayer player) {
super(player);
int i = 30;
int j = 24;
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.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);
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;
ModelRenderer modelrenderer = (ModelRenderer) this.model.childModels.get(0);
ModelRenderer modelrenderer1 = (ModelRenderer) modelrenderer.childModels.get(0);
this.model.rotateAngleZ = f * 3.0F;
modelrenderer.rotateAngleZ = f / 2.0F;
modelrenderer1.rotateAngleZ = f / 2.0F;
this.model.rotateAngleY = -0.3F - walkingSpeed / 3.0F;
this.model.rotateAngleX = 0.3F;
GlStateManager.pushMatrix();
GlStateManager.scale(1.6D, 1.6D, 1.0D);
GlStateManager.translate(0.0D, 0.05000000074505806D, 0.05000000074505806D);
if (entityIn.isSneaking()) {
GlStateManager.translate(0.0D, 0.07999999821186066D, 0.029999999329447746D);
GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
this.model.rotateAngleZ = 0.8F;
modelrenderer.rotateAngleZ = 0.0F;
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);
}
this.model.isHidden = false;
for (int i = -1; i <= 1; i += 2) {
GlStateManager.pushMatrix();
GlStateManager.depthMask(false);
GlStateManager.enableBlend();
GlStateManager.blendFunc(770, 771);
GlStateManager.alphaFunc(516, 0.003921569F);
GlStateManager.disableLighting();
Minecraft.getMinecraft().getTextureManager().bindTexture(this.resourceLocation);
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);
}
this.model.isHidden = true;
GlStateManager.popMatrix();
private CrytsalWingsModel crytsalWingsModel;
public CrystalWings(RenderPlayer playerRenderer) {
super(playerRenderer);
this.crytsalWingsModel = new CrytsalWingsModel(playerRenderer);
}
}
}
@Override
public void render(AbstractClientPlayer player, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
if (CosmeticController.renderCrystalWings(player)) {
GlStateManager.pushMatrix();
float[] color = CosmeticController.getCrystalWingsColor(player);
GlStateManager.color(color[0], color[1], color[2]);
this.crytsalWingsModel.render(player, limbSwing, limbSwingAmount, ageInTicks, headPitch, headPitch, scale);
GlStateManager.color(1, 1, 1);
GlStateManager.popMatrix();
}
}
public class CrytsalWingsModel extends CosmeticModelBase {
private ModelRenderer model;
ResourceLocation resourceLocation = new ResourceLocation("eagler:gui/crystal.png");
public CrytsalWingsModel(RenderPlayer player) {
super(player);
int i = 30;
int j = 24;
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.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);
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;
ModelRenderer modelrenderer = (ModelRenderer) this.model.childModels.get(0);
ModelRenderer modelrenderer1 = (ModelRenderer) modelrenderer.childModels.get(0);
this.model.rotateAngleZ = f * 3.0F;
modelrenderer.rotateAngleZ = f / 2.0F;
modelrenderer1.rotateAngleZ = f / 2.0F;
this.model.rotateAngleY = -0.3F - walkingSpeed / 3.0F;
this.model.rotateAngleX = 0.3F;
GlStateManager.pushMatrix();
GlStateManager.scale(1.6D, 1.6D, 1.0D);
GlStateManager.translate(0.0D, 0.05000000074505806D, 0.05000000074505806D);
if (entityIn.isSneaking()) {
GlStateManager.translate(0.0D, 0.07999999821186066D, 0.029999999329447746D);
GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
this.model.rotateAngleZ = 0.8F;
modelrenderer.rotateAngleZ = 0.0F;
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);
}
this.model.isHidden = false;
for (int i = -1; i <= 1; i += 2) {
GlStateManager.pushMatrix();
GlStateManager.depthMask(false);
GlStateManager.enableBlend();
GlStateManager.blendFunc(770, 771);
GlStateManager.alphaFunc(516, 0.003921569F);
GlStateManager.disableLighting();
Minecraft.getMinecraft().getTextureManager().bindTexture(this.resourceLocation);
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);
}
this.model.isHidden = true;
GlStateManager.popMatrix();
}
}
}

View File

@ -9,122 +9,122 @@ 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) {
super(renderPlayer);
this.glassesModel = new GlassesRenderer(renderPlayer);
}
@Override
public void render(AbstractClientPlayer player, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float headYaw, float headPitch, float scale) {
if(CosmeticController.renderGlasses(player)){
GlStateManager.pushMatrix();
if(player.isSneaking()) {
GlStateManager.translate(0, 0.225, 0);
private final GlassesRenderer glassesModel;
public Glasses(RenderPlayer renderPlayer) {
super(renderPlayer);
this.glassesModel = new GlassesRenderer(renderPlayer);
}
GlStateManager.rotate(headYaw, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(headPitch, 1.0F, 0.0F, 0.0F);
this.glassesModel.render(player, limbSwing, limbSwingAmount, ageInTicks, headYaw, headPitch, scale);
GlStateManager.popMatrix();
}
}
public class GlassesRenderer extends CosmeticModelBase{
ModelRenderer Glasses1;
ModelRenderer Glasses2;
ModelRenderer Glasses3;
ModelRenderer Glasses4;
ModelRenderer Glasses5;
ModelRenderer Glasses6;
ModelRenderer Glasses7;
ModelRenderer Glasses8;
ModelRenderer Glasses9;
public GlassesRenderer(RenderPlayer player) {
super(player);
textureWidth = 64;
textureHeight = 32;
Glasses1 = new ModelRenderer(this, 0, 0);
Glasses1.addBox(0F, 0F, 0F, 4, 2, 1);
Glasses1.setRotationPoint(-5F, -3F, -5F);
Glasses1.setTextureSize(64, 32);
Glasses1.mirror = true;
setRotation(Glasses1, 0F, 0F, 0F);
Glasses2 = new ModelRenderer(this, 0, 0);
Glasses2.addBox(0F, 0F, 0F, 10, 1, 1);
Glasses2.setRotationPoint(-5F, -3F, -5F);
Glasses2.setTextureSize(64, 32);
Glasses2.mirror = true;
setRotation(Glasses2, 0F, 0F, 0F);
Glasses3 = new ModelRenderer(this, 0, 0);
Glasses3.addBox(0F, 0F, 0F, 4, 2, 1);
Glasses3.setRotationPoint(1F, -3F, -5F);
Glasses3.setTextureSize(64, 32);
Glasses3.mirror = true;
setRotation(Glasses3, 0F, 0F, 0F);
Glasses4 = new ModelRenderer(this, 0, 0);
Glasses4.addBox(-3F, 0F, -2F, 1, 1, 6);
Glasses4.setRotationPoint(-2F, -3F, -3F);
Glasses4.setTextureSize(64, 32);
Glasses4.mirror = true;
setRotation(Glasses4, 0F, 0F, 0F);
Glasses5 = new ModelRenderer(this, 0, 0);
Glasses5.addBox(0F, 0F, 0F, 1, 1, 6);
Glasses5.setRotationPoint(4F, -3F, -5F);
Glasses5.setTextureSize(64, 32);
Glasses5.mirror = true;
setRotation(Glasses5, 0F, 0F, 0F);
Glasses6 = new ModelRenderer(this, 0, 0);
Glasses6.addBox(0F, 0F, 0F, 1, 1, 1);
Glasses6.setRotationPoint(4F, -2F, 1F);
Glasses6.setTextureSize(64, 32);
Glasses6.mirror = true;
setRotation(Glasses6, 0F, 0F, 0F);
Glasses7 = new ModelRenderer(this, 0, 0);
Glasses7.addBox(0F, 0F, 0F, 1, 1, 1);
Glasses7.setRotationPoint(-5F, -2F, 1F);
Glasses7.setTextureSize(64, 32);
Glasses7.mirror = true;
setRotation(Glasses7, 0F, 0F, 0F);
Glasses8 = new ModelRenderer(this, 0, 0);
Glasses8.addBox(0F, 0F, 0F, 4, 2, 1);
Glasses8.setRotationPoint(-5F, -3F, -5F);
Glasses8.setTextureSize(64, 32);
Glasses8.mirror = true;
setRotation(Glasses8, 0F, 0F, 0F);
Glasses9 = new ModelRenderer(this, 0, 0);
Glasses9.addBox(1F, -3F, -5F, 4, 2, 1);
Glasses9.setRotationPoint(0F, 0F, 0F);
Glasses9.setTextureSize(64, 32);
Glasses9.mirror = true;
setRotation(Glasses9, 0F, 0F, 0F);
@Override
public void render(AbstractClientPlayer player, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float headYaw, float headPitch, float scale) {
if (CosmeticController.renderGlasses(player)) {
GlStateManager.pushMatrix();
if (player.isSneaking()) {
GlStateManager.translate(0, 0.225, 0);
}
GlStateManager.rotate(headYaw, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(headPitch, 1.0F, 0.0F, 0.0F);
this.glassesModel.render(player, limbSwing, limbSwingAmount, ageInTicks, headYaw, headPitch, scale);
GlStateManager.popMatrix();
}
}
public void render(Entity entityIn, float limbSwing, float limbSwingAmout, float ageInTicks, float headYaw, float headPitch, float scale) {
GlStateManager.pushMatrix();
GlStateManager.translate(0, -0.1, -0.05);
GlStateManager.color(0, 0, 0);
Glasses1.render(scale);
Glasses2.render(scale);
Glasses3.render(scale);
Glasses4.render(scale);
Glasses5.render(scale);
Glasses6.render(scale);
Glasses7.render(scale);
Glasses8.render(scale);
Glasses9.render(scale);
GlStateManager.color(1, 1, 1);
GlStateManager.popMatrix();
}
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
public class GlassesRenderer extends CosmeticModelBase {
ModelRenderer Glasses1;
ModelRenderer Glasses2;
ModelRenderer Glasses3;
ModelRenderer Glasses4;
ModelRenderer Glasses5;
ModelRenderer Glasses6;
ModelRenderer Glasses7;
ModelRenderer Glasses8;
ModelRenderer Glasses9;
public GlassesRenderer(RenderPlayer player) {
super(player);
textureWidth = 64;
textureHeight = 32;
Glasses1 = new ModelRenderer(this, 0, 0);
Glasses1.addBox(0F, 0F, 0F, 4, 2, 1);
Glasses1.setRotationPoint(-5F, -3F, -5F);
Glasses1.setTextureSize(64, 32);
Glasses1.mirror = true;
setRotation(Glasses1, 0F, 0F, 0F);
Glasses2 = new ModelRenderer(this, 0, 0);
Glasses2.addBox(0F, 0F, 0F, 10, 1, 1);
Glasses2.setRotationPoint(-5F, -3F, -5F);
Glasses2.setTextureSize(64, 32);
Glasses2.mirror = true;
setRotation(Glasses2, 0F, 0F, 0F);
Glasses3 = new ModelRenderer(this, 0, 0);
Glasses3.addBox(0F, 0F, 0F, 4, 2, 1);
Glasses3.setRotationPoint(1F, -3F, -5F);
Glasses3.setTextureSize(64, 32);
Glasses3.mirror = true;
setRotation(Glasses3, 0F, 0F, 0F);
Glasses4 = new ModelRenderer(this, 0, 0);
Glasses4.addBox(-3F, 0F, -2F, 1, 1, 6);
Glasses4.setRotationPoint(-2F, -3F, -3F);
Glasses4.setTextureSize(64, 32);
Glasses4.mirror = true;
setRotation(Glasses4, 0F, 0F, 0F);
Glasses5 = new ModelRenderer(this, 0, 0);
Glasses5.addBox(0F, 0F, 0F, 1, 1, 6);
Glasses5.setRotationPoint(4F, -3F, -5F);
Glasses5.setTextureSize(64, 32);
Glasses5.mirror = true;
setRotation(Glasses5, 0F, 0F, 0F);
Glasses6 = new ModelRenderer(this, 0, 0);
Glasses6.addBox(0F, 0F, 0F, 1, 1, 1);
Glasses6.setRotationPoint(4F, -2F, 1F);
Glasses6.setTextureSize(64, 32);
Glasses6.mirror = true;
setRotation(Glasses6, 0F, 0F, 0F);
Glasses7 = new ModelRenderer(this, 0, 0);
Glasses7.addBox(0F, 0F, 0F, 1, 1, 1);
Glasses7.setRotationPoint(-5F, -2F, 1F);
Glasses7.setTextureSize(64, 32);
Glasses7.mirror = true;
setRotation(Glasses7, 0F, 0F, 0F);
Glasses8 = new ModelRenderer(this, 0, 0);
Glasses8.addBox(0F, 0F, 0F, 4, 2, 1);
Glasses8.setRotationPoint(-5F, -3F, -5F);
Glasses8.setTextureSize(64, 32);
Glasses8.mirror = true;
setRotation(Glasses8, 0F, 0F, 0F);
Glasses9 = new ModelRenderer(this, 0, 0);
Glasses9.addBox(1F, -3F, -5F, 4, 2, 1);
Glasses9.setRotationPoint(0F, 0F, 0F);
Glasses9.setTextureSize(64, 32);
Glasses9.mirror = true;
setRotation(Glasses9, 0F, 0F, 0F);
}
public void render(Entity entityIn, float limbSwing, float limbSwingAmout, float ageInTicks, float headYaw, float headPitch, float scale) {
GlStateManager.pushMatrix();
GlStateManager.translate(0, -0.1, -0.05);
GlStateManager.color(0, 0, 0);
Glasses1.render(scale);
Glasses2.render(scale);
Glasses3.render(scale);
Glasses4.render(scale);
Glasses5.render(scale);
Glasses6.render(scale);
Glasses7.render(scale);
Glasses8.render(scale);
Glasses9.render(scale);
GlStateManager.color(1, 1, 1);
GlStateManager.popMatrix();
}
}
}
private void setRotation(ModelRenderer model, float x, float y, float z) {
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}

View File

@ -12,46 +12,47 @@ import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
public class Halo extends CosmeticBase {
private final ModelHalo modelHalo;
private static final ResourceLocation HALOBLUE;
static {
HALOBLUE = new ResourceLocation("eagler:gui/blue.jpeg");
}
public Halo(final RenderPlayer renderPlayer) {
super(renderPlayer);
this.modelHalo = new ModelHalo(renderPlayer);
}
@Override
public void render(final AbstractClientPlayer player, final float limbSwing, final float limbSwingAmount, final float partialTicks, final float ageInTicks, final float headYaw, final float headPitch, final float scale) {
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);
this.modelHalo.render(player, limbSwing, limbSwingAmount, ageInTicks, headYaw, headPitch, scale);
GlStateManager.popMatrix();
}
}
private class ModelHalo extends CosmeticModelBase
{
private class ModelHalo extends CosmeticModelBase {
private ModelRenderer halo;
public ModelHalo(final RenderPlayer player) {
super(player);
(this.halo = new ModelRenderer(this.playerModel).setTextureSize(14, 2)).addBox(-3.0f, -12.5f, -4.0f, 6, 1, 1, 0.15f);
this.halo.isHidden = true;
}
@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,28 +9,27 @@ 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);
}
float[] color = CosmeticController.getTopHatColor(player);
float[] color = CosmeticController.getTopHatColor(player);
GlStateManager.color(color[0], color[1], color[2]);
modelTopHat.render(player, limbSwing, limbSwingAmount, ageInTicks, HeadYaw, headPitch, scale);
GlStateManager.color(1, 1, 1);
@ -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,48 +42,66 @@ 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);
}
return x;
}
public enum Category {
HUD("Hud"),
MISC("Misc");
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;
@ -39,7 +39,7 @@ public abstract class RenderMod extends Mod {
this.y = 0;
dragging = false;
}
draw();
if (this.dragging) {
@ -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,44 +9,44 @@ 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();
private Minecraft mc = Minecraft.getMinecraft();
public KeyStrokes(){
addSetting(sneak, jump, color, colorp, gcolor, gcolorp);
public KeyStrokes() {
addSetting(sneak, jump, color, colorp, gcolor, gcolorp);
}
public BooleanSetting sneak = new BooleanSetting("Sneak", "", false);
public BooleanSetting jump = new BooleanSetting("Jump", "", true);
public BooleanSetting tshadow = new BooleanSetting("Text shadow", "", false);
public ModeSetting color = new ModeSetting("Unpressed text color", "", "White", "Red", "Yellow", "Green", "Blue", "Pink", "Orange", "Black");
public ModeSetting colorp = new ModeSetting("Pressed text color", "", "Black", "Red", "Yellow", "Green", "Blue", "Pink", "Orange", "White");
public ModeSetting gcolor = new ModeSetting("Pressed button color", "", "White", "Red", "Yellow", "Green", "Blue", "Pink", "Orange", "Black");
public ModeSetting gcolorp = new ModeSetting("Unpressed button color", "", "Black", "Red", "Yellow", "Green", "Blue", "Pink", "Orange", "White");
public List<Long> clicks = new ArrayList<>();
public BooleanSetting sneak = new BooleanSetting("Sneak", "", false);
public BooleanSetting jump = new BooleanSetting("Jump", "", true);
public BooleanSetting tshadow = new BooleanSetting("Text shadow", "", false);
public ModeSetting color = new ModeSetting("Unpressed text color", "", "White", "Red", "Yellow", "Green", "Blue", "Pink", "Orange", "Black");
public ModeSetting colorp = new ModeSetting("Pressed text color", "", "Black", "Red", "Yellow", "Green", "Blue", "Pink", "Orange", "White");
public ModeSetting gcolor = new ModeSetting("Pressed button color", "", "White", "Red", "Yellow", "Green", "Blue", "Pink", "Orange", "Black");
public ModeSetting gcolorp = new ModeSetting("Unpressed button color", "", "Black", "Red", "Yellow", "Green", "Blue", "Pink", "Orange", "White");
public List<Long> clicks = new ArrayList<>();
public boolean wasPressed;
public long lastPressed;
private List<Long> clicks2 = new ArrayList<>();
public boolean wasPressed2;
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;
return 1.0f;
}
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;
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();
}
@ -60,84 +57,67 @@ public class KeyStrokes extends RenderMod{
return this.clicks2.size();
}
//public static SimpleAnimation wOpacityAnimation = new SimpleAnimation(0), aOpacityAnimation = new SimpleAnimation(0), dOpacityAnimation = new SimpleAnimation(0), sOpacityAnimation = new SimpleAnimation(0), jumpOpacityAnimation = new SimpleAnimation(0);
//public static SimpleAnimation wOpacityAnimation = new SimpleAnimation(0), aOpacityAnimation = new SimpleAnimation(0), dOpacityAnimation = new SimpleAnimation(0), sOpacityAnimation = new SimpleAnimation(0), jumpOpacityAnimation = new SimpleAnimation(0);
@Override
public void draw() {
boolean pressed = mc.gameSettings.keyBindAttack.pressed;
public void draw() {
boolean pressed = mc.gameSettings.keyBindAttack.pressed;
boolean rpressed = mc.gameSettings.keyBindUseItem.pressed;
boolean wKey = mc.gameSettings.keyBindForward.pressed;
boolean aKey = mc.gameSettings.keyBindLeft.pressed;
boolean dKey = mc.gameSettings.keyBindRight.pressed;
boolean sKey = mc.gameSettings.keyBindBack.pressed;
boolean jumpKey = mc.gameSettings.keyBindJump.pressed;
boolean wKey = mc.gameSettings.keyBindForward.pressed;
boolean aKey = mc.gameSettings.keyBindLeft.pressed;
boolean dKey = mc.gameSettings.keyBindRight.pressed;
boolean sKey = mc.gameSettings.keyBindBack.pressed;
boolean jumpKey = mc.gameSettings.keyBindJump.pressed;
// wOpacityAnimation.setAnimation(wKey ? 0.8f*255 : 0, 14);
// aOpacityAnimation.setAnimation(aKey ? 0.8f*255 : 0, 14);
// dOpacityAnimation.setAnimation(dKey ? 0.8f*255 : 0, 14);
// sOpacityAnimation.setAnimation(sKey ? 0.8f*255 : 0, 14);
// jumpOpacityAnimation.setAnimation(jumpKey ? 0.8f*255 : 0, 14);
// wOpacityAnimation.setAnimation(wKey ? 0.8f*255 : 0, 14);
// aOpacityAnimation.setAnimation(aKey ? 0.8f*255 : 0, 14);
// dOpacityAnimation.setAnimation(dKey ? 0.8f*255 : 0, 14);
// sOpacityAnimation.setAnimation(sKey ? 0.8f*255 : 0, 14);
// jumpOpacityAnimation.setAnimation(jumpKey ? 0.8f*255 : 0, 14);
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());
// S
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());
// 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());
// LMB
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());
//W
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());
// A
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());
// LMB
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());
// 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());
// 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());
// 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());
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));
}
// 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());
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);
@ -49,7 +47,7 @@ public class PotionHUD extends RenderMod {
int i3 = potion.getStatusIconIndex();
GuiIngame guiIngame = new GuiIngame(mc);
guiIngame.drawTexturedModalRect(getX() + 21 - 20, getY() + i2 - 14, 0 + i3 % 8 * 18, 198 + i3 / 8 * 18, 18, 18);
}
}
String s1 = I18n.format(potion.getName(), new Object[0]);
if (potioneffect.getAmplifier() == 1) {
s1 = String.valueOf(String.valueOf(s1)) + " " + I18n.format("enchantment.level.2", new Object[0]);
@ -57,13 +55,13 @@ public class PotionHUD extends RenderMod {
s1 = String.valueOf(String.valueOf(s1)) + " " + I18n.format("enchantment.level.3", new Object[0]);
} else if (potioneffect.getAmplifier() == 3) {
s1 = String.valueOf(String.valueOf(s1)) + " " + I18n.format("enchantment.level.4", new Object[0]);
}
}
drawString(s1, (getX() + 21), (getY() + i2 - 14), 16777215, true);
String s2 = Potion.getDurationString(potioneffect);
drawString(s2, (getX() + 21), (getY() + i2 + 10 - 14), 8355711, true);
i2 += l;
}
}
}
}
super.draw();
}
}

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) {
introAnimation.setDirection(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());
if (close) {
introAnimation.setDirection(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());
// 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,23 +176,13 @@ 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());
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);
}
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()) {
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);
}
}
if (s instanceof ModeSetting) {
@ -229,7 +216,6 @@ public class ClickGUI extends GuiScreen {
public void onGuiClosed() {
Keyboard.enableRepeatEvents(true);
mc.gameSettings.saveOptions();
}
@Override

View File

@ -5,17 +5,18 @@ 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);
}
@Override
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);
@ -33,7 +32,7 @@ public class PreGUI extends GuiScreen{
@Override
protected void keyTyped(char parChar1, int parInt1) {
if (parInt1 == 0x01 || parInt1 == Minecraft.getMinecraft().gameSettings.keyBindClickGui.keyCode) {
if (parInt1 == 0x01 || parInt1 == Minecraft.getMinecraft().gameSettings.keyBindClickGui.keyCode) {
mc.displayGuiScreen(null);
}
@ -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

@ -3,7 +3,7 @@ package dev.resent.ui.animation;
public abstract class Animation {
public AnimationTimer timer = new AnimationTimer();
protected int duration;
protected double endPoint;
@ -31,7 +31,7 @@ public abstract class Animation {
}
public void reset() {
timer.reset();
timer.reset();
}
public boolean isDone() {
@ -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;
@ -69,21 +68,21 @@ public abstract class Animation {
protected abstract double getEquation(double x);
public double getEndPoint() {
return endPoint;
}
public double getEndPoint() {
return endPoint;
}
public void setEndPoint(double endPoint) {
this.endPoint = endPoint;
}
public void setEndPoint(double endPoint) {
this.endPoint = endPoint;
}
public int getDuration() {
return duration;
}
public int getDuration() {
return duration;
}
public Direction getDirection() {
return direction;
}
public Direction getDirection() {
return direction;
}
}
class AnimationTimer {
@ -114,5 +113,4 @@ class AnimationTimer {
public void setTime(long time) {
lastMS = time;
}
}

View File

@ -1,28 +1,25 @@
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) {
double add = (delta * (speed / 50));
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

@ -1,40 +1,38 @@
package dev.resent.ui.animation;
public class SimpleAnimation {
private float value;
private long lastMS;
public SimpleAnimation(final float value){
this.value = 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) {
speed = 28;
if (speed > 28) {
speed = 28;
}
if (speed != 0.0)
{
deltaValue = Math.abs(value - this.value) * 0.35f / (10.0 / speed);
if (speed != 0.0) {
deltaValue = Math.abs(value - this.value) * 0.35f / (10.0 / speed);
}
this.value = AnimationUtils.calculateCompensation(value, this.value, deltaValue, delta);
}
public float getValue() {
return value;
}
public float getValue() {
return value;
}
public void setValue(float value) {
this.value = value;
}
}
public void setValue(float value) {
this.value = value;
}
}

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

@ -29,4 +29,4 @@ public class ElasticAnimation extends Animation {
double elasticity = easeAmount * .1f;
return Math.pow(2, -10 * (reallyElastic ? Math.sqrt(x1) : x1)) * Math.sin((x1 - (elasticity / 4)) * ((2 * Math.PI) / elasticity)) + 1;
}
}
}

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

@ -5,7 +5,7 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
public class GlUtils {
public static void startScale(float x, float y, float scale) {
GlStateManager.pushMatrix();
GlStateManager.translate(x, y, 0);
@ -13,23 +13,23 @@ public class GlUtils {
GlStateManager.translate(-x, -y, 0);
}
public static void stopScale(){
public static void stopScale() {
GlStateManager.popMatrix();
}
public static void startTranslate(float x, float y) {
GlStateManager.pushMatrix();
GlStateManager.translate(x, y, 0);
}
public static void stopTranslate() {
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.translate(x, y, 0);
}
public static void drawCenteredScaledString(String text, int param1,int param2, int color, float scale){
public static void stopTranslate() {
GlStateManager.popMatrix();
}
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

@ -10,7 +10,7 @@ import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
public class RenderUtils {
public static void drawChromaString(final String string, final int x, final int y, final boolean shadow) {
final Minecraft mc = Minecraft.getMinecraft();
int xTmp = x;
@ -20,40 +20,40 @@ 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));
} else {
break;
}
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));
}
}
}
float i = x;
while (true) {
if (i + 10 <= width) {
Gui.drawRect(i, y, i + 10, height, RenderUtils.astolfoColorsDraw(i, GuiScreen.width, speed * 10000));
} else {
break;
}
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));
}
}
}
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;
hue -= speed;
}
hue /= speed;
if (hue > 0.5) {
hue = 0.5F - (hue - 0.5f);
hue = 0.5F - (hue - 0.5f);
}
hue += 0.5F;
return Color.HSBtoRGB(hue, 0.5f, 1f);
}
}
public static void drawRoundedRect(final float paramInt1, final float paramInt2, final float paramInt3, final float paramInt4, final float radius, final int color, boolean... rounded) {
final float f1 = (color >> 24 & 0xFF) / 255.0f;
@ -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);
}
}
@ -83,7 +83,7 @@ public class RenderUtils {
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
GlStateManager.shadeModel(7425);
worldrenderer.begin(5, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos(paramFloat1 + paramFloat5, paramFloat2, 0).endVertex();
worldrenderer.pos(paramFloat1 + paramFloat5, paramFloat4, 0).endVertex();
worldrenderer.pos(paramFloat3 - paramFloat5, paramFloat2, 0).endVertex();
@ -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);
@ -172,7 +172,7 @@ public class RenderUtils {
Gui.drawRect(width1 - 1, param2, width1, height1, color);
Gui.drawRect(param1, height1 - 1, width1, height1, color);
}
public static int getRainbow(float seconds, float saturation, float brightness) {
float hue = (System.currentTimeMillis()) % (int) (seconds * 1000) / (seconds * 1000);
int color = Color.HSBtoRGB(hue, saturation, brightness);
@ -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

@ -1,40 +1,35 @@
package net.lax1dude.eaglercraft.v1_8;
public class EaglercraftVersion {
//////////////////////////////////////////////////////////////////////
/// Customize these to fit your fork:
public static final String projectForkName = "Resent";
public static final String projectForkVersion = "3.3.2";
public static final String projectForkVendor = "Nitwit";
public static final String projectForkURL = "https://github.com/ThisIsALegitUsername/Resent-web";
//////////////////////////////////////////////////////////////////////
// Do not change these, they must stay as credit to lax1dude's
// original repository for maintaining the project:
public static final String projectOriginName = "EaglercraftX";
public static final String projectOriginAuthor = "lax1dude";
public static final String projectOriginRevision = "1.8";
public static final String projectOriginVersion = "u16";
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 mainMenuStringC = "Rewritten by " + projectOriginAuthor;
public static final String mainMenuStringD = "Resources Copyright Mojang AB";
/// Customize these to fit your fork:
public static final String projectForkName = "Resent";
public static final String projectForkVersion = "3.3.2";
public static final String projectForkVendor = "Nitwit";
public static final String projectForkURL = "https://github.com/ThisIsALegitUsername/Resent-web";
//////////////////////////////////////////////////////////////////////
// Do not change these, they must stay as credit to lax1dude's
// original repository for maintaining the project:
public static final String projectOriginName = "EaglercraftX";
public static final String projectOriginAuthor = "lax1dude";
public static final String projectOriginRevision = "1.8";
public static final String projectOriginVersion = "u16";
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 mainMenuStringC = "Rewritten by " + projectOriginAuthor;
public static final String mainMenuStringD = "Resources Copyright Mojang AB";
public static final String mainMenuStringE = projectForkName + " " + projectForkVersion;
public static final String mainMenuStringF = "Made by " + projectForkVendor;

View File

@ -13,219 +13,209 @@ import net.minecraft.util.ResourceLocation;
/**
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
*
*
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
*
*
* NOT FOR COMMERCIAL OR MALICIOUS USE
*
* (please read the 'LICENSE' file this repo's root directory for more info)
*
*
* (please read the 'LICENSE' file this repo's root directory for more info)
*
*/
public class EaglerFontRenderer extends FontRenderer {
private final int[] temporaryCodepointArray = new int[6553];
private final int[] temporaryCodepointArray = new int[6553];
public EaglerFontRenderer(GameSettings gameSettingsIn, ResourceLocation location, TextureManager textureManagerIn,
boolean unicode) {
super(gameSettingsIn, location, textureManagerIn, unicode);
}
public EaglerFontRenderer(GameSettings gameSettingsIn, ResourceLocation location, TextureManager textureManagerIn, boolean unicode) {
super(gameSettingsIn, location, textureManagerIn, unicode);
}
public int drawString(String text, float x, float y, int color, boolean dropShadow) {
if (text == null || text.length() == 0) {
this.posX = x + (dropShadow ? 1 : 0);
this.posY = y;
} else {
if(this.unicodeFlag || !decodeASCIICodepointsAndValidate(text)) {
return super.drawString(text, x, y, color, dropShadow);
}
this.resetStyles();
if ((color & 0xFC000000) == 0) {
color |= 0xFF000000;
}
this.red = (float) (color >> 16 & 255) / 255.0F;
this.blue = (float) (color >> 8 & 255) / 255.0F;
this.green = (float) (color & 255) / 255.0F;
this.alpha = (float) (color >> 24 & 255) / 255.0F;
this.posX = x;
this.posY = y;
this.textColor = color;
this.renderStringAtPos0(text, dropShadow);
}
return (int) this.posX;
}
public int drawString(String text, float x, float y, int color, boolean dropShadow) {
if (text == null || text.length() == 0) {
this.posX = x + (dropShadow ? 1 : 0);
this.posY = y;
} else {
if (this.unicodeFlag || !decodeASCIICodepointsAndValidate(text)) {
return super.drawString(text, x, y, color, dropShadow);
}
this.resetStyles();
if ((color & 0xFC000000) == 0) {
color |= 0xFF000000;
}
this.red = (float) (color >> 16 & 255) / 255.0F;
this.blue = (float) (color >> 8 & 255) / 255.0F;
this.green = (float) (color & 255) / 255.0F;
this.alpha = (float) (color >> 24 & 255) / 255.0F;
this.posX = x;
this.posY = y;
this.textColor = color;
this.renderStringAtPos0(text, dropShadow);
}
return (int) this.posX;
}
protected void renderStringAtPos(String parString1, boolean parFlag) {
if(parString1 == null) return;
if(this.unicodeFlag || !decodeASCIICodepointsAndValidate(parString1)) {
super.renderStringAtPos(parString1, parFlag);
}else {
renderStringAtPos0(parString1, false);
}
}
protected void renderStringAtPos(String parString1, boolean parFlag) {
if (parString1 == null) return;
if (this.unicodeFlag || !decodeASCIICodepointsAndValidate(parString1)) {
super.renderStringAtPos(parString1, parFlag);
} else {
renderStringAtPos0(parString1, false);
}
}
private void renderStringAtPos0(String parString1, boolean parFlag) {
renderEngine.bindTexture(locationFontTexture);
InstancedFontRenderer.begin();
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
boolean hasStrike = false;
for (int i = 0; i < parString1.length(); ++i) {
char c0 = parString1.charAt(i);
if (c0 == 167 && i + 1 < parString1.length()) {
int i1 = "0123456789abcdefklmnor".indexOf(Character.toLowerCase(parString1.charAt(i + 1)));
if (i1 < 16) {
this.randomStyle = false;
this.boldStyle = false;
this.strikethroughStyle = false;
this.underlineStyle = false;
this.italicStyle = false;
if (i1 < 0 || i1 > 15) {
i1 = 15;
}
int j1 = this.colorCode[i1];
this.textColor = j1 | (this.textColor & 0xFF000000);
} else if (i1 == 16) {
this.randomStyle = true;
} else if (i1 == 17) {
this.boldStyle = true;
} else if (i1 == 18) {
this.strikethroughStyle = true;
} else if (i1 == 19) {
this.underlineStyle = true;
} else if (i1 == 20) {
this.italicStyle = true;
} else if (i1 == 21) {
this.randomStyle = false;
this.boldStyle = false;
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);
}
private void renderStringAtPos0(String parString1, boolean parFlag) {
renderEngine.bindTexture(locationFontTexture);
InstancedFontRenderer.begin();
++i;
} else {
int j = temporaryCodepointArray[i];
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";
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
char c1;
while (true) {
j = this.fontRandom.nextInt(chars.length());
c1 = chars.charAt(j);
if (k == this.getCharWidth(c1)) {
break;
}
}
boolean hasStrike = false;
c0 = c1;
}
for (int i = 0; i < parString1.length(); ++i) {
char c0 = parString1.charAt(i);
if (c0 == 167 && i + 1 < parString1.length()) {
int i1 = "0123456789abcdefklmnor".indexOf(Character.toLowerCase(parString1.charAt(i + 1)));
if (i1 < 16) {
this.randomStyle = false;
this.boldStyle = false;
this.strikethroughStyle = false;
this.underlineStyle = false;
this.italicStyle = false;
if (i1 < 0 || i1 > 15) {
i1 = 15;
}
int j1 = this.colorCode[i1];
this.textColor = j1 | (this.textColor & 0xFF000000);
} else if (i1 == 16) {
this.randomStyle = true;
} else if (i1 == 17) {
this.boldStyle = true;
} else if (i1 == 18) {
this.strikethroughStyle = true;
} else if (i1 == 19) {
this.underlineStyle = true;
} else if (i1 == 20) {
this.italicStyle = true;
} else if (i1 == 21) {
this.randomStyle = false;
this.boldStyle = false;
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);
}
float f = this.appendCharToBuffer(j, this.textColor, this.boldStyle, this.italicStyle);
++i;
} else {
int j = temporaryCodepointArray[i];
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.putColor4(this.textColor);
}
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";
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.putColor4(this.textColor);
}
char c1;
while (true) {
j = this.fontRandom.nextInt(chars.length());
c1 = chars.charAt(j);
if (k == this.getCharWidth(c1)) {
break;
}
}
this.posX += (float) ((int) f);
}
}
float texScale = 0.0625f;
if(!hasStrike) {
worldrenderer.finishDrawing();
}
if(parFlag) {
if(hasStrike) {
GlStateManager.color(0.25f, 0.25f, 0.25f, 1.0f);
GlStateManager.translate(1.0f, 1.0f, 0.0f);
tessellator.draw();
GlStateManager.translate(-1.0f, -1.0f, 0.0f);
GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
InstancedFontRenderer.render(8, 8, texScale, texScale, true);
EaglercraftGPU.renderAgain();
}else {
GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
InstancedFontRenderer.render(8, 8, texScale, texScale, true);
}
}else {
GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
if(hasStrike) {
tessellator.draw();
}
InstancedFontRenderer.render(8, 8, texScale, texScale, false);
}
if(parFlag) {
this.posX += 1.0f;
}
}
c0 = c1;
}
private float appendCharToBuffer(int parInt1, int color, boolean boldStyle, boolean italicStyle) {
if (parInt1 == 32) {
return 4.0f;
}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);
++w;
}else {
InstancedFontRenderer.appendQuad((int)this.posX, (int)this.posY, i, j, color, italicStyle);
}
return w;
}
}
float f = this.appendCharToBuffer(j, this.textColor, this.boldStyle, this.italicStyle);
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) {
temporaryCodepointArray[i] = j;
}else {
return false;
}
}
return true;
}
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.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.putColor4(this.textColor);
}
this.posX += (float) ((int) f);
}
}
float texScale = 0.0625f;
if (!hasStrike) {
worldrenderer.finishDrawing();
}
if (parFlag) {
if (hasStrike) {
GlStateManager.color(0.25f, 0.25f, 0.25f, 1.0f);
GlStateManager.translate(1.0f, 1.0f, 0.0f);
tessellator.draw();
GlStateManager.translate(-1.0f, -1.0f, 0.0f);
GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
InstancedFontRenderer.render(8, 8, texScale, texScale, true);
EaglercraftGPU.renderAgain();
} else {
GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
InstancedFontRenderer.render(8, 8, texScale, texScale, true);
}
} else {
GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
if (hasStrike) {
tessellator.draw();
}
InstancedFontRenderer.render(8, 8, texScale, texScale, false);
}
if (parFlag) {
this.posX += 1.0f;
}
}
private float appendCharToBuffer(int parInt1, int color, boolean boldStyle, boolean italicStyle) {
if (parInt1 == 32) {
return 4.0f;
} 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);
++w;
} 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) {
temporaryCodepointArray[i] = j;
} else {
return false;
}
}
return true;
}
}

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

@ -74,8 +74,8 @@ public class EffectPipelineFXAA {
shaderProgram = _wglCreateProgram();
_wglAttachShader(shaderProgram, SpriteLevelMixer.vshLocal);
_wglAttachShader(shaderProgram, frag);
_wglAttachShader(shaderProgram, SpriteLevelMixer.vshLocal);
_wglAttachShader(shaderProgram, frag);
_wglLinkProgram(shaderProgram);

View File

@ -21,23 +21,23 @@ class FixedFunctionShader {
static final String FILENAME_VSH = "/assets/eagler/glsl/core.vsh";
static final String FILENAME_FSH = "/assets/eagler/glsl/core.fsh";
static final String PRECISION_INT = "lowp";
static final String PRECISION_FLOAT = "mediump";
static final String PRECISION_SAMPLER = "lowp";
static final String MACRO_ATTRIB_TEXTURE = "COMPILE_TEXTURE_ATTRIB";
static final String MACRO_ATTRIB_COLOR = "COMPILE_COLOR_ATTRIB";
static final String MACRO_ATTRIB_NORMAL = "COMPILE_NORMAL_ATTRIB";
static final String MACRO_ATTRIB_LIGHTMAP = "COMPILE_LIGHTMAP_ATTRIB";
static final String MACRO_ENABLE_TEXTURE2D = "COMPILE_ENABLE_TEXTURE2D";
static final String MACRO_ENABLE_LIGHTMAP = "COMPILE_ENABLE_LIGHTMAP";
static final String MACRO_ENABLE_ALPHA_TEST = "COMPILE_ENABLE_ALPHA_TEST";
static final String MACRO_ENABLE_MC_LIGHTING = "COMPILE_ENABLE_MC_LIGHTING";
static final String MACRO_ENABLE_END_PORTAL = "COMPILE_ENABLE_TEX_GEN";
static final String MACRO_ENABLE_ANISOTROPIC_FIX = "COMPILE_ENABLE_ANISOTROPIC_FIX";
static final String MACRO_ENABLE_FOG = "COMPILE_ENABLE_FOG";
static final String MACRO_ENABLE_BLEND_ADD = "COMPILE_BLEND_ADD";
static final String PRECISION_INT = "lowp";
static final String PRECISION_FLOAT = "mediump";
static final String PRECISION_SAMPLER = "lowp";
static final String MACRO_ATTRIB_TEXTURE = "COMPILE_TEXTURE_ATTRIB";
static final String MACRO_ATTRIB_COLOR = "COMPILE_COLOR_ATTRIB";
static final String MACRO_ATTRIB_NORMAL = "COMPILE_NORMAL_ATTRIB";
static final String MACRO_ATTRIB_LIGHTMAP = "COMPILE_LIGHTMAP_ATTRIB";
static final String MACRO_ENABLE_TEXTURE2D = "COMPILE_ENABLE_TEXTURE2D";
static final String MACRO_ENABLE_LIGHTMAP = "COMPILE_ENABLE_LIGHTMAP";
static final String MACRO_ENABLE_ALPHA_TEST = "COMPILE_ENABLE_ALPHA_TEST";
static final String MACRO_ENABLE_MC_LIGHTING = "COMPILE_ENABLE_MC_LIGHTING";
static final String MACRO_ENABLE_END_PORTAL = "COMPILE_ENABLE_TEX_GEN";
static final String MACRO_ENABLE_ANISOTROPIC_FIX = "COMPILE_ENABLE_ANISOTROPIC_FIX";
static final String MACRO_ENABLE_FOG = "COMPILE_ENABLE_FOG";
static final String MACRO_ENABLE_BLEND_ADD = "COMPILE_BLEND_ADD";
static final String ATTRIB_POSITION = "a_position3f";
static final String ATTRIB_TEXTURE = "a_texture2f";

View File

@ -1,95 +1,94 @@
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.
*
*
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
*
*
* NOT FOR COMMERCIAL OR MALICIOUS USE
*
* (please read the 'LICENSE' file this repo's root directory for more info)
*
*
* (please read the 'LICENSE' file this repo's root directory for more info)
*
*/
public class GameOverlayFramebuffer {
private static final int _GL_FRAMEBUFFER = 0x8D40;
private static final int _GL_RENDERBUFFER = 0x8D41;
private static final int _GL_COLOR_ATTACHMENT0 = 0x8CE0;
private static final int _GL_DEPTH_ATTACHMENT = 0x8D00;
private static final int _GL_DEPTH_COMPONENT16 = 0x81A5;
private static final int _GL_FRAMEBUFFER = 0x8D40;
private static final int _GL_RENDERBUFFER = 0x8D41;
private static final int _GL_COLOR_ATTACHMENT0 = 0x8CE0;
private static final int _GL_DEPTH_ATTACHMENT = 0x8D00;
private static final int _GL_DEPTH_COMPONENT16 = 0x81A5;
private long age = -1l;
private long age = -1l;
private int currentWidth = -1;
private int currentHeight = -1;
private int currentWidth = -1;
private int currentHeight = -1;
private IFramebufferGL framebuffer = null;
private IRenderbufferGL depthBuffer = null;
private IFramebufferGL framebuffer = null;
private IRenderbufferGL depthBuffer = null;
private int framebufferColor = -1;
private int framebufferColor = -1;
public void beginRender(int width, int height) {
if(framebuffer == null) {
framebuffer = _wglCreateFramebuffer();
depthBuffer = _wglCreateRenderbuffer();
framebufferColor = GlStateManager.generateTexture();
_wglBindFramebuffer(_GL_FRAMEBUFFER, framebuffer);
GlStateManager.bindTexture(framebufferColor);
_wglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
_wglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
_wglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
_wglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
_wglFramebufferTexture2D(_GL_FRAMEBUFFER, _GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, EaglercraftGPU.getNativeTexture(framebufferColor), 0);
_wglBindRenderbuffer(_GL_RENDERBUFFER, depthBuffer);
_wglFramebufferRenderbuffer(_GL_FRAMEBUFFER, _GL_DEPTH_ATTACHMENT, _GL_RENDERBUFFER, depthBuffer);
}
public void beginRender(int width, int height) {
if (framebuffer == null) {
framebuffer = _wglCreateFramebuffer();
depthBuffer = _wglCreateRenderbuffer();
framebufferColor = GlStateManager.generateTexture();
_wglBindFramebuffer(_GL_FRAMEBUFFER, framebuffer);
GlStateManager.bindTexture(framebufferColor);
_wglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
_wglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
_wglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
_wglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
_wglFramebufferTexture2D(_GL_FRAMEBUFFER, _GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, EaglercraftGPU.getNativeTexture(framebufferColor), 0);
_wglBindRenderbuffer(_GL_RENDERBUFFER, depthBuffer);
_wglFramebufferRenderbuffer(_GL_FRAMEBUFFER, _GL_DEPTH_ATTACHMENT, _GL_RENDERBUFFER, depthBuffer);
}
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);
_wglBindRenderbuffer(_GL_RENDERBUFFER, depthBuffer);
_wglRenderbufferStorage(_GL_RENDERBUFFER, _GL_DEPTH_COMPONENT16, width, 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);
_wglBindRenderbuffer(_GL_RENDERBUFFER, depthBuffer);
_wglRenderbufferStorage(_GL_RENDERBUFFER, _GL_DEPTH_COMPONENT16, width, height);
}
_wglBindFramebuffer(_GL_FRAMEBUFFER, framebuffer);
}
_wglBindFramebuffer(_GL_FRAMEBUFFER, framebuffer);
}
public void endRender() {
_wglBindFramebuffer(_GL_FRAMEBUFFER, null);
age = System.currentTimeMillis();
}
public void endRender() {
_wglBindFramebuffer(_GL_FRAMEBUFFER, null);
age = System.currentTimeMillis();
}
public long getAge() {
return age == -1l ? -1l : (System.currentTimeMillis() - age);
}
public long getAge() {
return age == -1l ? -1l : (System.currentTimeMillis() - age);
}
public int getTexture() {
return framebufferColor;
}
public void destroy() {
if(framebuffer != null) {
_wglDeleteFramebuffer(framebuffer);
_wglDeleteRenderbuffer(depthBuffer);
GlStateManager.deleteTexture(framebufferColor);
framebuffer = null;
depthBuffer = null;
framebufferColor = -1;
age = -1l;
_wglBindFramebuffer(_GL_FRAMEBUFFER, null);
}
}
public int getTexture() {
return framebufferColor;
}
public void destroy() {
if (framebuffer != null) {
_wglDeleteFramebuffer(framebuffer);
_wglDeleteRenderbuffer(depthBuffer);
GlStateManager.deleteTexture(framebufferColor);
framebuffer = null;
depthBuffer = null;
framebufferColor = -1;
age = -1l;
_wglBindFramebuffer(_GL_FRAMEBUFFER, null);
}
}
}

View File

@ -120,8 +120,8 @@ public class InstancedFontRenderer {
shaderProgram = _wglCreateProgram();
_wglAttachShader(shaderProgram, vert);
_wglAttachShader(shaderProgram, frag);
_wglAttachShader(shaderProgram, vert);
_wglAttachShader(shaderProgram, frag);
_wglLinkProgram(shaderProgram);

View File

@ -122,8 +122,8 @@ public class InstancedParticleRenderer {
shaderProgram = _wglCreateProgram();
_wglAttachShader(shaderProgram, vert);
_wglAttachShader(shaderProgram, frag);
_wglAttachShader(shaderProgram, vert);
_wglAttachShader(shaderProgram, frag);
_wglLinkProgram(shaderProgram);

View File

@ -111,8 +111,8 @@ public class SpriteLevelMixer {
shaderProgram = _wglCreateProgram();
_wglAttachShader(shaderProgram, vshLocal);
_wglAttachShader(shaderProgram, frag);
_wglAttachShader(shaderProgram, vshLocal);
_wglAttachShader(shaderProgram, frag);
_wglLinkProgram(shaderProgram);

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.

File diff suppressed because it is too large Load Diff

View File

@ -14,9 +14,9 @@ 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
public void drawScreen(final int mouseX, final int mouseY, final float partialTicks) {
this.drawDefaultBackground();
@ -27,22 +27,25 @@ public class GuiMainMenu extends GuiScreen {
GlUtils.drawCenteredScaledString("" + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + "Resent", this.width / 2, this.height / 2 - 50, -1, 3f);
super.drawScreen(mouseX, mouseY, partialTicks);
}
@Override
protected void actionPerformed(GuiButton button){
protected void actionPerformed(GuiButton button) {
switch (button.id) {
case 2: {
this.mc.displayGuiScreen(new GuiMultiplayer(this));
break;
}
case 3: {
this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
break;
}
case 4: {
this.mc.displayGuiScreen(new GuiScreenEditProfile(this));
break;
}
case 2:
{
this.mc.displayGuiScreen(new GuiMultiplayer(this));
break;
}
case 3:
{
this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
break;
}
case 4:
{
this.mc.displayGuiScreen(new GuiScreenEditProfile(this));
break;
}
}
super.actionPerformed(button);
}
@ -51,4 +54,4 @@ public class GuiMainMenu extends GuiScreen {
public void onGuiClosed() {
super.onGuiClosed();
}
}
}

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;
@ -45,459 +43,409 @@ import net.minecraft.world.chunk.Chunk;
/**+
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
*
*
* Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!"
* Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team
*
*
* EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved.
*
*
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
*
*
* NOT FOR COMMERCIAL OR MALICIOUS USE
*
* (please read the 'LICENSE' file this repo's root directory for more info)
*
*
* (please read the 'LICENSE' file this repo's root directory for more info)
*
*/
public class GuiOverlayDebug extends Gui {
private final Minecraft mc;
private final FontRenderer fontRenderer;
public GuiOverlayDebug(Minecraft mc) {
this.mc = mc;
this.fontRenderer = mc.fontRendererObj;
}
private final Minecraft mc;
private final FontRenderer fontRenderer;
public void renderDebugInfo(ScaledResolution scaledResolutionIn) {
int ww = scaledResolutionIn.getScaledWidth();
int hh = scaledResolutionIn.getScaledHeight();
this.mc.mcProfiler.startSection("debug");
if (this.mc.gameSettings.showDebugInfo) {
GlStateManager.pushMatrix();
this.renderDebugInfoLeft();
this.renderDebugInfoRight(scaledResolutionIn);
GlStateManager.popMatrix();
if (this.mc.gameSettings.field_181657_aC) {
this.func_181554_e();
}
} else {
int i = 2;
public GuiOverlayDebug(Minecraft mc) {
this.mc = mc;
this.fontRenderer = mc.fontRendererObj;
}
if (this.mc.gameSettings.hudFps) {
drawFPS(2, i);
i += 9;
}
public void renderDebugInfo(ScaledResolution scaledResolutionIn) {
int ww = scaledResolutionIn.getScaledWidth();
int hh = scaledResolutionIn.getScaledHeight();
this.mc.mcProfiler.startSection("debug");
if (this.mc.gameSettings.showDebugInfo) {
GlStateManager.pushMatrix();
this.renderDebugInfoLeft();
this.renderDebugInfoRight(scaledResolutionIn);
GlStateManager.popMatrix();
if (this.mc.gameSettings.field_181657_aC) {
this.func_181554_e();
}
} else {
int i = 2;
if (this.mc.gameSettings.hudCoords) {
drawXYZ(2, i);
}
}
if (this.mc.gameSettings.hudFps) {
drawFPS(2, i);
i += 9;
}
if (this.mc.currentScreen == null || !(this.mc.currentScreen instanceof GuiChat)) {
if (this.mc.gameSettings.hudStats) {
drawStatsHUD(ww - 2, hh - 2);
}
if (this.mc.gameSettings.hudCoords) {
drawXYZ(2, i);
}
}
if (this.mc.gameSettings.hudWorld) {
drawWorldHUD(2, hh - 2);
}
}
if (this.mc.currentScreen == null || !(this.mc.currentScreen instanceof GuiChat)) {
if (this.mc.gameSettings.hudStats) {
drawStatsHUD(ww - 2, hh - 2);
}
if (this.mc.gameSettings.hudCoords && this.mc.joinWorldTickCounter < 80) {
if (this.mc.joinWorldTickCounter > 70) {
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
int i = this.mc.joinWorldTickCounter - 70;
if (i < 0)
i = 0;
drawHideHUD(ww / 2, hh - 70, (10 - i) * 0xFF / 10);
if (this.mc.joinWorldTickCounter > 70) {
GlStateManager.disableBlend();
}
}
if (this.mc.gameSettings.hudWorld) {
drawWorldHUD(2, hh - 2);
}
}
this.mc.mcProfiler.endSection();
}
if (this.mc.gameSettings.hudCoords && this.mc.joinWorldTickCounter < 80) {
if (this.mc.joinWorldTickCounter > 70) {
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
int i = this.mc.joinWorldTickCounter - 70;
if (i < 0) i = 0;
drawHideHUD(ww / 2, hh - 70, (10 - i) * 0xFF / 10);
if (this.mc.joinWorldTickCounter > 70) {
GlStateManager.disableBlend();
}
}
private void drawFPS(int x, int y) {
this.fontRenderer.drawStringWithShadow(this.mc.renderGlobal.getDebugInfoShort(), x, y, 0xFFFFFF);
}
this.mc.mcProfiler.endSection();
}
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);
}
private void drawFPS(int x, int y) {
this.fontRenderer.drawStringWithShadow(this.mc.renderGlobal.getDebugInfoShort(), x, y, 0xFFFFFF);
}
private void drawStatsHUD(int x, int y) {
int i = 9;
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);
}
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;
private void drawStatsHUD(int x, int y) {
int i = 9;
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;
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 = "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;
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;
int xpc = mc.thePlayer.xpBarCap();
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;
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;
Iterator<PotionEffect> potions = mc.thePlayer.getActivePotionEffects().iterator();
if (potions.hasNext()) {
while (potions.hasNext()) {
i += 11;
PotionEffect e = potions.next();
int t = e.getDuration() / 20;
int m = t / 60;
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 + "]";
} else {
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);
}
}
int xpc = mc.thePlayer.xpBarCap();
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;
}
Iterator<PotionEffect> potions = mc.thePlayer.getActivePotionEffects().iterator();
if (potions.hasNext()) {
while (potions.hasNext()) {
i += 11;
PotionEffect e = potions.next();
int t = e.getDuration() / 20;
int m = t / 60;
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 + "]";
} else {
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;
public static final int ticksPerDay = 24000;
public static final int ticksPerHour = 1000;
public static final double ticksPerMinute = 1000d / 60d;
public static final double ticksPerSecond = 1000d / 60d / 60d;
private static final SimpleDateFormat SDFTwentyFour = new SimpleDateFormat("HH:mm", Locale.ENGLISH);
private static final SimpleDateFormat SDFTwelve = new SimpleDateFormat("h:mm aa", Locale.ENGLISH);
public static final int ticksAtMidnight = 18000;
public static final int ticksPerDay = 24000;
public static final int ticksPerHour = 1000;
public static final double ticksPerMinute = 1000d / 60d;
public static final double ticksPerSecond = 1000d / 60d / 60d;
private static final SimpleDateFormat SDFTwentyFour = new SimpleDateFormat("HH:mm", Locale.ENGLISH);
private static final SimpleDateFormat SDFTwelve = new SimpleDateFormat("h:mm aa", Locale.ENGLISH);
private void drawWorldHUD(int x, int y) {
/*
* Math was taken from: https://github.com/EssentialsX/Essentials/blob/
* dc7fb919391d62de45e17b51ae1e6fe3e66d7ac6/Essentials/src/main/java/com/
* earth2me/essentials/utils/DescParseTickFormat.java
*/
long totalTicks = mc.theWorld.getWorldTime();
long ticks = totalTicks;
ticks = ticks - ticksAtMidnight + ticksPerDay;
final long days = ticks / ticksPerDay;
ticks -= days * ticksPerDay;
final long hours = ticks / ticksPerHour;
ticks -= hours * ticksPerHour;
final long minutes = (long) Math.floor(ticks / ticksPerMinute);
final double dticks = ticks - minutes * ticksPerMinute;
final long seconds = (long) Math.floor(dticks / ticksPerSecond);
private void drawWorldHUD(int x, int y) {
/*
* Math was taken from: https://github.com/EssentialsX/Essentials/blob/
* dc7fb919391d62de45e17b51ae1e6fe3e66d7ac6/Essentials/src/main/java/com/
* earth2me/essentials/utils/DescParseTickFormat.java
*/
long totalTicks = mc.theWorld.getWorldTime();
long ticks = totalTicks;
ticks = ticks - ticksAtMidnight + ticksPerDay;
final long days = ticks / ticksPerDay;
ticks -= days * ticksPerDay;
final long hours = ticks / ticksPerHour;
ticks -= hours * ticksPerHour;
final long minutes = (long) Math.floor(ticks / ticksPerMinute);
final double dticks = ticks - minutes * ticksPerMinute;
final long seconds = (long) Math.floor(dticks / ticksPerSecond);
// TODO: why does desktop JRE not apply "GMT" correctly?
final Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"), Locale.ENGLISH);
// TODO: why does desktop JRE not apply "GMT" correctly?
final Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"), Locale.ENGLISH);
cal.setLenient(true);
cal.set(0, Calendar.JANUARY, 1, 0, 0, 0);
cal.add(Calendar.DAY_OF_YEAR, (int) days);
cal.add(Calendar.HOUR_OF_DAY, (int) hours);
cal.add(Calendar.MINUTE, (int) minutes);
cal.add(Calendar.SECOND, (int) seconds + 1);
cal.setLenient(true);
cal.set(0, Calendar.JANUARY, 1, 0, 0, 0);
cal.add(Calendar.DAY_OF_YEAR, (int) days);
cal.add(Calendar.HOUR_OF_DAY, (int) hours);
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);
BiomeGenBase biome = mc.theWorld.getBiomeGenForCoords(blockpos);
Entity e = mc.getRenderViewEntity();
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;
String lightString = "Light: " + lightColor + totalLight + EnumChatFormatting.WHITE;
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;
String lightString = "Light: " + lightColor + totalLight + EnumChatFormatting.WHITE;
float temp = biome.getFloatTemperature(blockpos);
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(lightString + " " + tempString, x, y - 8, 0xFFFFFF);
}
this.fontRenderer.drawStringWithShadow(timeString, x, y - 30, 0xFFFFFF);
this.fontRenderer.drawStringWithShadow("Biome: " + EnumChatFormatting.AQUA + biome.biomeName, x, y - 19, 0xFFFFFF);
this.fontRenderer.drawStringWithShadow(lightString + " " + tempString, x, y - 8, 0xFFFFFF);
}
private void drawHideHUD(int x, int y, int fade) {
drawCenteredString(fontRenderer, I18n.format("options.hud.note"), x, y, 0xEECC00 | (fade << 24));
}
private void drawHideHUD(int x, int y, int fade) {
drawCenteredString(fontRenderer, I18n.format("options.hud.note"), x, y, 0xEECC00 | (fade << 24));
}
private boolean isReducedDebug() {
return this.mc.thePlayer.hasReducedDebug() || this.mc.gameSettings.reducedDebugInfo;
}
private boolean isReducedDebug() {
return this.mc.thePlayer.hasReducedDebug() || this.mc.gameSettings.reducedDebugInfo;
}
protected void renderDebugInfoLeft() {
List list = this.call();
protected void renderDebugInfoLeft() {
List list = this.call();
for (int i = 0; i < list.size(); ++i) {
String s = (String) list.get(i);
if (!Strings.isNullOrEmpty(s)) {
int j = this.fontRenderer.FONT_HEIGHT;
int k = this.fontRenderer.getStringWidth(s);
boolean flag = true;
int l = 2 + j * i;
drawRect(1, l - 1, 2 + k + 1, l + j - 1, -1873784752);
this.fontRenderer.drawString(s, 2, l, 14737632);
}
}
for (int i = 0; i < list.size(); ++i) {
String s = (String) list.get(i);
if (!Strings.isNullOrEmpty(s)) {
int j = this.fontRenderer.FONT_HEIGHT;
int k = this.fontRenderer.getStringWidth(s);
boolean flag = true;
int l = 2 + j * i;
drawRect(1, l - 1, 2 + k + 1, l + j - 1, -1873784752);
this.fontRenderer.drawString(s, 2, l, 14737632);
}
}
}
}
protected void renderDebugInfoRight(ScaledResolution parScaledResolution) {
List list = this.getDebugInfoRight();
protected void renderDebugInfoRight(ScaledResolution parScaledResolution) {
List list = this.getDebugInfoRight();
for (int i = 0; i < list.size(); ++i) {
String s = (String) list.get(i);
if (!Strings.isNullOrEmpty(s)) {
int j = this.fontRenderer.FONT_HEIGHT;
int k = this.fontRenderer.getStringWidth(s);
int l = parScaledResolution.getScaledWidth() - 2 - k;
int i1 = 2 + j * i;
drawRect(l - 1, i1 - 1, l + k + 1, i1 + j - 1, -1873784752);
this.fontRenderer.drawString(s, l, i1, 14737632);
}
}
}
for (int i = 0; i < list.size(); ++i) {
String s = (String) list.get(i);
if (!Strings.isNullOrEmpty(s)) {
int j = this.fontRenderer.FONT_HEIGHT;
int k = this.fontRenderer.getStringWidth(s);
int l = parScaledResolution.getScaledWidth() - 2 - k;
int i1 = 2 + j * i;
drawRect(l - 1, i1 - 1, l + k + 1, i1 + j - 1, -1873784752);
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);
if (this.isReducedDebug()) {
return 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("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();
String s = "Invalid";
switch (enumfacing) {
case NORTH:
s = "Towards negative Z";
break;
case SOUTH:
s = "Towards positive Z";
break;
case WEST:
s = "Towards negative X";
break;
case EAST:
s = "Towards positive X";
}
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() });
}
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)) })
}
);
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)");
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) }));
}
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[] {
"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("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();
String s = "Invalid";
switch (enumfacing) {
case NORTH:
s = "Towards negative Z";
break;
case SOUTH:
s = "Towards positive Z";
break;
case WEST:
s = "Towards negative X";
break;
case EAST:
s = "Towards positive X";
}
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 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)) }) });
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)");
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) }));
}
return arraylist;
}
}
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()) }));
}
protected List<String> getDebugInfoRight() {
ArrayList arraylist;
if (EagRuntime.getPlatformType() != EnumPlatformType.JAVASCRIPT) {
long i = EagRuntime.maxMemory();
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)
}
);
} 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) });
}
if (this.isReducedDebug()) {
return arraylist;
} else {
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("");
arraylist.add(String.valueOf(Block.blockRegistry.getNameForObject(iblockstate.getBlock())));
return arraylist;
}
}
for (Entry entry : iblockstate.getProperties().entrySet()) {
String s = ((Comparable) entry.getValue()).toString();
if (entry.getValue() == Boolean.TRUE) {
s = EnumChatFormatting.GREEN + s;
} else if (entry.getValue() == Boolean.FALSE) {
s = EnumChatFormatting.RED + s;
}
protected List<String> getDebugInfoRight() {
ArrayList arraylist;
if (EagRuntime.getPlatformType() != EnumPlatformType.JAVASCRIPT) {
long i = EagRuntime.maxMemory();
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) });
} 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) });
}
if (this.isReducedDebug()) {
return arraylist;
} else {
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("");
arraylist.add(String.valueOf(Block.blockRegistry.getNameForObject(iblockstate.getBlock())));
arraylist.add(((IProperty) entry.getKey()).getName() + ": " + s);
}
}
for (Entry entry : iblockstate.getProperties().entrySet()) {
String s = ((Comparable) entry.getValue()).toString();
if (entry.getValue() == Boolean.TRUE) {
s = EnumChatFormatting.GREEN + s;
} else if (entry.getValue() == Boolean.FALSE) {
s = EnumChatFormatting.RED + s;
}
return arraylist;
}
}
arraylist.add(((IProperty) entry.getKey()).getName() + ": " + s);
}
}
private void func_181554_e() {
GlStateManager.disableDepth();
FrameTimer frametimer = this.mc.func_181539_aj();
int i = frametimer.func_181749_a();
int j = frametimer.func_181750_b();
long[] along = frametimer.func_181746_c();
ScaledResolution scaledresolution = new ScaledResolution(this.mc);
int k = i;
int l = 0;
drawRect(0, scaledresolution.getScaledHeight() - 60, 240, scaledresolution.getScaledHeight(), -1873784752);
return arraylist;
}
}
while (k != j) {
int i1 = frametimer.func_181748_a(along[k], 30);
int j1 = this.func_181552_c(MathHelper.clamp_int(i1, 0, 60), 0, 30, 60);
this.drawVerticalLine(l, scaledresolution.getScaledHeight(), scaledresolution.getScaledHeight() - i1, j1);
++l;
k = frametimer.func_181751_b(k + 1);
}
private void func_181554_e() {
GlStateManager.disableDepth();
FrameTimer frametimer = this.mc.func_181539_aj();
int i = frametimer.func_181749_a();
int j = frametimer.func_181750_b();
long[] along = frametimer.func_181746_c();
ScaledResolution scaledresolution = new ScaledResolution(this.mc);
int k = i;
int l = 0;
drawRect(0, scaledresolution.getScaledHeight() - 60, 240, scaledresolution.getScaledHeight(), -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);
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);
}
while (k != j) {
int i1 = frametimer.func_181748_a(along[k], 30);
int j1 = this.func_181552_c(MathHelper.clamp_int(i1, 0, 60), 0, 30, 60);
this.drawVerticalLine(l, scaledresolution.getScaledHeight(), scaledresolution.getScaledHeight() - i1, j1);
++l;
k = frametimer.func_181751_b(k + 1);
}
GlStateManager.enableDepth();
}
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);
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);
}
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));
}
GlStateManager.enableDepth();
}
private int func_181553_a(int parInt1, int parInt2, float parFloat1) {
int i = parInt1 >> 24 & 255;
int j = parInt1 >> 16 & 255;
int k = parInt1 >> 8 & 255;
int l = parInt1 & 255;
int i1 = parInt2 >> 24 & 255;
int j1 = parInt2 >> 16 & 255;
int k1 = parInt2 >> 8 & 255;
int l1 = parInt2 & 255;
int i2 = MathHelper.clamp_int((int) ((float) i + (float) (i1 - i) * parFloat1), 0, 255);
int j2 = MathHelper.clamp_int((int) ((float) j + (float) (j1 - j) * parFloat1), 0, 255);
int k2 = MathHelper.clamp_int((int) ((float) k + (float) (k1 - k) * parFloat1), 0, 255);
int l2 = MathHelper.clamp_int((int) ((float) l + (float) (l1 - l) * parFloat1), 0, 255);
return i2 << 24 | j2 << 16 | k2 << 8 | l2;
}
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));
}
private int func_181553_a(int parInt1, int parInt2, float parFloat1) {
int i = parInt1 >> 24 & 255;
int j = parInt1 >> 16 & 255;
int k = parInt1 >> 8 & 255;
int l = parInt1 & 255;
int i1 = parInt2 >> 24 & 255;
int j1 = parInt2 >> 16 & 255;
int k1 = parInt2 >> 8 & 255;
int l1 = parInt2 & 255;
int i2 = MathHelper.clamp_int((int) ((float) i + (float) (i1 - i) * parFloat1), 0, 255);
int j2 = MathHelper.clamp_int((int) ((float) j + (float) (j1 - j) * parFloat1), 0, 255);
int k2 = MathHelper.clamp_int((int) ((float) k + (float) (k1 - k) * parFloat1), 0, 255);
int l2 = MathHelper.clamp_int((int) ((float) l + (float) (l1 - l) * parFloat1), 0, 255);
return i2 << 24 | j2 << 16 | k2 << 8 | l2;
}
private static long bytesToMb(long bytes) {
return bytes / 1024L / 1024L;
}
}
private static long bytesToMb(long bytes) {
return bytes / 1024L / 1024L;
}
}

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,80 +105,81 @@ 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");
public static boolean anaglyphEnable;
public static int anaglyphField;
private Minecraft mc;
private final IResourceManager resourceManager;
private EaglercraftRandom random = new EaglercraftRandom();
private float farPlaneDistance;
public final ItemRenderer itemRenderer;
private final MapItemRenderer theMapItemRenderer;
private int rendererUpdateCount;
private Entity pointedEntity;
private MouseFilter mouseFilterXAxis = new MouseFilter();
private MouseFilter mouseFilterYAxis = new MouseFilter();
private float thirdPersonDistance = 4.0F;
public static boolean test = false;
/**+
* Third person distance temp
*/
private float thirdPersonDistanceTemp = 4.0F;
private float smoothCamYaw;
private float smoothCamPitch;
private float smoothCamFilterX;
private float smoothCamFilterY;
private float smoothCamPartialTicks;
private float fovModifierHand;
private float fovModifierHandPrev;
private float bossColorModifier;
private float bossColorModifierPrev;
private boolean cloudFog;
private boolean renderHand = true;
private boolean drawBlockOutline = true;
/**+
* Previous frame time in milliseconds
*/
private long prevFrameTime = Minecraft.getSystemTime();
private long renderEndNanoTime;
private final DynamicTexture lightmapTexture;
private final int[] lightmapColors;
private final ResourceLocation locationLightMap;
private boolean lightmapUpdateNeeded;
private float torchFlickerX;
private float torchFlickerDX;
private int rainSoundCounter;
private float[] rainXCoords = new float[1024];
private float[] rainYCoords = new float[1024];
/**+
* Fog color buffer
*/
private FloatBuffer fogColorBuffer = GLAllocation.createDirectFloatBuffer(16);
private float fogColorRed;
private float fogColorGreen;
private float fogColorBlue;
private float fogColor2;
private float fogColor1;
private int debugViewDirection = 0;
private boolean debugView = false;
private double cameraZoom = 1.0D;
private double cameraYaw;
private double cameraPitch;
private int frameCount;
public GameOverlayFramebuffer overlayFramebuffer;
public EntityRenderer(Minecraft mcIn, IResourceManager resourceManagerIn) {
this.frameCount = 0;
this.mc = mcIn;
this.resourceManager = resourceManagerIn;
this.itemRenderer = mcIn.getItemRenderer();
this.theMapItemRenderer = new MapItemRenderer(mcIn.getTextureManager());
this.lightmapTexture = new DynamicTexture(16, 16);
this.locationLightMap = mcIn.getTextureManager().getDynamicTextureLocation("lightMap", this.lightmapTexture);
this.lightmapColors = this.lightmapTexture.getTextureData();
this.overlayFramebuffer = new GameOverlayFramebuffer();
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");
public static boolean anaglyphEnable;
public static int anaglyphField;
private Minecraft mc;
private final IResourceManager resourceManager;
private EaglercraftRandom random = new EaglercraftRandom();
private float farPlaneDistance;
public final ItemRenderer itemRenderer;
private final MapItemRenderer theMapItemRenderer;
private int rendererUpdateCount;
private Entity pointedEntity;
private MouseFilter mouseFilterXAxis = new MouseFilter();
private MouseFilter mouseFilterYAxis = new MouseFilter();
private float thirdPersonDistance = 4.0F;
public static boolean test = false;
/**+
* Third person distance temp
*/
private float thirdPersonDistanceTemp = 4.0F;
private float smoothCamYaw;
private float smoothCamPitch;
private float smoothCamFilterX;
private float smoothCamFilterY;
private float smoothCamPartialTicks;
private float fovModifierHand;
private float fovModifierHandPrev;
private float bossColorModifier;
private float bossColorModifierPrev;
private boolean cloudFog;
private boolean renderHand = true;
private boolean drawBlockOutline = true;
/**+
* Previous frame time in milliseconds
*/
private long prevFrameTime = Minecraft.getSystemTime();
private long renderEndNanoTime;
private final DynamicTexture lightmapTexture;
private final int[] lightmapColors;
private final ResourceLocation locationLightMap;
private boolean lightmapUpdateNeeded;
private float torchFlickerX;
private float torchFlickerDX;
private int rainSoundCounter;
private float[] rainXCoords = new float[1024];
private float[] rainYCoords = new float[1024];
/**+
* Fog color buffer
*/
private FloatBuffer fogColorBuffer = GLAllocation.createDirectFloatBuffer(16);
private float fogColorRed;
private float fogColorGreen;
private float fogColorBlue;
private float fogColor2;
private float fogColor1;
private int debugViewDirection = 0;
private boolean debugView = false;
private double cameraZoom = 1.0D;
private double cameraYaw;
private double cameraPitch;
private int frameCount;
public GameOverlayFramebuffer overlayFramebuffer;
public EntityRenderer(Minecraft mcIn, IResourceManager resourceManagerIn) {
this.frameCount = 0;
this.mc = mcIn;
this.resourceManager = resourceManagerIn;
this.itemRenderer = mcIn.getItemRenderer();
this.theMapItemRenderer = new MapItemRenderer(mcIn.getTextureManager());
this.lightmapTexture = new DynamicTexture(16, 16);
this.locationLightMap = mcIn.getTextureManager().getDynamicTextureLocation("lightMap", this.lightmapTexture);
this.lightmapColors = this.lightmapTexture.getTextureData();
this.overlayFramebuffer = new GameOverlayFramebuffer();
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.matrixMode(GL_TEXTURE);
@ -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) {}
@ -853,67 +850,67 @@ public class EntityRenderer implements IResourceManagerReloadListener {
}
}
this.mc.mcProfiler.endSection();
if (!this.mc.skipRenderWorld) {
anaglyphEnable = this.mc.gameSettings.anaglyph;
final ScaledResolution scaledresolution = new ScaledResolution(this.mc);
int l = scaledresolution.getScaledWidth();
int i1 = scaledresolution.getScaledHeight();
final int j1 = Mouse.getX() * l / this.mc.displayWidth;
final int k1 = i1 - Mouse.getY() * i1 / this.mc.displayHeight - 1;
int l1 = this.mc.gameSettings.limitFramerate;
if (this.mc.theWorld != null) {
this.mc.mcProfiler.startSection("level");
int i = Math.min(Minecraft.getDebugFPS(), l1);
i = Math.max(i, 60);
long j = System.nanoTime() - parLong1;
long k = Math.max((long) (1000000000 / i / 4) - j, 0L);
this.renderWorld(parFloat1, System.nanoTime() + k);
this.renderEndNanoTime = System.nanoTime();
this.mc.mcProfiler.endStartSection("gui");
if (!this.mc.gameSettings.hideGUI || this.mc.currentScreen != null) {
GlStateManager.alphaFunc(GL_GREATER, 0.1F);
long framebufferAge = this.overlayFramebuffer.getAge();
if (framebufferAge == -1l || framebufferAge > (Minecraft.getDebugFPS() < 25 ? 125l : 75l)) {
this.overlayFramebuffer.beginRender(mc.displayWidth, mc.displayHeight);
GlStateManager.colorMask(true, true, true, true);
GlStateManager.clearColor(0.0f, 0.0f, 0.0f, 0.0f);
GlStateManager.clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
GlStateManager.enableOverlayFramebufferBlending();
this.mc.ingameGUI.renderGameOverlay(parFloat1);
GlStateManager.disableOverlayFramebufferBlending();
this.overlayFramebuffer.endRender();
}
this.mc.mcProfiler.endSection();
if (!this.mc.skipRenderWorld) {
anaglyphEnable = this.mc.gameSettings.anaglyph;
final ScaledResolution scaledresolution = new ScaledResolution(this.mc);
int l = scaledresolution.getScaledWidth();
int i1 = scaledresolution.getScaledHeight();
final int j1 = Mouse.getX() * l / this.mc.displayWidth;
final int k1 = i1 - Mouse.getY() * i1 / this.mc.displayHeight - 1;
int l1 = this.mc.gameSettings.limitFramerate;
if (this.mc.theWorld != null) {
this.mc.mcProfiler.startSection("level");
int i = Math.min(Minecraft.getDebugFPS(), l1);
i = Math.max(i, 60);
long j = System.nanoTime() - parLong1;
long k = Math.max((long) (1000000000 / i / 4) - j, 0L);
this.renderWorld(parFloat1, System.nanoTime() + k);
this.renderEndNanoTime = System.nanoTime();
this.mc.mcProfiler.endStartSection("gui");
if (!this.mc.gameSettings.hideGUI || this.mc.currentScreen != null) {
GlStateManager.alphaFunc(GL_GREATER, 0.1F);
long framebufferAge = this.overlayFramebuffer.getAge();
if (framebufferAge == -1l || framebufferAge > (Minecraft.getDebugFPS() < 25 ? 125l : 75l)) {
this.overlayFramebuffer.beginRender(mc.displayWidth, mc.displayHeight);
GlStateManager.colorMask(true, true, true, true);
GlStateManager.clearColor(0.0f, 0.0f, 0.0f, 0.0f);
GlStateManager.clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
GlStateManager.enableOverlayFramebufferBlending();
this.mc.ingameGUI.renderGameOverlay(parFloat1);
GlStateManager.disableOverlayFramebufferBlending();
this.overlayFramebuffer.endRender();
}
this.setupOverlayRendering();
GlStateManager.enableBlend();
if (Minecraft.isFancyGraphicsEnabled()) {
this.mc.ingameGUI.renderVignette(parFloat1, l, i1);
}
this.mc.ingameGUI.renderGameOverlayCrosshairs(l, i1);
GlStateManager.bindTexture(this.overlayFramebuffer.getTexture());
GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
GlStateManager.disableAlpha();
GlStateManager.disableDepth();
GlStateManager.depthMask(false);
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos(0.0D, (double) i1, -90.0D).tex(0.0D, 0.0D).endVertex();
worldrenderer.pos((double) l, (double) i1, -90.0D).tex(1.0D, 0.0D).endVertex();
worldrenderer.pos((double) l, 0.0D, -90.0D).tex(1.0D, 1.0D).endVertex();
worldrenderer.pos(0.0D, 0.0D, -90.0D).tex(0.0D, 1.0D).endVertex();
tessellator.draw();
GlStateManager.depthMask(true);
GlStateManager.enableDepth();
GlStateManager.enableAlpha();
GlStateManager.disableBlend();
if (this.mc.gameSettings.hudPlayer) { // give the player model HUD good fps
this.mc.ingameGUI.drawEaglerPlayerOverlay(l - 3, 3, parFloat1);
}
}
this.setupOverlayRendering();
GlStateManager.enableBlend();
if (Minecraft.isFancyGraphicsEnabled()) {
this.mc.ingameGUI.renderVignette(parFloat1, l, i1);
}
this.mc.ingameGUI.renderGameOverlayCrosshairs(l, i1);
GlStateManager.bindTexture(this.overlayFramebuffer.getTexture());
GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
GlStateManager.disableAlpha();
GlStateManager.disableDepth();
GlStateManager.depthMask(false);
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos(0.0D, (double) i1, -90.0D).tex(0.0D, 0.0D).endVertex();
worldrenderer.pos((double) l, (double) i1, -90.0D).tex(1.0D, 0.0D).endVertex();
worldrenderer.pos((double) l, 0.0D, -90.0D).tex(1.0D, 1.0D).endVertex();
worldrenderer.pos(0.0D, 0.0D, -90.0D).tex(0.0D, 1.0D).endVertex();
tessellator.draw();
GlStateManager.depthMask(true);
GlStateManager.enableDepth();
GlStateManager.enableAlpha();
GlStateManager.disableBlend();
if (this.mc.gameSettings.hudPlayer) { // give the player model HUD good fps
this.mc.ingameGUI.drawEaglerPlayerOverlay(l - 3, 3, parFloat1);
}
}
this.mc.mcProfiler.endSection();
} else {
@ -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 &&
@ -1859,4 +1858,4 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
return "" + Minecraft.getDebugFPS() + "fps | C: " + j + "/" + i + ", E: " + this.countEntitiesRendered + "+" + k + ", " + renderDispatcher.getDebugInfo();
}
}
}

View File

@ -296,7 +296,6 @@ public abstract class Render<T extends Entity> {
public FontRenderer getFontRendererFromRenderManager() {
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);
}
}

View File

@ -47,14 +47,14 @@ public class WorldProviderHell extends WorldProvider {
protected void generateLightBrightnessTable() {
long framebufferAge = Minecraft.getMinecraft().entityRenderer.overlayFramebuffer.getAge();
if (framebufferAge == -1l || framebufferAge > (Minecraft.getDebugFPS() < 25 ? 125l : 75l)) {
float f = 0.1F;
float f = 0.1F;
for (int i = 0; i <= 15; ++i) {
float f1 = 1.0F - (float) i / 15.0F;
this.lightBrightnessTable[i] = (1.0F - f1) / (f1 * 3.0F + 1.0F) * (1.0F - f) + f;
for (int i = 0; i <= 15; ++i) {
float f1 = 1.0F - (float) i / 15.0F;
this.lightBrightnessTable[i] = (1.0F - f1) / (f1 * 3.0F + 1.0F) * (1.0F - f) + f;
}
}
}
}
/**+
* Returns 'true' if in the "main surface world", but 'false' if