Port to newest ver.

This commit is contained in:
UnknownUser1789 2023-01-19 00:23:31 +00:00
parent 41505bc538
commit e6baaedb99
13 changed files with 2278633 additions and 96586 deletions

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -6,6 +6,7 @@ import java.util.List;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.setting.BooleanSetting;
import dev.resent.util.misc.FuncUtils;
import net.lax1dude.eaglercraft.v1_8.Keyboard;
public class CPS extends RenderModule {
@ -25,7 +26,7 @@ public class CPS extends RenderModule {
public BooleanSetting tshadow = new BooleanSetting("Text shadow", "", true);
public int getWidth() {
return mc.fontRendererObj.getStringWidth("[00 CPS]") + 4;
return mc.fontRendererObj.getStringWidth("[00 | 00]") + 4;
}
public int getHeight() {
@ -63,13 +64,13 @@ public class CPS extends RenderModule {
public int getLMB() {
final long time = System.currentTimeMillis();
this.clicksLMB.removeIf(aLong -> aLong + 1000 < time);
FuncUtils.removeIf(clicksLMB, aLong -> aLong + 1000 < time);
return this.clicksLMB.size();
}
public int getRMB() {
final long time = System.currentTimeMillis();
this.clicksRMB.removeIf(aLong -> aLong + 1000 < time);
FuncUtils.removeIf(clicksRMB, aLong -> aLong + 1000 < time);
return this.clicksRMB.size();
}

View File

@ -4,7 +4,6 @@ import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.setting.BooleanSetting;
import dev.resent.setting.ModeSetting;
import dev.resent.util.misc.CPSUtils;
import dev.resent.util.render.RainbowUtil;
import dev.resent.util.render.RenderUtils;
import net.lax1dude.eaglercraft.v1_8.Keyboard;

View File

@ -1,18 +1,15 @@
package net.minecraft.client;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_BACK;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_COLOR_BUFFER_BIT;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_DEPTH_BUFFER_BIT;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_GREATER;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_LEQUAL;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_MAX_TEXTURE_SIZE;
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.ui.ClickGUI;
import dev.resent.ui.PreGUI;
import dev.resent.util.misc.W;
import java.io.IOException;
import java.io.InputStream;
import java.text.DecimalFormat;
@ -21,6 +18,14 @@ 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.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;
@ -156,7 +161,6 @@ 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

@ -1,17 +1,30 @@
package net.minecraft.client.gui;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_ONE_MINUS_DST_COLOR;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_ONE_MINUS_SRC_ALPHA;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_ONE_MINUS_SRC_COLOR;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_SRC_ALPHA;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerTextureAtlasSprite;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import dev.resent.Resent;
import dev.resent.animation.SimpleAnimation;
import dev.resent.module.base.Mod;
import dev.resent.module.base.ModManager;
import dev.resent.module.base.RenderModule;
import dev.resent.module.impl.misc.Crosshair;
import dev.resent.ui.HUDConfigScreen;
import dev.resent.util.misc.W;
import dev.resent.util.render.Color;
import dev.resent.util.render.RenderUtils;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerTextureAtlasSprite;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.OpenGlHelper;
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
@ -73,7 +86,7 @@ public class GuiIngame extends Gui {
private static final ResourceLocation pumpkinBlurTexPath = new ResourceLocation("textures/misc/pumpkinblur.png");
private final EaglercraftRandom rand = new EaglercraftRandom();
private final Minecraft mc;
private final RenderItem itemRenderer;
public static RenderItem itemRenderer;
private final GuiNewChat persistantChatGUI;
private int updateCounter;
/**+
@ -111,7 +124,7 @@ public class GuiIngame extends Gui {
public GuiIngame(Minecraft mcIn) {
this.mc = mcIn;
this.itemRenderer = mcIn.getRenderItem();
itemRenderer = mcIn.getRenderItem();
this.overlayDebug = new GuiOverlayDebug(mcIn);
this.spectatorGui = new GuiSpectator(mcIn);
this.persistantChatGUI = new GuiNewChat(mcIn);
@ -277,7 +290,7 @@ public class GuiIngame extends Gui {
ScoreObjective scoreobjective1 = scoreobjective != null ? scoreobjective
: scoreboard.getObjectiveInDisplaySlot(1);
if (scoreobjective1 != null) {
if (scoreobjective1 != null && W.scoreboard().isEnabled()) {
this.renderScoreboard(scoreobjective1, scaledresolution);
}
@ -302,6 +315,14 @@ public class GuiIngame extends Gui {
this.overlayPlayerList.renderPlayerlist(i, scoreboard, scoreobjective1);
}
for (Mod m : Resent.INSTANCE.modManager.modules) {
if (m.isEnabled() && (m instanceof RenderModule)) {
if (!(mc.currentScreen instanceof HUDConfigScreen)) {
((RenderModule) m).draw();
}
}
}
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableLighting();
GlStateManager.enableAlpha();
@ -314,10 +335,18 @@ public class GuiIngame extends Gui {
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR, 1, 0);
GlStateManager.enableAlpha();
if (Minecraft.getMinecraft().pointedEntity != null && ModManager.crosshair.isEnabled()){
GlStateManager.color(RenderUtils.getColorWithoutRGB(Crosshair.color).getRed(), RenderUtils.getColorWithoutRGB(Crosshair.color).getGreen(), RenderUtils.getColorWithoutRGB(Crosshair.color).getBlue());
GlStateManager.disableAlpha();
}
this.drawTexturedModalRect(scaledResWidth / 2 - 7, scaledResHeight / 2 - 7, 0, 0, 16, 16);
}
}
public SimpleAnimation simpleAnimation = new SimpleAnimation(0.0F);
protected void renderTooltip(ScaledResolution sr, float partialTicks) {
if (this.mc.getRenderViewEntity() instanceof EntityPlayer) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
@ -326,9 +355,19 @@ public class GuiIngame extends Gui {
int i = sr.getScaledWidth() / 2;
float f = this.zLevel;
this.zLevel = -90.0F;
this.drawTexturedModalRect(i - 91, sr.getScaledHeight() - 22, 0, 0, 182, 22);
this.drawTexturedModalRect(i - 91 - 1 + entityplayer.inventory.currentItem * 20,
simpleAnimation.setAnimation(entityplayer.inventory.currentItem * 20, ModManager.hotbar.getSpeed());
int itemX = i - 90 + ((int) simpleAnimation.getValue());
if(!ModManager.hotbar.isEnabled()){
this.drawTexturedModalRect(i - 91, sr.getScaledHeight() - 22, 0, 0, 182, 22);
this.drawTexturedModalRect(i - 91 - 1 + entityplayer.inventory.currentItem * 20,
sr.getScaledHeight() - 22 - 1, 0, 22, 24, 22);
}else {
drawRect(itemX, sr.getScaledHeight() - 21, itemX + 24, sr.getScaledHeight(), new Color(230, 230, 230, 180).getRGB());
}
this.zLevel = f;
GlStateManager.enableRescaleNormal();
GlStateManager.enableBlend();
@ -504,6 +543,7 @@ public class GuiIngame extends Gui {
int l = parScaledResolution.getScaledWidth() - b0 + 2;
drawRect(k1 - 2, k, l, k + this.getFontRenderer().FONT_HEIGHT, 1342177280);
this.getFontRenderer().drawString(s1, k1, k, 553648127);
if (W.scoreboard().numbers.getValue())
this.getFontRenderer().drawString(s2, l - this.getFontRenderer().getStringWidth(s2), k, 553648127);
if (j == arraylist1.size()) {
String s3 = parScoreObjective.getDisplayName();
@ -881,12 +921,12 @@ public class GuiIngame extends Gui {
GlStateManager.translate((float) (-(xPos + 8)), (float) (-(yPos + 12)), 0.0F);
}
this.itemRenderer.renderItemAndEffectIntoGUI(itemstack, xPos, yPos);
itemRenderer.renderItemAndEffectIntoGUI(itemstack, xPos, yPos);
if (f > 0.0F) {
GlStateManager.popMatrix();
}
this.itemRenderer.renderItemOverlays(this.mc.fontRendererObj, itemstack, xPos, yPos);
itemRenderer.renderItemOverlays(this.mc.fontRendererObj, itemstack, xPos, yPos);
}
}

View File

@ -2,8 +2,6 @@ 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;
@ -12,6 +10,10 @@ 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;
@ -43,31 +45,30 @@ 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;
private final Minecraft mc;
private final FontRenderer fontRenderer;
public GuiOverlayDebug(Minecraft mc) {
this.mc = mc;
this.fontRenderer = mc.fontRendererObj;
}
public GuiOverlayDebug(Minecraft mc) {
this.mc = mc;
this.fontRenderer = mc.fontRendererObj;
}
public void renderDebugInfo(ScaledResolution scaledResolutionIn) {
int ww = scaledResolutionIn.getScaledWidth();
@ -84,147 +85,171 @@ public class GuiOverlayDebug extends Gui {
} else {
int i = 2;
if (this.mc.gameSettings.hudFps) {
drawFPS(2, i);
i += 9;
}
if (this.mc.gameSettings.hudFps) {
drawFPS(2, i);
i += 9;
}
if (this.mc.gameSettings.hudCoords) {
drawXYZ(2, i);
}
}
if (this.mc.currentScreen == null || !(this.mc.currentScreen instanceof GuiChat)) {
if (this.mc.gameSettings.hudStats) {
drawStatsHUD(ww - 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.hudWorld) {
drawWorldHUD(2, hh - 2);
}
}
if (this.mc.gameSettings.hudWorld) {
drawWorldHUD(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.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();
}
}
this.mc.mcProfiler.endSection();
}
this.mc.mcProfiler.endSection();
}
private void drawFPS(int x, int y) {
this.fontRenderer.drawStringWithShadow(this.mc.renderGlobal.getDebugInfoShort(), x, y, 0xFFFFFF);
}
private void drawFPS(int x, int y) {
this.fontRenderer.drawStringWithShadow(this.mc.renderGlobal.getDebugInfoShort(), x, y, 0xFFFFFF);
}
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 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 drawStatsHUD(int x, int y) {
int i = 9;
private void drawStatsHUD(int x, int y) {
int i = 9;
String line = "Walk: " + EnumChatFormatting.YELLOW + HString.format("%.2f", mc.thePlayer.getAIMoveSpeed()) + EnumChatFormatting.WHITE + " Flight: " + (mc.thePlayer.capabilities.allowFlying ? ("" + EnumChatFormatting.YELLOW + mc.thePlayer.capabilities.getFlySpeed()) : EnumChatFormatting.RED + "No");
int 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 = "Food: " + EnumChatFormatting.YELLOW + mc.thePlayer.getFoodStats().getFoodLevel() + EnumChatFormatting.WHITE + ", Sat: " + EnumChatFormatting.YELLOW + HString.format("%.1f", mc.thePlayer.getFoodStats().getSaturationLevel());
lw = fontRenderer.getStringWidth(line);
this.fontRenderer.drawStringWithShadow(line, x - lw, y - i, 0xFFFFFF);
i += 11;
line = "Food: " + EnumChatFormatting.YELLOW + mc.thePlayer.getFoodStats().getFoodLevel()
+ EnumChatFormatting.WHITE + ", Sat: " + EnumChatFormatting.YELLOW
+ HString.format("%.1f", mc.thePlayer.getFoodStats().getSaturationLevel());
lw = fontRenderer.getStringWidth(line);
this.fontRenderer.drawStringWithShadow(line, x - lw, y - i, 0xFFFFFF);
i += 11;
line = "Amr: " + EnumChatFormatting.YELLOW + mc.thePlayer.getTotalArmorValue() + EnumChatFormatting.WHITE + ", Health: " + EnumChatFormatting.RED + HString.format("%.1f", mc.thePlayer.getHealth());
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;
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;
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);
}
}
}
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);
}
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);
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);
// TODO: why does desktop JRE not apply "GMT" correctly?
final Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"), 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);
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);
// TODO: why does desktop JRE not apply "GMT" correctly?
final Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"), Locale.ENGLISH);
String timeString = EnumChatFormatting.WHITE + "Day " + ((totalTicks + 30000l) / 24000l) + " (" + EnumChatFormatting.YELLOW + (this.mc.gameSettings.hud24h ? SDFTwentyFour : SDFTwelve).format(cal.getTime()) + EnumChatFormatting.WHITE + ")";
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);
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);
String timeString = EnumChatFormatting.WHITE + "Day " + ((totalTicks + 30000l) / 24000l) + " ("
+ EnumChatFormatting.YELLOW
+ (this.mc.gameSettings.hud24h ? SDFTwentyFour : SDFTwelve).format(cal.getTime())
+ 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;
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);
float temp = biome.getFloatTemperature(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;
String tempString = "Temp: " + ((blockLight > 11 || temp > 0.15f) ? EnumChatFormatting.YELLOW : EnumChatFormatting.AQUA) + HString.format("%.2f", temp) + EnumChatFormatting.WHITE;
float temp = biome.getFloatTemperature(blockpos);
String tempString = "Temp: "
+ ((blockLight > 11 || temp > 0.15f) ? EnumChatFormatting.YELLOW : EnumChatFormatting.AQUA)
+ HString.format("%.2f", temp) + EnumChatFormatting.WHITE;
this.fontRenderer.drawStringWithShadow(timeString, x, y - 30, 0xFFFFFF);
this.fontRenderer.drawStringWithShadow("Biome: " + EnumChatFormatting.AQUA + biome.biomeName, x, y - 19,
@ -232,221 +257,247 @@ public class GuiOverlayDebug extends Gui {
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();
}
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 void renderDebugInfoRight(ScaledResolution parScaledResolution) {
List list = this.getDebugInfoRight();
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() });
}
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);
}
}
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";
}
}
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) }));
}
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() });
}
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()) }));
}
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";
}
return arraylist;
}
}
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) }));
}
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())));
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()) }));
}
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);
}
}
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;
}
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);
arraylist.add(((IProperty) entry.getKey()).getName() + ": " + s);
}
}
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);
}
return arraylist;
}
}
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 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);
GlStateManager.enableDepth();
}
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 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));
}
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_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;
}
GlStateManager.enableDepth();
}
private static long bytesToMb(long bytes) {
return bytes / 1024L / 1024L;
}
}
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;
}
}

View File

@ -546,7 +546,7 @@ public class EntityRenderer implements IResourceManagerReloadListener {
}
this.hurtCameraEffect(partialTicks);
if (this.mc.gameSettings.viewBobbing) {
if (this.mc.gameSettings.viewBobbing && !ModManager.minimalViewBobbing.isEnabled()) {
this.setupViewBobbing(partialTicks);
}