Fix some things

This commit is contained in:
catfoolyou 2025-01-31 10:52:44 -05:00
parent b458ce2332
commit 09fbf747ae
22 changed files with 417 additions and 407 deletions

View File

@ -19,7 +19,7 @@ public class ChatAllowedCharacters
* Load the font.txt resource file, that is on UTF-8 format. This file contains the characters that minecraft can * Load the font.txt resource file, that is on UTF-8 format. This file contains the characters that minecraft can
* render Strings on screen. * render Strings on screen.
*/ */
private static String getAllowedCharacters() static String getAllowedCharacters()
{ {
String var0 = ""; String var0 = "";

View File

@ -44,14 +44,14 @@ public class DefaultResourcePack implements ResourcePack
} }
else else
{ {
//throw new FileNotFoundException(par1TextureLocation.getResourcePath()); throw new FileNotFoundException("Something is fuck: " + par1TextureLocation.toString() + "I have no idea what the hell this is"); // FIX THIS SHIT
} }
} }
} }
private InputStream getResourceStream(TextureLocation par1TextureLocation) private InputStream getResourceStream(TextureLocation par1TextureLocation)
{ {
return DefaultResourcePack.class.getResourceAsStream("/assets/minecraft/" + par1TextureLocation.getResourcePath()); return DefaultResourcePack.class.getResourceAsStream("/assets/minecraft/" + par1TextureLocation);
} }
public void addResourceFile(String par1Str, File par2File) public void addResourceFile(String par1Str, File par2File)
@ -90,12 +90,12 @@ public class DefaultResourcePack implements ResourcePack
public MetadataSection getPackMetadata(MetadataSerializer par1MetadataSerializer, String par2Str) throws IOException public MetadataSection getPackMetadata(MetadataSerializer par1MetadataSerializer, String par2Str) throws IOException
{ {
return AbstractResourcePack.readMetadata(par1MetadataSerializer, DefaultResourcePack.class.getResourceAsStream("/" + (new TextureLocation("pack.mcmeta")).getResourcePath()), par2Str); return AbstractResourcePack.readMetadata(par1MetadataSerializer, DefaultResourcePack.class.getResourceAsStream("/" + (new TextureLocation("pack.mcmeta"))), par2Str);
} }
public BufferedImage getPackImage() throws IOException public BufferedImage getPackImage() throws IOException
{ {
return ImageIO.read(DefaultResourcePack.class.getResourceAsStream("/" + (new TextureLocation("pack.png")).getResourcePath())); return ImageIO.read(DefaultResourcePack.class.getResourceAsStream("/" + (new TextureLocation("pack.png"))));
} }
public String getPackName() public String getPackName()

View File

@ -15,12 +15,12 @@ public class EffectRenderer
/** Reference to the World object. */ /** Reference to the World object. */
protected World worldObj; protected World worldObj;
private List[] fxLayers = new List[4]; private List[] fxLayers = new List[4];
private TextureManager renderer; private RenderEngine renderer;
/** RNG. */ /** RNG. */
private Random rand = new Random(); private Random rand = new Random();
public EffectRenderer(World par1World, TextureManager par2TextureManager) public EffectRenderer(World par1World, RenderEngine par2TextureManager)
{ {
if (par1World != null) if (par1World != null)
{ {

View File

@ -1,6 +1,7 @@
package net.minecraft.src; package net.minecraft.src;
import net.lax1dude.eaglercraft.TextureLocation; import net.lax1dude.eaglercraft.TextureLocation;
import net.lax1dude.eaglercraft.adapter.Tessellator;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
public class EntityFootStepFX extends EntityFX public class EntityFootStepFX extends EntityFX
@ -8,9 +9,9 @@ public class EntityFootStepFX extends EntityFX
private static final TextureLocation field_110126_a = new TextureLocation("textures/particle/footprint.png"); private static final TextureLocation field_110126_a = new TextureLocation("textures/particle/footprint.png");
private int footstepAge; private int footstepAge;
private int footstepMaxAge; private int footstepMaxAge;
private TextureManager currentFootSteps; private RenderEngine currentFootSteps;
public EntityFootStepFX(TextureManager par1TextureManager, World par2World, double par3, double par5, double par7) public EntityFootStepFX(RenderEngine par1TextureManager, World par2World, double par3, double par5, double par7)
{ {
super(par2World, par3, par5, par7, 0.0D, 0.0D, 0.0D); super(par2World, par3, par5, par7, 0.0D, 0.0D, 0.0D);
this.currentFootSteps = par1TextureManager; this.currentFootSteps = par1TextureManager;

View File

@ -1,6 +1,7 @@
package net.minecraft.src; package net.minecraft.src;
import net.lax1dude.eaglercraft.TextureLocation; import net.lax1dude.eaglercraft.TextureLocation;
import net.lax1dude.eaglercraft.adapter.Tessellator;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
public class EntityLargeExplodeFX extends EntityFX public class EntityLargeExplodeFX extends EntityFX
@ -10,10 +11,10 @@ public class EntityLargeExplodeFX extends EntityFX
private int field_70584_aq; private int field_70584_aq;
/** The Rendering Engine. */ /** The Rendering Engine. */
private TextureManager theRenderEngine; private RenderEngine theRenderEngine;
private float field_70582_as; private float field_70582_as;
public EntityLargeExplodeFX(TextureManager par1TextureManager, World par2World, double par3, double par5, double par7, double par9, double par11, double par13) public EntityLargeExplodeFX(RenderEngine par1TextureManager, World par2World, double par3, double par5, double par7, double par9, double par11, double par13)
{ {
super(par2World, par3, par5, par7, 0.0D, 0.0D, 0.0D); super(par2World, par3, par5, par7, 0.0D, 0.0D, 0.0D);
this.theRenderEngine = par1TextureManager; this.theRenderEngine = par1TextureManager;

View File

@ -151,6 +151,8 @@ public class GameSettings
public boolean adderall = false; public boolean adderall = false;
public boolean showCoordinates;
public GameSettings(Minecraft par1Minecraft, File par2File) public GameSettings(Minecraft par1Minecraft, File par2File)
{ {
this.keyBindings = new KeyBinding[] {this.keyBindAttack, this.keyBindUseItem, this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindSneak, this.keyBindDrop, this.keyBindInventory, this.keyBindChat, this.keyBindPlayerList, this.keyBindPickBlock, this.keyBindCommand}; this.keyBindings = new KeyBinding[] {this.keyBindAttack, this.keyBindUseItem, this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindSneak, this.keyBindDrop, this.keyBindInventory, this.keyBindChat, this.keyBindPlayerList, this.keyBindPickBlock, this.keyBindCommand};
@ -164,6 +166,30 @@ public class GameSettings
this.loadOptions(); this.loadOptions();
} }
public GameSettings(Minecraft par1Minecraft) {
this.keyBindings = new KeyBinding[] { this.keyBindAttack, this.keyBindUseItem, this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindSneak, this.keyBindDrop, this.keyBindInventory,
this.keyBindChat, this.keyBindPlayerList, this.keyBindPickBlock};
this.difficulty = 1;
this.hideGUI = false;
this.thirdPersonView = 0;
this.showDebugInfo = false;
this.showDebugProfilerChart = true;
this.showCoordinates = true;
this.lastServer = "";
this.noclip = false;
this.smoothCamera = false;
this.debugCamEnable = false;
this.noclipRate = 1.0F;
this.debugCamRate = 1.0F;
this.fovSetting = 0.0F;
this.gammaSetting = 1.0F;
this.guiScale = 3;
this.particleSetting = 0;
this.language = "en_US";
this.mc = par1Minecraft;
this.loadOptions();
}
public GameSettings() public GameSettings()
{ {
this.keyBindings = new KeyBinding[] {this.keyBindAttack, this.keyBindUseItem, this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindSneak, this.keyBindDrop, this.keyBindInventory, this.keyBindChat, this.keyBindPlayerList, this.keyBindPickBlock, this.keyBindCommand}; this.keyBindings = new KeyBinding[] {this.keyBindAttack, this.keyBindUseItem, this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindSneak, this.keyBindDrop, this.keyBindInventory, this.keyBindChat, this.keyBindPlayerList, this.keyBindPickBlock, this.keyBindCommand};
@ -330,8 +356,8 @@ public class GameSettings
if (par1EnumOptions == EnumOptions.ANAGLYPH) if (par1EnumOptions == EnumOptions.ANAGLYPH)
{ {
this.anaglyph = !this.anaglyph; //this.anaglyph = !this.anaglyph;
this.mc.refreshResources(); //this.mc.refreshResources();
} }
if (par1EnumOptions == EnumOptions.FRAMERATE_LIMIT) if (par1EnumOptions == EnumOptions.FRAMERATE_LIMIT)

View File

@ -30,7 +30,7 @@ public class GuiIngameMenu extends GuiScreen
this.buttonList.add(var3 = new GuiButton(7, this.width / 2 + 2, this.height / 4 + 96 + var1, 98, 20, I18n.getString("menu.shareToLan"))); this.buttonList.add(var3 = new GuiButton(7, this.width / 2 + 2, this.height / 4 + 96 + var1, 98, 20, I18n.getString("menu.shareToLan")));
this.buttonList.add(new GuiButton(5, this.width / 2 - 100, this.height / 4 + 48 + var1, 98, 20, I18n.getString("gui.achievements"))); this.buttonList.add(new GuiButton(5, this.width / 2 - 100, this.height / 4 + 48 + var1, 98, 20, I18n.getString("gui.achievements")));
this.buttonList.add(new GuiButton(6, this.width / 2 + 2, this.height / 4 + 48 + var1, 98, 20, I18n.getString("gui.stats"))); this.buttonList.add(new GuiButton(6, this.width / 2 + 2, this.height / 4 + 48 + var1, 98, 20, I18n.getString("gui.stats")));
var3.enabled = this.mc.isSingleplayer() && !this.mc.getIntegratedServer().getPublic(); var3.enabled = false;
} }
/** /**

View File

@ -119,7 +119,7 @@ public class GuiOptions extends GuiScreen
if (par1GuiButton.id == 105) if (par1GuiButton.id == 105)
{ {
this.mc.gameSettings.saveOptions(); this.mc.gameSettings.saveOptions();
this.mc.displayGuiScreen(new GuiScreenTemporaryResourcePackSelect(this, this.options)); //this.mc.displayGuiScreen(new GuiScreenTemporaryResourcePackSelect(this, this.options));
} }
} }
} }

View File

@ -84,7 +84,7 @@ public class GuiShareToLan extends GuiScreen
else if (par1GuiButton.id == 101) else if (par1GuiButton.id == 101)
{ {
this.mc.displayGuiScreen((GuiScreen)null); this.mc.displayGuiScreen((GuiScreen)null);
String var2 = this.mc.getIntegratedServer().shareToLAN(EnumGameType.getByName(this.gameMode), this.allowCommands); String var2 = null; // this.mc.getIntegratedServer().shareToLAN(EnumGameType.getByName(this.gameMode), this.allowCommands);
ChatMessageComponent var3; ChatMessageComponent var3;
if (var2 != null) if (var2 != null)

View File

@ -46,7 +46,7 @@ class GuiSlotLanguage extends GuiSlot
Language var3 = (Language)this.field_77253_h.get(this.field_77251_g.get(par1)); Language var3 = (Language)this.field_77253_h.get(this.field_77251_g.get(par1));
GuiLanguage.func_135011_a(this.languageGui).setCurrentLanguage(var3); GuiLanguage.func_135011_a(this.languageGui).setCurrentLanguage(var3);
GuiLanguage.getGameSettings(this.languageGui).language = var3.getLanguageCode(); GuiLanguage.getGameSettings(this.languageGui).language = var3.getLanguageCode();
this.languageGui.mc.refreshResources(); //this.languageGui.mc.refreshResources(); // FIX THIS SHIT
this.languageGui.fontRenderer.setUnicodeFlag(GuiLanguage.func_135011_a(this.languageGui).isCurrentLocaleUnicode()); this.languageGui.fontRenderer.setUnicodeFlag(GuiLanguage.func_135011_a(this.languageGui).isCurrentLocaleUnicode());
this.languageGui.fontRenderer.setBidiFlag(GuiLanguage.func_135011_a(this.languageGui).isCurrentLanguageBidirectional()); this.languageGui.fontRenderer.setBidiFlag(GuiLanguage.func_135011_a(this.languageGui).isCurrentLanguageBidirectional());
GuiLanguage.getDoneButton(this.languageGui).displayString = I18n.getString("gui.done"); GuiLanguage.getDoneButton(this.languageGui).displayString = I18n.getString("gui.done");

View File

@ -1,15 +1,7 @@
package net.minecraft.src; package net.minecraft.src;
import net.lax1dude.eaglercraft.DefaultSkinRenderer; import net.lax1dude.eaglercraft.*;
import net.lax1dude.eaglercraft.EaglerAdapter; import net.lax1dude.eaglercraft.IntegratedServer;
import net.lax1dude.eaglercraft.EaglerProfile;
import net.lax1dude.eaglercraft.GuiScreenEditProfile;
import net.lax1dude.eaglercraft.GuiScreenSingleplayerConnecting;
import net.lax1dude.eaglercraft.GuiScreenSingleplayerLoading;
import net.lax1dude.eaglercraft.GuiScreenVSyncWarning;
//import net.lax1dude.eaglercraft.IntegratedServer;
import net.lax1dude.eaglercraft.IntegratedServerLAN;
import net.lax1dude.eaglercraft.WorkerNetworkManager;
import net.lax1dude.eaglercraft.adapter.Tessellator; import net.lax1dude.eaglercraft.adapter.Tessellator;
import net.lax1dude.eaglercraft.glemu.FixedFunctionShader; import net.lax1dude.eaglercraft.glemu.FixedFunctionShader;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
@ -18,6 +10,7 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.net.Proxy; import java.net.Proxy;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
@ -44,14 +37,9 @@ import org.lwjgl.util.glu.GLU;
public class Minecraft implements IPlayerUsage public class Minecraft implements IPlayerUsage
{ {
private static final TextureLocation locationMojangPng = new TextureLocation("textures/gui/title/mojang.png");
public static final boolean isRunningOnMac = Util.getOSType() == EnumOS.MACOS;
/** A 10MiB preallocation to ensure the heap is reasonably sized. */ /** A 10MiB preallocation to ensure the heap is reasonably sized. */
public static byte[] memoryReserve = new byte[10485760]; public static byte[] memoryReserve = new byte[10485760];
private static final List macDisplayModes = Lists.newArrayList(new DisplayMode[] {new DisplayMode(2560, 1600), new DisplayMode(2880, 1800)}); private static final List macDisplayModes = Lists.newArrayList(new DisplayMode[] {new DisplayMode(2560, 1600), new DisplayMode(2880, 1800)});
private final ILogAgent mcLogAgent;
private final File fileResourcepacks;
private ServerData currentServerData; private ServerData currentServerData;
/** The RenderEngine instance used by Minecraft */ /** The RenderEngine instance used by Minecraft */
@ -86,7 +74,6 @@ public class Minecraft implements IPlayerUsage
public EntityLivingBase renderViewEntity; public EntityLivingBase renderViewEntity;
public EntityLivingBase pointedEntityLiving; public EntityLivingBase pointedEntityLiving;
public EffectRenderer effectRenderer; public EffectRenderer effectRenderer;
private final Session session;
private boolean isGamePaused; private boolean isGamePaused;
/** The font renderer used for displaying and measuring text. */ /** The font renderer used for displaying and measuring text. */
@ -127,9 +114,7 @@ public class Minecraft implements IPlayerUsage
/** Mouse helper instance. */ /** Mouse helper instance. */
public MouseHelper mouseHelper; public MouseHelper mouseHelper;
public TexturePackList texturePackList; public TexturePackList texturePackList;
public final File mcDataDir;
private final File fileAssets;
private final String launchedVersion;
private ISaveFormat saveLoader; private ISaveFormat saveLoader;
/** /**
@ -184,6 +169,11 @@ public class Minecraft implements IPlayerUsage
*/ */
volatile boolean running = true; volatile boolean running = true;
public int chunkUpdates = 0;
public int chunkGeometryUpdates = 0;
public static int debugChunkUpdates = 0;
public static int debugChunkGeometryUpdates = 0;
/** String that shows the debug information */ /** String that shows the debug information */
public String debug = ""; public String debug = "";
@ -194,9 +184,17 @@ public class Minecraft implements IPlayerUsage
int fpsCounter; int fpsCounter;
long prevFrameTime = -1L; long prevFrameTime = -1L;
long secondTimer = 0l;
/** Profiler currently displayed in the debug screen pie chart */ /** Profiler currently displayed in the debug screen pie chart */
private String debugProfilerName = "root"; private String debugProfilerName = "root";
private int messageOnLoginCounter = 0;
public boolean lanState = false;
public boolean yeeState = false;
public boolean checkGLErrors = false;
public Minecraft() public Minecraft()
{ {
this.tempDisplayHeight = 480; this.tempDisplayHeight = 480;
@ -242,170 +240,252 @@ public class Minecraft implements IPlayerUsage
/** /**
* Starts the game: initializes the canvas, the title, the settings, etcetera. * Starts the game: initializes the canvas, the title, the settings, etcetera.
*/ */
private void startGame() throws LWJGLException public void startGame() {
{
this.gameSettings = new GameSettings(this, this.mcDataDir);
if (this.gameSettings.overrideHeight > 0 && this.gameSettings.overrideWidth > 0)
{
this.displayWidth = this.gameSettings.overrideWidth;
this.displayHeight = this.gameSettings.overrideHeight;
}
if (this.fullscreen)
{
Display.setFullscreen(true);
this.displayWidth = Display.getDisplayMode().getWidth();
this.displayHeight = Display.getDisplayMode().getHeight();
if (this.displayWidth <= 0)
{
this.displayWidth = 1;
}
if (this.displayHeight <= 0)
{
this.displayHeight = 1;
}
}
else
{
Display.setDisplayMode(new DisplayMode(this.displayWidth, this.displayHeight));
}
Display.setResizable(true);
Display.setTitle("Minecraft 1.6.4");
this.getLogAgent().logInfo("LWJGL Version: " + Sys.getVersion());
/*if (Util.getOSType() != EnumOS.MACOS)
{
try
{
Display.setIcon(new ByteBuffer[] {this.readImage(new File(this.fileAssets, "/icons/icon_16x16.png")), this.readImage(new File(this.fileAssets, "/icons/icon_32x32.png"))});
}
catch (IOException var5)
{
var5.printStackTrace();
}
}*/
try
{
Display.create((new PixelFormat()).withDepthBits(24));
}
catch (LWJGLException var4)
{
var4.printStackTrace();
try
{
Thread.sleep(1000L);
}
catch (InterruptedException var3)
{
;
}
if (this.fullscreen)
{
this.updateDisplayMode();
}
Display.create();
}
OpenGlHelper.initializeTextures(); OpenGlHelper.initializeTextures();
this.guiAchievement = new GuiAchievement(this); TextureManager.init();
this.metadataSerializer_.registerMetadataSectionType(new TextureMetadataSectionSerializer(), TextureMetadataSection.class); this.gameSettings = new GameSettings(this);
this.metadataSerializer_.registerMetadataSectionType(new FontMetadataSectionSerializer(), FontMetadataSection.class); this.texturePackList = new TexturePackList(this);
this.metadataSerializer_.registerMetadataSectionType(new AnimationMetadataSectionSerializer(), AnimationMetadataSection.class); this.renderEngine = new RenderEngine(this.texturePackList, this.gameSettings);
this.metadataSerializer_.registerMetadataSectionType(new PackMetadataSectionSerializer(), PackMetadataSection.class);
this.metadataSerializer_.registerMetadataSectionType(new LanguageMetadataSectionSerializer(), LanguageMetadataSection.class);
this.saveLoader = new AnvilSaveConverter(new File(this.mcDataDir, "saves"));
this.mcResourcePackRepository = new ResourcePackRepository(this.fileResourcepacks, this.mcDefaultResourcePack, this.metadataSerializer_, this.gameSettings);
this.mcResourceManager = new SimpleReloadableResourceManager(this.metadataSerializer_);
this.mcLanguageManager = new LanguageManager(this.metadataSerializer_, this.gameSettings.language);
this.mcResourceManager.registerReloadListener(this.mcLanguageManager);
this.refreshResources();
this.renderEngine = new TextureManager(this.mcResourceManager);
this.mcResourceManager.registerReloadListener(this.renderEngine);
this.sndManager = new SoundManager(this.mcResourceManager, this.gameSettings, this.fileAssets);
this.mcResourceManager.registerReloadListener(this.sndManager);
this.loadScreen();
this.fontRenderer = new FontRenderer(this.gameSettings, new TextureLocation("textures/font/ascii.png"), this.renderEngine, false);
if (this.gameSettings.language != null) this.loadScreen();
{
this.fontRenderer.setUnicodeFlag(this.mcLanguageManager.isCurrentLocaleUnicode()); ChatAllowedCharacters.getAllowedCharacters();
this.fontRenderer.setBidiFlag(this.mcLanguageManager.isCurrentLanguageBidirectional()); this.fontRenderer = new FontRenderer(this.gameSettings, "/font/default.png", this.renderEngine, false);
this.standardGalacticFontRenderer = new FontRenderer(this.gameSettings, "/font/alternate.png", this.renderEngine, false);
if (this.gameSettings.language != null) {
//StringTranslate.getInstance().setLanguage(this.gameSettings.language, false);
//this.fontRenderer.setUnicodeFlag(StringTranslate.getInstance().isUnicode());
//this.fontRenderer.setBidiFlag(StringTranslate.isBidirectional(this.gameSettings.language));
} }
this.standardGalacticFontRenderer = new FontRenderer(this.gameSettings, new TextureLocation("textures/font/ascii_sga.png"), this.renderEngine, false); this.loadScreen();
this.mcResourceManager.registerReloadListener(this.fontRenderer);
this.mcResourceManager.registerReloadListener(this.standardGalacticFontRenderer); ColorizerGrass.setGrassBiomeColorizer(this.renderEngine.getTextureContents("/misc/grasscolor.png"));
this.mcResourceManager.registerReloadListener(new GrassColorReloadListener()); ColorizerFoliage.setFoliageBiomeColorizer(this.renderEngine.getTextureContents("/misc/foliagecolor.png"));
this.mcResourceManager.registerReloadListener(new FoliageColorReloadListener());
RenderManager.instance.itemRenderer = new ItemRenderer(this);
this.entityRenderer = new EntityRenderer(this); this.entityRenderer = new EntityRenderer(this);
this.statFileWriter = new StatFileWriter(this.session, this.mcDataDir); RenderManager.instance = new RenderManager();
RenderManager.instance.itemRenderer = new ItemRenderer(this);
AchievementList.openInventory.setStatStringFormatter(new StatStringFormatKeyInv(this)); AchievementList.openInventory.setStatStringFormatter(new StatStringFormatKeyInv(this));
this.mouseHelper = new MouseHelper(); this.mouseHelper = new MouseHelper();
this.checkGLError("Pre startup"); this.checkGLError("Pre startup");
GL11.glEnable(GL11.GL_TEXTURE_2D); EaglerAdapter.glEnable(EaglerAdapter.GL_TEXTURE_2D);
GL11.glShadeModel(GL11.GL_SMOOTH); EaglerAdapter.glShadeModel(EaglerAdapter.GL_SMOOTH);
GL11.glClearDepth(1.0D); EaglerAdapter.glClearDepth(1.0F);
GL11.glEnable(GL11.GL_DEPTH_TEST); EaglerAdapter.glEnable(EaglerAdapter.GL_DEPTH_TEST);
GL11.glDepthFunc(GL11.GL_LEQUAL); EaglerAdapter.glDepthFunc(EaglerAdapter.GL_LEQUAL);
GL11.glEnable(GL11.GL_ALPHA_TEST); EaglerAdapter.glEnable(EaglerAdapter.GL_ALPHA_TEST);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); EaglerAdapter.glAlphaFunc(EaglerAdapter.GL_GREATER, 0.1F);
GL11.glCullFace(GL11.GL_BACK); EaglerAdapter.glCullFace(EaglerAdapter.GL_BACK);
GL11.glMatrixMode(GL11.GL_PROJECTION); EaglerAdapter.glMatrixMode(EaglerAdapter.GL_PROJECTION);
GL11.glLoadIdentity(); EaglerAdapter.glLoadIdentity();
GL11.glMatrixMode(GL11.GL_MODELVIEW); EaglerAdapter.glMatrixMode(EaglerAdapter.GL_MODELVIEW);
this.checkGLError("Startup"); this.checkGLError("Startup");
this.renderGlobal = new RenderGlobal(this); this.sndManager.loadSoundSettings(this.gameSettings);
this.renderEngine.loadTextureMap(TextureMap.locationBlocksTexture, new TextureMap(0, "textures/blocks")); this.renderGlobal = new RenderGlobal(this, this.renderEngine);
this.renderEngine.loadTextureMap(TextureMap.locationItemsTexture, new TextureMap(1, "textures/items")); this.renderEngine.refreshTextureMaps();
GL11.glViewport(0, 0, this.displayWidth, this.displayHeight); EaglerAdapter.glViewport(0, 0, this.displayWidth, this.displayHeight);
this.effectRenderer = new EffectRenderer(this.theWorld, this.renderEngine); this.effectRenderer = new EffectRenderer(this.theWorld, this.renderEngine);
this.checkGLError("Post startup"); this.checkGLError("Post startup");
this.guiAchievement = new GuiAchievement(this);
this.ingameGUI = new GuiIngame(this); this.ingameGUI = new GuiIngame(this);
if (this.serverName != null) ScaledResolution var2 = new ScaledResolution(this.gameSettings, this.displayWidth, this.displayHeight);
{ int var3 = var2.getScaledWidth();
this.displayGuiScreen(new GuiConnecting(new GuiMainMenu(), this, this.serverName, this.serverPort)); int var4 = var2.getScaledHeight();
EaglerAdapter.anisotropicPatch(EaglerAdapter.glNeedsAnisotropicFix());
EaglerProfile.loadFromStorage();
this.sndManager.playTheTitleMusic();
showIntroAnimation();
String s = EaglerAdapter.getServerToJoinOnLaunch();
GuiScreen scr;
if(s != null) {
scr = new GuiScreenEditProfile(new GuiConnecting(new GuiMainMenu(), this, new ServerData("Eaglercraft Server", s, false)));
}else {
scr = new GuiScreenEditProfile(new GuiMainMenu());
} }
else
{ if(!gameSettings.enableVsync && !gameSettings.hideVsyncWarning) {
this.displayGuiScreen(new GuiMainMenu()); scr = new GuiScreenVSyncWarning(scr);
} }
displayGuiScreen(scr);
this.loadingScreen = new LoadingScreenRenderer(this); this.loadingScreen = new LoadingScreenRenderer(this);
if (this.gameSettings.fullScreen && !this.fullscreen) if (this.gameSettings.fullScreen && !this.fullscreen) {
{
this.toggleFullscreen(); this.toggleFullscreen();
} }
byte[] b = EaglerAdapter.loadResourceBytes("adderall");
yeeState = b != null && (new String(b, StandardCharsets.UTF_8)).hashCode() == 508925104;
} }
public void refreshResources() private void showIntroAnimation() {
{ ScaledResolution var1 = new ScaledResolution(this.gameSettings, this.displayWidth, this.displayHeight);
ArrayList var1 = Lists.newArrayList(this.defaultResourcePacks); EaglerAdapter.glClearColor(1.0F, 1.0F, 1.0F, 1.0F);
Iterator var2 = this.mcResourcePackRepository.getRepositoryEntries().iterator(); EaglerAdapter.glDisable(EaglerAdapter.GL_ALPHA_TEST);
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_MODELVIEW);
EaglerAdapter.glLoadIdentity();
EaglerAdapter.glTranslatef(0.0F, 0.0F, -2000.0F);
EaglerAdapter.glViewport(0, 0, this.displayWidth, this.displayHeight);
EaglerAdapter.glDisable(EaglerAdapter.GL_LIGHTING);
EaglerAdapter.glEnable(EaglerAdapter.GL_TEXTURE_2D);
EaglerAdapter.glEnable(EaglerAdapter.GL_BLEND);
EaglerAdapter.glBlendFunc(EaglerAdapter.GL_SRC_ALPHA, EaglerAdapter.GL_ONE_MINUS_SRC_ALPHA);
EaglerAdapter.glDisable(EaglerAdapter.GL_FOG);
EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
while (var2.hasNext()) long t1 = EaglerAdapter.steadyTimeMillis();
{ for(int i = 0; i < 20; i++) {
ResourcePackRepositoryEntry var3 = (ResourcePackRepositoryEntry)var2.next(); this.displayWidth = EaglerAdapter.getCanvasWidth();
var1.add(var3.getResourcePack()); this.displayHeight = EaglerAdapter.getCanvasHeight();
EaglerAdapter.glViewport(0, 0, this.displayWidth, this.displayHeight);
var1 = new ScaledResolution(this.gameSettings, this.displayWidth, this.displayHeight);
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_PROJECTION);
EaglerAdapter.glLoadIdentity();
EaglerAdapter.glOrtho(0.0F, var1.getScaledWidth(), var1.getScaledHeight(), 0.0F, 1000.0F, 3000.0F);
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_MODELVIEW);
float f = ((float)(EaglerAdapter.steadyTimeMillis() - t1) / 333f);
EaglerAdapter.glClear(EaglerAdapter.GL_COLOR_BUFFER_BIT | EaglerAdapter.GL_DEPTH_BUFFER_BIT);
EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, MathHelper.clamp_float(1.0f - f, 0.0F, 1.0F));
this.renderEngine.bindTexture("%clamp%/title/eagtek.png");
EaglerAdapter.glPushMatrix();
float f1 = 1.0f + 0.025f * f * f;
EaglerAdapter.glTranslatef((var1.getScaledWidth() - 256) / 2, (var1.getScaledHeight() - 256) / 2, 0.0f);
EaglerAdapter.glTranslatef(-128.0f * (f1 - 1.0f), -128.0f * (f1 - 1.0f) , 0.0f);
EaglerAdapter.glScalef(f1, f1, 1.0f);
this.scaledTessellator(0, 0, 0, 0, 256, 256);
EaglerAdapter.glPopMatrix();
EaglerAdapter.glFlush();
updateDisplay();
long t = t1 + 17 + 17*i - EaglerAdapter.steadyTimeMillis();
if(t > 0) {
EaglerAdapter.sleep((int)t);
}
} }
this.mcLanguageManager.parseLanguageMetadata(var1); t1 = EaglerAdapter.steadyTimeMillis();
this.mcResourceManager.reloadResources(var1); for(int i = 0; i < 20; i++) {
this.displayWidth = EaglerAdapter.getCanvasWidth();
this.displayHeight = EaglerAdapter.getCanvasHeight();
EaglerAdapter.glViewport(0, 0, this.displayWidth, this.displayHeight);
var1 = new ScaledResolution(this.gameSettings, this.displayWidth, this.displayHeight);
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_PROJECTION);
EaglerAdapter.glLoadIdentity();
EaglerAdapter.glOrtho(0.0F, var1.getScaledWidth(), var1.getScaledHeight(), 0.0F, 1000.0F, 3000.0F);
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_MODELVIEW);
if (this.renderGlobal != null) float f = ((float)(EaglerAdapter.steadyTimeMillis() - t1) / 333f);
{
this.renderGlobal.loadRenderers(); EaglerAdapter.glClear(EaglerAdapter.GL_COLOR_BUFFER_BIT | EaglerAdapter.GL_DEPTH_BUFFER_BIT);
EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, MathHelper.clamp_float(f, 0.0F, 1.0F));
this.renderEngine.bindTexture("%blur%/title/mojang.png");
EaglerAdapter.glPushMatrix();
float f1 = 0.875f + 0.025f * (float)Math.sqrt(f);
EaglerAdapter.glTranslatef((var1.getScaledWidth() - 256) / 2, (var1.getScaledHeight() - 256) / 2, 0.0f);
EaglerAdapter.glTranslatef(-128.0f * (f1 - 1.0f), -128.0f * (f1 - 1.0f) , 0.0f);
EaglerAdapter.glScalef(f1, f1, 1.0f);
this.scaledTessellator(0, 0, 0, 0, 256, 256);
EaglerAdapter.glPopMatrix();
EaglerAdapter.glFlush();
updateDisplay();
long t = t1 + 17 + 17*i - EaglerAdapter.steadyTimeMillis();
if(t > 0) {
EaglerAdapter.sleep((int)t);
}
} }
EaglerAdapter.sleep(1600);
t1 = EaglerAdapter.steadyTimeMillis();
for(int i = 0; i < 21; i++) {
this.displayWidth = EaglerAdapter.getCanvasWidth();
this.displayHeight = EaglerAdapter.getCanvasHeight();
EaglerAdapter.glViewport(0, 0, this.displayWidth, this.displayHeight);
var1 = new ScaledResolution(this.gameSettings, this.displayWidth, this.displayHeight);
float f = ((float)(EaglerAdapter.steadyTimeMillis() - t1) / 340f);
EaglerAdapter.glClear(EaglerAdapter.GL_COLOR_BUFFER_BIT | EaglerAdapter.GL_DEPTH_BUFFER_BIT);
EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, MathHelper.clamp_float((1.0f - f), 0.0F, 1.0F));
this.renderEngine.bindTexture("%blur%/title/mojang.png");
EaglerAdapter.glPushMatrix();
float f1 = 0.9f + 0.025f * f * f;
EaglerAdapter.glTranslatef((var1.getScaledWidth() - 256) / 2, (var1.getScaledHeight() - 256) / 2, 0.0f);
EaglerAdapter.glTranslatef(-128.0f * (f1 - 1.0f), -128.0f * (f1 - 1.0f) , 0.0f);
EaglerAdapter.glScalef(f1, f1, 1.0f);
this.scaledTessellator(0, 0, 0, 0, 256, 256);
EaglerAdapter.glPopMatrix();
EaglerAdapter.glFlush();
updateDisplay();
long t = t1 + 17 + 17*i - EaglerAdapter.steadyTimeMillis();
if(t > 0) {
EaglerAdapter.sleep((int)t);
}
}
EaglerAdapter.glClear(EaglerAdapter.GL_COLOR_BUFFER_BIT | EaglerAdapter.GL_DEPTH_BUFFER_BIT);
EaglerAdapter.glFlush();
updateDisplay();
EaglerAdapter.sleep(100);
EaglerAdapter.glDisable(EaglerAdapter.GL_BLEND);
EaglerAdapter.glEnable(EaglerAdapter.GL_ALPHA_TEST);
EaglerAdapter.glAlphaFunc(EaglerAdapter.GL_GREATER, 0.1F);
while(EaglerAdapter.keysNext());
while(EaglerAdapter.mouseNext());
}
/**
* Displays a new screen.
*/
private void loadScreen() {
this.displayWidth = EaglerAdapter.getCanvasWidth();
this.displayHeight = EaglerAdapter.getCanvasHeight();
ScaledResolution var1 = new ScaledResolution(this.gameSettings, this.displayWidth, this.displayHeight);
EaglerAdapter.glColorMask(true, true, true, true);
EaglerAdapter.glClearColor(1.0F, 1.0F, 1.0F, 1.0F);
EaglerAdapter.glDisable(EaglerAdapter.GL_ALPHA_TEST);
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_PROJECTION);
EaglerAdapter.glLoadIdentity();
EaglerAdapter.glOrtho(0.0F, var1.getScaledWidth(), var1.getScaledHeight(), 0.0F, 1000.0F, 3000.0F);
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_MODELVIEW);
EaglerAdapter.glLoadIdentity();
EaglerAdapter.glTranslatef(0.0F, 0.0F, -2000.0F);
EaglerAdapter.glViewport(0, 0, this.displayWidth, this.displayHeight);
EaglerAdapter.glClear(EaglerAdapter.GL_COLOR_BUFFER_BIT | EaglerAdapter.GL_DEPTH_BUFFER_BIT);
EaglerAdapter.glDisable(EaglerAdapter.GL_LIGHTING);
EaglerAdapter.glEnable(EaglerAdapter.GL_TEXTURE_2D);
EaglerAdapter.glDisable(EaglerAdapter.GL_FOG);
EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.renderEngine.bindTexture("%clamp%/title/eagtek.png");
short var3 = 256;
short var4 = 256;
this.scaledTessellator((var1.getScaledWidth() - var3) / 2, (var1.getScaledHeight() - var4) / 2, 0, 0, var3, var4);
EaglerAdapter.glDisable(EaglerAdapter.GL_LIGHTING);
EaglerAdapter.glDisable(EaglerAdapter.GL_FOG);
EaglerAdapter.glEnable(EaglerAdapter.GL_ALPHA_TEST);
EaglerAdapter.glAlphaFunc(EaglerAdapter.GL_GREATER, 0.1F);
EaglerAdapter.glFlush();
updateDisplay();
EaglerAdapter.optimize();
} }
private void addDefaultResourcePack() private void addDefaultResourcePack()
@ -485,41 +565,6 @@ public class Minecraft implements IPlayerUsage
/** /**
* Displays a new screen. * Displays a new screen.
*/ */
private void loadScreen() throws LWJGLException
{
ScaledResolution var1 = new ScaledResolution(this.gameSettings, this.displayWidth, this.displayHeight);
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glOrtho(0.0D, var1.getScaledWidth_double(), var1.getScaledHeight_double(), 0.0D, 1000.0D, 3000.0D);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glLoadIdentity();
GL11.glTranslatef(0.0F, 0.0F, -2000.0F);
GL11.glViewport(0, 0, this.displayWidth, this.displayHeight);
GL11.glClearColor(0.0F, 0.0F, 0.0F, 0.0F);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_FOG);
this.renderEngine.bindTexture(locationMojangPng);
Tessellator var2 = Tessellator.instance;
var2.startDrawingQuads();
var2.setColorOpaque_I(16777215);
var2.addVertexWithUV(0.0D, (double)this.displayHeight, 0.0D, 0.0D, 0.0D);
var2.addVertexWithUV((double)this.displayWidth, (double)this.displayHeight, 0.0D, 0.0D, 0.0D);
var2.addVertexWithUV((double)this.displayWidth, 0.0D, 0.0D, 0.0D, 0.0D);
var2.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
var2.draw();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
var2.setColorOpaque_I(16777215);
short var3 = 256;
short var4 = 256;
this.scaledTessellator((var1.getScaledWidth() - var3) / 2, (var1.getScaledHeight() - var4) / 2, 0, 0, var3, var4);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_FOG);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
Display.update();
}
/** /**
* Loads Tessellator with a scaled resolution * Loads Tessellator with a scaled resolution
@ -652,197 +697,93 @@ public class Minecraft implements IPlayerUsage
public void run() public void run()
{ {
this.running = true; this.running = true;
CrashReport var2; this.startGame();
while (this.running) {
try this.runGameLoop();
{
this.startGame();
}
catch (Throwable var11)
{
var2 = CrashReport.makeCrashReport(var11, "Initializing game");
var2.makeCategory("Initialization");
this.displayCrashReport(this.addGraphicsAndWorldToCrashReport(var2));
return;
}
try
{
while (this.running)
{
if (this.running)
{
if (this.hasCrashed && this.crashReporter != null)
{
this.displayCrashReport(this.crashReporter);
return;
}
if (this.refreshTexturePacksScheduled)
{
this.refreshTexturePacksScheduled = false;
this.refreshResources();
}
try
{
this.runGameLoop();
}
catch (OutOfMemoryError var10)
{
this.freeMemory();
this.displayGuiScreen(new GuiMemoryErrorScreen());
System.gc();
}
continue;
}
}
}
catch (MinecraftError var12)
{
}
catch (ReportedException var13)
{
this.addGraphicsAndWorldToCrashReport(var13.getCrashReport());
this.freeMemory();
var13.printStackTrace();
this.displayCrashReport(var13.getCrashReport());
}
catch (Throwable var14)
{
var2 = this.addGraphicsAndWorldToCrashReport(new CrashReport("Unexpected error", var14));
this.freeMemory();
var14.printStackTrace();
this.displayCrashReport(var2);
}
finally
{
this.shutdownMinecraftApplet();
} }
EaglerAdapter.destroyContext();
EaglerAdapter.exit();
} }
/** /**
* Called repeatedly from run() * Called repeatedly from run()
*/ */
private void runGameLoop() private void runGameLoop() {
{ if (this.refreshTexturePacksScheduled) {
this.refreshTexturePacksScheduled = false;
this.renderEngine.refreshTextures();
}
AxisAlignedBB.getAABBPool().cleanPool(); AxisAlignedBB.getAABBPool().cleanPool();
if (this.theWorld != null) if (this.theWorld != null) {
{
this.theWorld.getWorldVec3Pool().clear(); this.theWorld.getWorldVec3Pool().clear();
} }
this.mcProfiler.startSection("root"); if (EaglerAdapter.shouldShutdown()) {
if (Display.isCloseRequested())
{
this.shutdown(); this.shutdown();
} }
if (this.isGamePaused && this.theWorld != null) if (this.isGamePaused && this.theWorld != null) {
{
float var1 = this.timer.renderPartialTicks; float var1 = this.timer.renderPartialTicks;
this.timer.updateTimer(); this.timer.updateTimer();
this.timer.renderPartialTicks = var1; this.timer.renderPartialTicks = var1;
} } else {
else
{
this.timer.updateTimer(); this.timer.updateTimer();
} }
long var6 = System.nanoTime(); long var6 = System.nanoTime();
this.mcProfiler.startSection("tick");
for (int var3 = 0; var3 < this.timer.elapsedTicks; ++var3) for (int var3 = 0; var3 < this.timer.elapsedTicks; ++var3) {
{
this.runTick(); this.runTick();
} }
this.mcProfiler.endStartSection("preRenderErrors"); IntegratedServer.processICP();
long var7 = System.nanoTime() - var6; long var7 = System.nanoTime() - var6;
this.checkGLError("Pre render"); this.checkGLError("Pre render");
RenderBlocks.fancyGrass = this.gameSettings.fancyGraphics; RenderBlocks.fancyGrass = this.gameSettings.fancyGraphics;
this.mcProfiler.endStartSection("sound");
this.sndManager.setListener(this.thePlayer, this.timer.renderPartialTicks); this.sndManager.setListener(this.thePlayer, this.timer.renderPartialTicks);
if (!this.isGamePaused) if (!this.isGamePaused) {
{
this.sndManager.func_92071_g(); this.sndManager.func_92071_g();
} }
this.mcProfiler.endSection(); EaglerAdapter.glEnable(EaglerAdapter.GL_TEXTURE_2D);
this.mcProfiler.startSection("render");
this.mcProfiler.startSection("display");
GL11.glEnable(GL11.GL_TEXTURE_2D);
if (!Keyboard.isKeyDown(65)) if (!EaglerAdapter.isKeyDown(65)) {
{ updateDisplay();
Display.update();
} }
if (this.thePlayer != null && this.thePlayer.isEntityInsideOpaqueBlock()) if (this.thePlayer != null && this.thePlayer.isEntityInsideOpaqueBlock()) {
{
this.gameSettings.thirdPersonView = 0; this.gameSettings.thirdPersonView = 0;
} }
this.mcProfiler.endSection(); EaglerAdapter.glClearStack();
if (!this.skipRenderWorld) if (!this.skipRenderWorld) {
{
this.mcProfiler.endStartSection("gameRenderer");
this.entityRenderer.updateCameraAndRender(this.timer.renderPartialTicks); this.entityRenderer.updateCameraAndRender(this.timer.renderPartialTicks);
this.mcProfiler.endSection();
} }
GL11.glFlush(); EaglerAdapter.glFlush();
this.mcProfiler.endSection();
if (!Display.isActive() && this.fullscreen) //if (!EaglerAdapter.isFocused() && this.fullscreen) {
{ // this.toggleFullscreen();
this.toggleFullscreen(); //}
}
if (this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart) this.prevFrameTime = System.nanoTime();
{
if (!this.mcProfiler.profilingEnabled)
{
this.mcProfiler.clearProfiling();
}
this.mcProfiler.profilingEnabled = true;
this.displayDebugInfo(var7);
}
else
{
this.mcProfiler.profilingEnabled = false;
this.prevFrameTime = System.nanoTime();
}
this.guiAchievement.updateAchievementWindow(); this.guiAchievement.updateAchievementWindow();
this.mcProfiler.startSection("root");
Thread.yield();
if (Keyboard.isKeyDown(65)) if (!this.fullscreen && (EaglerAdapter.getCanvasWidth() != this.displayWidth || EaglerAdapter.getCanvasHeight() != this.displayHeight)) {
{ this.displayWidth = EaglerAdapter.getCanvasWidth();
Display.update(); this.displayHeight = EaglerAdapter.getCanvasHeight();
}
this.screenshotListener(); if (this.displayWidth <= 0) {
if (!this.fullscreen && Display.wasResized())
{
this.displayWidth = Display.getWidth();
this.displayHeight = Display.getHeight();
if (this.displayWidth <= 0)
{
this.displayWidth = 1; this.displayWidth = 1;
} }
if (this.displayHeight <= 0) if (this.displayHeight <= 0) {
{
this.displayHeight = 1; this.displayHeight = 1;
} }
@ -850,36 +791,27 @@ public class Minecraft implements IPlayerUsage
} }
this.checkGLError("Post render"); this.checkGLError("Post render");
EaglerAdapter.optimize();
++this.fpsCounter; ++this.fpsCounter;
boolean var5 = this.isGamePaused; //boolean var5 = this.isGamePaused;
this.isGamePaused = this.isSingleplayer() && this.currentScreen != null && this.currentScreen.doesGuiPauseGame() && !this.theIntegratedServer.getPublic(); //this.isGamePaused = false;
if (this.isIntegratedServerRunning() && this.thePlayer != null && this.thePlayer.sendQueue != null && this.isGamePaused != var5) if(EaglerAdapter.steadyTimeMillis() - secondTimer > 1000l) {
{ debugFPS = fpsCounter;
((MemoryConnection)this.thePlayer.sendQueue.getNetManager()).setGamePaused(this.isGamePaused); fpsCounter = 0;
debugChunkUpdates = chunkUpdates;
chunkUpdates = 0;
debugChunkGeometryUpdates = chunkGeometryUpdates;
chunkGeometryUpdates = 0;
secondTimer = EaglerAdapter.steadyTimeMillis();
} }
while (getSystemTime() >= this.debugUpdateTime + 1000L) /*if(isGonnaTakeDatScreenShot) {
{ isGonnaTakeDatScreenShot = false;
debugFPS = this.fpsCounter; EaglerAdapter.saveScreenshot();
this.debug = debugFPS + " fps, " + WorldRenderer.chunksUpdated + " chunk updates"; }*/
WorldRenderer.chunksUpdated = 0;
this.debugUpdateTime += 1000L;
this.fpsCounter = 0;
this.usageSnooper.addMemoryStatsToSnooper();
if (!this.usageSnooper.isSnooperRunning()) EaglerAdapter.doJavascriptCoroutines();
{
this.usageSnooper.startSnooper();
}
}
this.mcProfiler.endSection();
if (this.getLimitFramerate() > 0)
{
Display.sync(EntityRenderer.performanceToFps(this.getLimitFramerate()));
}
} }
private int getLimitFramerate() private int getLimitFramerate()
@ -1342,6 +1274,19 @@ public class Minecraft implements IPlayerUsage
} }
} }
public void updateDisplay() {
if(gameSettings.enableVsync) {
EaglerAdapter.updateDisplay(0, true);
}else {
int i = this.func_90020_K();
EaglerAdapter.updateDisplay(i > 0 ? EntityRenderer.performanceToFps(i) : 0, false);
}
}
private int func_90020_K() {
return this.currentScreen != null && this.currentScreen instanceof GuiMainMenu ? 2 : this.gameSettings.limitFramerate;
}
/** /**
* Runs the current tick. * Runs the current tick.
*/ */
@ -2037,7 +1982,7 @@ public class Minecraft implements IPlayerUsage
*/ */
public final boolean isDemo() public final boolean isDemo()
{ {
return this.isDemo; return false;
} }
/** /**

View File

@ -25,7 +25,7 @@ public class RenderGlobal implements IWorldAccess
private WorldClient theWorld; private WorldClient theWorld;
/** The RenderEngine instance used by RenderGlobal */ /** The RenderEngine instance used by RenderGlobal */
private final TextureManager renderEngine; private final RenderEngine renderEngine;
private List worldRenderersToUpdate = new ArrayList(); private List worldRenderersToUpdate = new ArrayList();
private WorldRenderer[] sortedWorldRenderers; private WorldRenderer[] sortedWorldRenderers;
private WorldRenderer[] worldRenderers; private WorldRenderer[] worldRenderers;
@ -155,10 +155,10 @@ public class RenderGlobal implements IWorldAccess
*/ */
int frustumCheckOffset; int frustumCheckOffset;
public RenderGlobal(Minecraft par1Minecraft) public RenderGlobal(Minecraft par1Minecraft, RenderEngine renderEngine)
{ {
this.mc = par1Minecraft; this.mc = par1Minecraft;
this.renderEngine = par1Minecraft.getTextureManager(); this.renderEngine = renderEngine;
byte var2 = 34; byte var2 = 34;
byte var3 = 32; byte var3 = 32;
this.glRenderListBase = GLAllocation.generateDisplayLists(var2 * var2 * var3 * 3); this.glRenderListBase = GLAllocation.generateDisplayLists(var2 * var2 * var3 * 3);
@ -400,7 +400,7 @@ public class RenderGlobal implements IWorldAccess
else else
{ {
this.theWorld.theProfiler.startSection("prepare"); this.theWorld.theProfiler.startSection("prepare");
TileEntityRenderer.instance.cacheActiveRenderInfo(this.theWorld, this.mc.getTextureManager(), this.mc.fontRenderer, this.mc.renderViewEntity, par3); TileEntityRenderer.instance.cacheActiveRenderInfo(this.theWorld, this.renderEngine, this.mc.fontRenderer, this.mc.renderViewEntity, par3);
RenderManager.instance.cacheActiveRenderInfo(this.theWorld, this.mc.getTextureManager(), this.mc.fontRenderer, this.mc.renderViewEntity, this.mc.pointedEntityLiving, this.mc.gameSettings, par3); RenderManager.instance.cacheActiveRenderInfo(this.theWorld, this.mc.getTextureManager(), this.mc.fontRenderer, this.mc.renderViewEntity, this.mc.pointedEntityLiving, this.mc.gameSettings, par3);
this.countEntitiesTotal = 0; this.countEntitiesTotal = 0;
this.countEntitiesRendered = 0; this.countEntitiesRendered = 0;

View File

@ -39,7 +39,7 @@ public class RenderManager
public double viewerPosZ; public double viewerPosZ;
public static boolean field_85095_o; public static boolean field_85095_o;
private RenderManager() RenderManager()
{ {
this.entityRenderMap.put(EntityCaveSpider.class, new RenderCaveSpider()); this.entityRenderMap.put(EntityCaveSpider.class, new RenderCaveSpider());
this.entityRenderMap.put(EntitySpider.class, new RenderSpider()); this.entityRenderMap.put(EntitySpider.class, new RenderSpider());

View File

@ -12,7 +12,7 @@ public class ResourcePackRepositoryEntry
private ResourcePack reResourcePack; private ResourcePack reResourcePack;
private PackMetadataSection rePackMetadataSection; private PackMetadataSection rePackMetadataSection;
private BufferedImage texturePackIcon; private BufferedImage texturePackIcon;
private TextureLocation locationTexturePackIcon; //private TextureLocation locationTexturePackIcon;
final ResourcePackRepository reResourcePackRepository; final ResourcePackRepository reResourcePackRepository;
@ -44,14 +44,14 @@ public class ResourcePackRepositoryEntry
this.closeResourcePack(); this.closeResourcePack();
} }
public void bindTexturePackIcon(TextureManager par1TextureManager) public void bindTexturePackIcon(TextureManager par1TextureManager) // FIX THIS SHIT
{ {
if (this.locationTexturePackIcon == null) /*if (this.locationTexturePackIcon == null)
{ {
this.locationTexturePackIcon = par1TextureManager.getDynamicTextureLocation("texturepackicon", new DynamicTexture(this.texturePackIcon)); this.locationTexturePackIcon = par1TextureManager.getDynamicTextureLocation("texturepackicon", new DynamicTexture(this.texturePackIcon));
} }
par1TextureManager.bindTexture(this.locationTexturePackIcon); par1TextureManager.bindTexture(this.locationTexturePackIcon);*/
} }
public void closeResourcePack() public void closeResourcePack()

View File

@ -1,13 +1,10 @@
package net.minecraft.src; package net.minecraft.src;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.io.IOException;
import java.util.Collection; import java.util.*;
import java.util.HashSet;
import java.util.Iterator; import net.lax1dude.eaglercraft.EaglerAdapter;
import java.util.List;
import java.util.Random;
import java.util.Set;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import paulscode.sound.SoundSystem; import paulscode.sound.SoundSystem;
import paulscode.sound.SoundSystemConfig; import paulscode.sound.SoundSystemConfig;
@ -41,7 +38,7 @@ public class SoundManager implements ResourceManagerReloadListener
private int latestSoundID; private int latestSoundID;
/** A reference to the game settings. */ /** A reference to the game settings. */
private final GameSettings options; private GameSettings options;
private final File fileAssets; private final File fileAssets;
/** Identifiers of all currently playing sounds. Type: HashSet<String> */ /** Identifiers of all currently playing sounds. Type: HashSet<String> */
@ -52,6 +49,8 @@ public class SoundManager implements ResourceManagerReloadListener
private Random rand = new Random(); private Random rand = new Random();
private int ticksBeforeMusic; private int ticksBeforeMusic;
private HashMap<String,Integer> sounddefinitions;
public SoundManager(ResourceManager par1ResourceManager, GameSettings par2GameSettings, File par3File) public SoundManager(ResourceManager par1ResourceManager, GameSettings par2GameSettings, File par3File)
{ {
this.ticksBeforeMusic = this.rand.nextInt(12000); this.ticksBeforeMusic = this.rand.nextInt(12000);
@ -60,6 +59,7 @@ public class SoundManager implements ResourceManagerReloadListener
this.soundPoolSounds = new SoundPool(par1ResourceManager, "sound", true); this.soundPoolSounds = new SoundPool(par1ResourceManager, "sound", true);
this.soundPoolStreaming = new SoundPool(par1ResourceManager, "records", false); this.soundPoolStreaming = new SoundPool(par1ResourceManager, "records", false);
this.soundPoolMusic = new SoundPool(par1ResourceManager, "music", true); this.soundPoolMusic = new SoundPool(par1ResourceManager, "music", true);
this.sounddefinitions = null;
try try
{ {
@ -76,6 +76,32 @@ public class SoundManager implements ResourceManagerReloadListener
this.loadSounds(); this.loadSounds();
} }
public void loadSoundSettings(GameSettings par1GameSettings){
this.options = par1GameSettings;
EaglerAdapter.setMusicVolume(options.musicVolume);
EaglerAdapter.setMasterVolume(options.soundVolume);
if(this.sounddefinitions == null) {
this.sounddefinitions = new HashMap();
for(int j = 0; j < 2; ++j) {
byte[] b = EaglerAdapter.loadResourceBytes("/sounds/sounds.dat" + (j == 1 ? "x" : ""));
if(b != null) {
try {
NBTTagCompound file = CompressedStreamTools.readUncompressed(b);
if(j == 0) EaglerAdapter.setPlaybackOffsetDelay(file.hasKey("playbackOffset") ? file.getFloat("playbackOffset") : 0.03f);
NBTTagList l = file.getTagList("sounds");
int c = l.tagCount();
for(int i = 0; i < c; i++) {
NBTTagCompound cc = (NBTTagCompound)l.tagAt(i);
this.sounddefinitions.put(cc.getString("e"), (int)cc.getByte("c") & 0xFF);
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
public void onResourceManagerReload(ResourceManager par1ResourceManager) public void onResourceManagerReload(ResourceManager par1ResourceManager)
{ {
this.stopAllSounds(); this.stopAllSounds();
@ -158,21 +184,13 @@ public class SoundManager implements ResourceManagerReloadListener
/** /**
* Called when one of the sound level options has changed. * Called when one of the sound level options has changed.
*/ */
public void onSoundOptionsChanged() public void onSoundOptionsChanged() // FIX THIS (maybe)
{ {
if (this.loaded) EaglerAdapter.setMusicVolume(options.musicVolume);
{ if(options.musicVolume > 0.0f) {
if (this.options.musicVolume == 0.0F) EaglerAdapter.fireTitleMusicEvent(titleMusic != -1, options.musicVolume);
{
this.sndSystem.stop("BgMusic");
this.sndSystem.stop("streaming");
}
else
{
this.sndSystem.setVolume("BgMusic", this.options.musicVolume);
this.sndSystem.setVolume("streaming", this.options.musicVolume);
}
} }
EaglerAdapter.setMasterVolume(options.soundVolume);
} }
/** /**
@ -593,4 +611,23 @@ public class SoundManager implements ResourceManagerReloadListener
{ {
return par0SoundManager.loaded = par1; return par0SoundManager.loaded = par1;
} }
private int titleMusic = -1;
public void playTheTitleMusic() {
if(titleMusic == -1 || !EaglerAdapter.isPlaying(titleMusic)) {
if(this.options.musicVolume > 0.0f) {
titleMusic = EaglerAdapter.beginPlaybackStatic("/sounds/gta.mp3", 1.0f, 1.0f, true);
EaglerAdapter.fireTitleMusicEvent(true, this.options.musicVolume);
}
}
}
public void stopTheTitleMusic() {
if(EaglerAdapter.isPlaying(titleMusic)) {
EaglerAdapter.endSound(titleMusic);
EaglerAdapter.fireTitleMusicEvent(false, this.options.musicVolume);
}
titleMusic = -1;
}
} }

View File

@ -70,7 +70,7 @@ public class SoundPool
private URL func_110654_c(String par1Str) throws MalformedURLException private URL func_110654_c(String par1Str) throws MalformedURLException
{ {
TextureLocation var2 = new TextureLocation(par1Str); TextureLocation var2 = new TextureLocation(par1Str);
String var3 = String.format("%s:%s:%s/%s", new Object[] {"mcsounddomain", var2.getResourceDomain(), this.soundType, var2.getResourcePath()}); String var3 = String.format("%s:%s:%s/%s", new Object[] {"mcsounddomain", var2, this.soundType, var2});
SoundPoolProtocolHandler var4 = new SoundPoolProtocolHandler(this); SoundPoolProtocolHandler var4 = new SoundPoolProtocolHandler(this);
return new URL((URL)null, var3, var4); return new URL((URL)null, var3, var4);
} }

View File

@ -28,7 +28,7 @@ public class TileEntityRenderer
public static double staticPlayerZ; public static double staticPlayerZ;
/** The RenderEngine instance used by the TileEntityRenderer */ /** The RenderEngine instance used by the TileEntityRenderer */
public TextureManager renderEngine; public RenderEngine renderEngine;
/** Reference to the World object. */ /** Reference to the World object. */
public World worldObj; public World worldObj;
@ -103,7 +103,7 @@ public class TileEntityRenderer
* bound EntityLiving's interpolated pitch, yaw and position. Args: world, renderengine, fontrenderer, entityliving, * bound EntityLiving's interpolated pitch, yaw and position. Args: world, renderengine, fontrenderer, entityliving,
* partialTickTime * partialTickTime
*/ */
public void cacheActiveRenderInfo(World par1World, TextureManager par2TextureManager, FontRenderer par3FontRenderer, EntityLivingBase par4EntityLivingBase, float par5) public void cacheActiveRenderInfo(World par1World, RenderEngine par2TextureManager, FontRenderer par3FontRenderer, EntityLivingBase par4EntityLivingBase, float par5)
{ {
if (this.worldObj != par1World) if (this.worldObj != par1World)
{ {

View File

@ -13,7 +13,7 @@ public abstract class TileEntitySpecialRenderer
protected void bindTexture(TextureLocation par1TextureLocation) protected void bindTexture(TextureLocation par1TextureLocation)
{ {
TextureManager var2 = this.tileEntityRenderer.renderEngine; RenderEngine var2 = this.tileEntityRenderer.renderEngine;
if (var2 != null) if (var2 != null)
{ {