Fix some things
This commit is contained in:
parent
b458ce2332
commit
09fbf747ae
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -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
|
||||
* render Strings on screen.
|
||||
*/
|
||||
private static String getAllowedCharacters()
|
||||
static String getAllowedCharacters()
|
||||
{
|
||||
String var0 = "";
|
||||
|
||||
|
|
|
@ -44,14 +44,14 @@ public class DefaultResourcePack implements ResourcePack
|
|||
}
|
||||
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)
|
||||
{
|
||||
return DefaultResourcePack.class.getResourceAsStream("/assets/minecraft/" + par1TextureLocation.getResourcePath());
|
||||
return DefaultResourcePack.class.getResourceAsStream("/assets/minecraft/" + par1TextureLocation);
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
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
|
||||
{
|
||||
return ImageIO.read(DefaultResourcePack.class.getResourceAsStream("/" + (new TextureLocation("pack.png")).getResourcePath()));
|
||||
return ImageIO.read(DefaultResourcePack.class.getResourceAsStream("/" + (new TextureLocation("pack.png"))));
|
||||
}
|
||||
|
||||
public String getPackName()
|
||||
|
|
|
@ -15,12 +15,12 @@ public class EffectRenderer
|
|||
/** Reference to the World object. */
|
||||
protected World worldObj;
|
||||
private List[] fxLayers = new List[4];
|
||||
private TextureManager renderer;
|
||||
private RenderEngine renderer;
|
||||
|
||||
/** RNG. */
|
||||
private Random rand = new Random();
|
||||
|
||||
public EffectRenderer(World par1World, TextureManager par2TextureManager)
|
||||
public EffectRenderer(World par1World, RenderEngine par2TextureManager)
|
||||
{
|
||||
if (par1World != null)
|
||||
{
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.lax1dude.eaglercraft.TextureLocation;
|
||||
import net.lax1dude.eaglercraft.adapter.Tessellator;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
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 int footstepAge;
|
||||
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);
|
||||
this.currentFootSteps = par1TextureManager;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.lax1dude.eaglercraft.TextureLocation;
|
||||
import net.lax1dude.eaglercraft.adapter.Tessellator;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class EntityLargeExplodeFX extends EntityFX
|
||||
|
@ -10,10 +11,10 @@ public class EntityLargeExplodeFX extends EntityFX
|
|||
private int field_70584_aq;
|
||||
|
||||
/** The Rendering Engine. */
|
||||
private TextureManager theRenderEngine;
|
||||
private RenderEngine theRenderEngine;
|
||||
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);
|
||||
this.theRenderEngine = par1TextureManager;
|
||||
|
|
|
@ -151,6 +151,8 @@ public class GameSettings
|
|||
|
||||
public boolean adderall = false;
|
||||
|
||||
public boolean showCoordinates;
|
||||
|
||||
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};
|
||||
|
@ -164,6 +166,30 @@ public class GameSettings
|
|||
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()
|
||||
{
|
||||
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)
|
||||
{
|
||||
this.anaglyph = !this.anaglyph;
|
||||
this.mc.refreshResources();
|
||||
//this.anaglyph = !this.anaglyph;
|
||||
//this.mc.refreshResources();
|
||||
}
|
||||
|
||||
if (par1EnumOptions == EnumOptions.FRAMERATE_LIMIT)
|
||||
|
|
|
@ -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(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")));
|
||||
var3.enabled = this.mc.isSingleplayer() && !this.mc.getIntegratedServer().getPublic();
|
||||
var3.enabled = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -119,7 +119,7 @@ public class GuiOptions extends GuiScreen
|
|||
if (par1GuiButton.id == 105)
|
||||
{
|
||||
this.mc.gameSettings.saveOptions();
|
||||
this.mc.displayGuiScreen(new GuiScreenTemporaryResourcePackSelect(this, this.options));
|
||||
//this.mc.displayGuiScreen(new GuiScreenTemporaryResourcePackSelect(this, this.options));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ public class GuiShareToLan extends GuiScreen
|
|||
else if (par1GuiButton.id == 101)
|
||||
{
|
||||
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;
|
||||
|
||||
if (var2 != null)
|
||||
|
|
|
@ -46,7 +46,7 @@ class GuiSlotLanguage extends GuiSlot
|
|||
Language var3 = (Language)this.field_77253_h.get(this.field_77251_g.get(par1));
|
||||
GuiLanguage.func_135011_a(this.languageGui).setCurrentLanguage(var3);
|
||||
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.setBidiFlag(GuiLanguage.func_135011_a(this.languageGui).isCurrentLanguageBidirectional());
|
||||
GuiLanguage.getDoneButton(this.languageGui).displayString = I18n.getString("gui.done");
|
||||
|
|
|
@ -1,15 +1,7 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.lax1dude.eaglercraft.DefaultSkinRenderer;
|
||||
import net.lax1dude.eaglercraft.EaglerAdapter;
|
||||
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.*;
|
||||
import net.lax1dude.eaglercraft.IntegratedServer;
|
||||
import net.lax1dude.eaglercraft.adapter.Tessellator;
|
||||
import net.lax1dude.eaglercraft.glemu.FixedFunctionShader;
|
||||
import com.google.common.collect.Lists;
|
||||
|
@ -18,6 +10,7 @@ import java.io.File;
|
|||
import java.io.IOException;
|
||||
import java.net.Proxy;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
|
@ -44,14 +37,9 @@ import org.lwjgl.util.glu.GLU;
|
|||
|
||||
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. */
|
||||
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 final ILogAgent mcLogAgent;
|
||||
private final File fileResourcepacks;
|
||||
private ServerData currentServerData;
|
||||
|
||||
/** The RenderEngine instance used by Minecraft */
|
||||
|
@ -86,7 +74,6 @@ public class Minecraft implements IPlayerUsage
|
|||
public EntityLivingBase renderViewEntity;
|
||||
public EntityLivingBase pointedEntityLiving;
|
||||
public EffectRenderer effectRenderer;
|
||||
private final Session session;
|
||||
private boolean isGamePaused;
|
||||
|
||||
/** The font renderer used for displaying and measuring text. */
|
||||
|
@ -127,9 +114,7 @@ public class Minecraft implements IPlayerUsage
|
|||
/** Mouse helper instance. */
|
||||
public MouseHelper mouseHelper;
|
||||
public TexturePackList texturePackList;
|
||||
public final File mcDataDir;
|
||||
private final File fileAssets;
|
||||
private final String launchedVersion;
|
||||
|
||||
private ISaveFormat saveLoader;
|
||||
|
||||
/**
|
||||
|
@ -184,6 +169,11 @@ public class Minecraft implements IPlayerUsage
|
|||
*/
|
||||
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 */
|
||||
public String debug = "";
|
||||
|
||||
|
@ -194,9 +184,17 @@ public class Minecraft implements IPlayerUsage
|
|||
int fpsCounter;
|
||||
long prevFrameTime = -1L;
|
||||
|
||||
long secondTimer = 0l;
|
||||
|
||||
/** Profiler currently displayed in the debug screen pie chart */
|
||||
private String debugProfilerName = "root";
|
||||
|
||||
private int messageOnLoginCounter = 0;
|
||||
|
||||
public boolean lanState = false;
|
||||
public boolean yeeState = false;
|
||||
public boolean checkGLErrors = false;
|
||||
|
||||
public Minecraft()
|
||||
{
|
||||
this.tempDisplayHeight = 480;
|
||||
|
@ -242,170 +240,252 @@ public class Minecraft implements IPlayerUsage
|
|||
/**
|
||||
* Starts the game: initializes the canvas, the title, the settings, etcetera.
|
||||
*/
|
||||
private void startGame() throws LWJGLException
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
public void startGame() {
|
||||
OpenGlHelper.initializeTextures();
|
||||
this.guiAchievement = new GuiAchievement(this);
|
||||
this.metadataSerializer_.registerMetadataSectionType(new TextureMetadataSectionSerializer(), TextureMetadataSection.class);
|
||||
this.metadataSerializer_.registerMetadataSectionType(new FontMetadataSectionSerializer(), FontMetadataSection.class);
|
||||
this.metadataSerializer_.registerMetadataSectionType(new AnimationMetadataSectionSerializer(), AnimationMetadataSection.class);
|
||||
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);
|
||||
TextureManager.init();
|
||||
this.gameSettings = new GameSettings(this);
|
||||
this.texturePackList = new TexturePackList(this);
|
||||
this.renderEngine = new RenderEngine(this.texturePackList, this.gameSettings);
|
||||
|
||||
if (this.gameSettings.language != null)
|
||||
{
|
||||
this.fontRenderer.setUnicodeFlag(this.mcLanguageManager.isCurrentLocaleUnicode());
|
||||
this.fontRenderer.setBidiFlag(this.mcLanguageManager.isCurrentLanguageBidirectional());
|
||||
this.loadScreen();
|
||||
|
||||
ChatAllowedCharacters.getAllowedCharacters();
|
||||
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.mcResourceManager.registerReloadListener(this.fontRenderer);
|
||||
this.mcResourceManager.registerReloadListener(this.standardGalacticFontRenderer);
|
||||
this.mcResourceManager.registerReloadListener(new GrassColorReloadListener());
|
||||
this.mcResourceManager.registerReloadListener(new FoliageColorReloadListener());
|
||||
RenderManager.instance.itemRenderer = new ItemRenderer(this);
|
||||
this.loadScreen();
|
||||
|
||||
ColorizerGrass.setGrassBiomeColorizer(this.renderEngine.getTextureContents("/misc/grasscolor.png"));
|
||||
ColorizerFoliage.setFoliageBiomeColorizer(this.renderEngine.getTextureContents("/misc/foliagecolor.png"));
|
||||
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));
|
||||
this.mouseHelper = new MouseHelper();
|
||||
this.checkGLError("Pre startup");
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
GL11.glClearDepth(1.0D);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glDepthFunc(GL11.GL_LEQUAL);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
|
||||
GL11.glCullFace(GL11.GL_BACK);
|
||||
GL11.glMatrixMode(GL11.GL_PROJECTION);
|
||||
GL11.glLoadIdentity();
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
EaglerAdapter.glEnable(EaglerAdapter.GL_TEXTURE_2D);
|
||||
EaglerAdapter.glShadeModel(EaglerAdapter.GL_SMOOTH);
|
||||
EaglerAdapter.glClearDepth(1.0F);
|
||||
EaglerAdapter.glEnable(EaglerAdapter.GL_DEPTH_TEST);
|
||||
EaglerAdapter.glDepthFunc(EaglerAdapter.GL_LEQUAL);
|
||||
EaglerAdapter.glEnable(EaglerAdapter.GL_ALPHA_TEST);
|
||||
EaglerAdapter.glAlphaFunc(EaglerAdapter.GL_GREATER, 0.1F);
|
||||
EaglerAdapter.glCullFace(EaglerAdapter.GL_BACK);
|
||||
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_PROJECTION);
|
||||
EaglerAdapter.glLoadIdentity();
|
||||
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_MODELVIEW);
|
||||
this.checkGLError("Startup");
|
||||
this.renderGlobal = new RenderGlobal(this);
|
||||
this.renderEngine.loadTextureMap(TextureMap.locationBlocksTexture, new TextureMap(0, "textures/blocks"));
|
||||
this.renderEngine.loadTextureMap(TextureMap.locationItemsTexture, new TextureMap(1, "textures/items"));
|
||||
GL11.glViewport(0, 0, this.displayWidth, this.displayHeight);
|
||||
this.sndManager.loadSoundSettings(this.gameSettings);
|
||||
this.renderGlobal = new RenderGlobal(this, this.renderEngine);
|
||||
this.renderEngine.refreshTextureMaps();
|
||||
EaglerAdapter.glViewport(0, 0, this.displayWidth, this.displayHeight);
|
||||
this.effectRenderer = new EffectRenderer(this.theWorld, this.renderEngine);
|
||||
|
||||
this.checkGLError("Post startup");
|
||||
this.guiAchievement = new GuiAchievement(this);
|
||||
this.ingameGUI = new GuiIngame(this);
|
||||
|
||||
if (this.serverName != null)
|
||||
{
|
||||
this.displayGuiScreen(new GuiConnecting(new GuiMainMenu(), this, this.serverName, this.serverPort));
|
||||
ScaledResolution var2 = new ScaledResolution(this.gameSettings, this.displayWidth, this.displayHeight);
|
||||
int var3 = var2.getScaledWidth();
|
||||
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
|
||||
{
|
||||
this.displayGuiScreen(new GuiMainMenu());
|
||||
|
||||
if(!gameSettings.enableVsync && !gameSettings.hideVsyncWarning) {
|
||||
scr = new GuiScreenVSyncWarning(scr);
|
||||
}
|
||||
|
||||
displayGuiScreen(scr);
|
||||
|
||||
this.loadingScreen = new LoadingScreenRenderer(this);
|
||||
|
||||
if (this.gameSettings.fullScreen && !this.fullscreen)
|
||||
{
|
||||
if (this.gameSettings.fullScreen && !this.fullscreen) {
|
||||
this.toggleFullscreen();
|
||||
}
|
||||
|
||||
byte[] b = EaglerAdapter.loadResourceBytes("adderall");
|
||||
yeeState = b != null && (new String(b, StandardCharsets.UTF_8)).hashCode() == 508925104;
|
||||
}
|
||||
|
||||
public void refreshResources()
|
||||
{
|
||||
ArrayList var1 = Lists.newArrayList(this.defaultResourcePacks);
|
||||
Iterator var2 = this.mcResourcePackRepository.getRepositoryEntries().iterator();
|
||||
private void showIntroAnimation() {
|
||||
ScaledResolution var1 = new ScaledResolution(this.gameSettings, this.displayWidth, this.displayHeight);
|
||||
EaglerAdapter.glClearColor(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
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())
|
||||
{
|
||||
ResourcePackRepositoryEntry var3 = (ResourcePackRepositoryEntry)var2.next();
|
||||
var1.add(var3.getResourcePack());
|
||||
long t1 = EaglerAdapter.steadyTimeMillis();
|
||||
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);
|
||||
|
||||
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);
|
||||
this.mcResourceManager.reloadResources(var1);
|
||||
t1 = EaglerAdapter.steadyTimeMillis();
|
||||
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)
|
||||
{
|
||||
this.renderGlobal.loadRenderers();
|
||||
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(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()
|
||||
|
@ -485,41 +565,6 @@ public class Minecraft implements IPlayerUsage
|
|||
/**
|
||||
* 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
|
||||
|
@ -652,197 +697,93 @@ public class Minecraft implements IPlayerUsage
|
|||
public void run()
|
||||
{
|
||||
this.running = true;
|
||||
CrashReport var2;
|
||||
|
||||
try
|
||||
{
|
||||
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();
|
||||
this.startGame();
|
||||
while (this.running) {
|
||||
this.runGameLoop();
|
||||
}
|
||||
EaglerAdapter.destroyContext();
|
||||
EaglerAdapter.exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called repeatedly from run()
|
||||
*/
|
||||
private void runGameLoop()
|
||||
{
|
||||
private void runGameLoop() {
|
||||
if (this.refreshTexturePacksScheduled) {
|
||||
this.refreshTexturePacksScheduled = false;
|
||||
this.renderEngine.refreshTextures();
|
||||
}
|
||||
|
||||
AxisAlignedBB.getAABBPool().cleanPool();
|
||||
|
||||
if (this.theWorld != null)
|
||||
{
|
||||
if (this.theWorld != null) {
|
||||
this.theWorld.getWorldVec3Pool().clear();
|
||||
}
|
||||
|
||||
this.mcProfiler.startSection("root");
|
||||
|
||||
if (Display.isCloseRequested())
|
||||
{
|
||||
if (EaglerAdapter.shouldShutdown()) {
|
||||
this.shutdown();
|
||||
}
|
||||
|
||||
if (this.isGamePaused && this.theWorld != null)
|
||||
{
|
||||
if (this.isGamePaused && this.theWorld != null) {
|
||||
float var1 = this.timer.renderPartialTicks;
|
||||
this.timer.updateTimer();
|
||||
this.timer.renderPartialTicks = var1;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.timer.updateTimer();
|
||||
}
|
||||
|
||||
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.mcProfiler.endStartSection("preRenderErrors");
|
||||
IntegratedServer.processICP();
|
||||
|
||||
long var7 = System.nanoTime() - var6;
|
||||
this.checkGLError("Pre render");
|
||||
RenderBlocks.fancyGrass = this.gameSettings.fancyGraphics;
|
||||
this.mcProfiler.endStartSection("sound");
|
||||
this.sndManager.setListener(this.thePlayer, this.timer.renderPartialTicks);
|
||||
|
||||
if (!this.isGamePaused)
|
||||
{
|
||||
if (!this.isGamePaused) {
|
||||
this.sndManager.func_92071_g();
|
||||
}
|
||||
|
||||
this.mcProfiler.endSection();
|
||||
this.mcProfiler.startSection("render");
|
||||
this.mcProfiler.startSection("display");
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
EaglerAdapter.glEnable(EaglerAdapter.GL_TEXTURE_2D);
|
||||
|
||||
if (!Keyboard.isKeyDown(65))
|
||||
{
|
||||
Display.update();
|
||||
if (!EaglerAdapter.isKeyDown(65)) {
|
||||
updateDisplay();
|
||||
}
|
||||
|
||||
if (this.thePlayer != null && this.thePlayer.isEntityInsideOpaqueBlock())
|
||||
{
|
||||
if (this.thePlayer != null && this.thePlayer.isEntityInsideOpaqueBlock()) {
|
||||
this.gameSettings.thirdPersonView = 0;
|
||||
}
|
||||
|
||||
this.mcProfiler.endSection();
|
||||
EaglerAdapter.glClearStack();
|
||||
|
||||
if (!this.skipRenderWorld)
|
||||
{
|
||||
this.mcProfiler.endStartSection("gameRenderer");
|
||||
if (!this.skipRenderWorld) {
|
||||
this.entityRenderer.updateCameraAndRender(this.timer.renderPartialTicks);
|
||||
this.mcProfiler.endSection();
|
||||
}
|
||||
|
||||
GL11.glFlush();
|
||||
this.mcProfiler.endSection();
|
||||
EaglerAdapter.glFlush();
|
||||
|
||||
if (!Display.isActive() && this.fullscreen)
|
||||
{
|
||||
this.toggleFullscreen();
|
||||
}
|
||||
//if (!EaglerAdapter.isFocused() && this.fullscreen) {
|
||||
// this.toggleFullscreen();
|
||||
//}
|
||||
|
||||
if (this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart)
|
||||
{
|
||||
if (!this.mcProfiler.profilingEnabled)
|
||||
{
|
||||
this.mcProfiler.clearProfiling();
|
||||
}
|
||||
|
||||
this.mcProfiler.profilingEnabled = true;
|
||||
this.displayDebugInfo(var7);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.mcProfiler.profilingEnabled = false;
|
||||
this.prevFrameTime = System.nanoTime();
|
||||
}
|
||||
this.prevFrameTime = System.nanoTime();
|
||||
|
||||
this.guiAchievement.updateAchievementWindow();
|
||||
this.mcProfiler.startSection("root");
|
||||
Thread.yield();
|
||||
|
||||
if (Keyboard.isKeyDown(65))
|
||||
{
|
||||
Display.update();
|
||||
}
|
||||
if (!this.fullscreen && (EaglerAdapter.getCanvasWidth() != this.displayWidth || EaglerAdapter.getCanvasHeight() != this.displayHeight)) {
|
||||
this.displayWidth = EaglerAdapter.getCanvasWidth();
|
||||
this.displayHeight = EaglerAdapter.getCanvasHeight();
|
||||
|
||||
this.screenshotListener();
|
||||
|
||||
if (!this.fullscreen && Display.wasResized())
|
||||
{
|
||||
this.displayWidth = Display.getWidth();
|
||||
this.displayHeight = Display.getHeight();
|
||||
|
||||
if (this.displayWidth <= 0)
|
||||
{
|
||||
if (this.displayWidth <= 0) {
|
||||
this.displayWidth = 1;
|
||||
}
|
||||
|
||||
if (this.displayHeight <= 0)
|
||||
{
|
||||
if (this.displayHeight <= 0) {
|
||||
this.displayHeight = 1;
|
||||
}
|
||||
|
||||
|
@ -850,36 +791,27 @@ public class Minecraft implements IPlayerUsage
|
|||
}
|
||||
|
||||
this.checkGLError("Post render");
|
||||
EaglerAdapter.optimize();
|
||||
++this.fpsCounter;
|
||||
boolean var5 = this.isGamePaused;
|
||||
this.isGamePaused = this.isSingleplayer() && this.currentScreen != null && this.currentScreen.doesGuiPauseGame() && !this.theIntegratedServer.getPublic();
|
||||
//boolean var5 = this.isGamePaused;
|
||||
//this.isGamePaused = false;
|
||||
|
||||
if (this.isIntegratedServerRunning() && this.thePlayer != null && this.thePlayer.sendQueue != null && this.isGamePaused != var5)
|
||||
{
|
||||
((MemoryConnection)this.thePlayer.sendQueue.getNetManager()).setGamePaused(this.isGamePaused);
|
||||
if(EaglerAdapter.steadyTimeMillis() - secondTimer > 1000l) {
|
||||
debugFPS = fpsCounter;
|
||||
fpsCounter = 0;
|
||||
debugChunkUpdates = chunkUpdates;
|
||||
chunkUpdates = 0;
|
||||
debugChunkGeometryUpdates = chunkGeometryUpdates;
|
||||
chunkGeometryUpdates = 0;
|
||||
secondTimer = EaglerAdapter.steadyTimeMillis();
|
||||
}
|
||||
|
||||
while (getSystemTime() >= this.debugUpdateTime + 1000L)
|
||||
{
|
||||
debugFPS = this.fpsCounter;
|
||||
this.debug = debugFPS + " fps, " + WorldRenderer.chunksUpdated + " chunk updates";
|
||||
WorldRenderer.chunksUpdated = 0;
|
||||
this.debugUpdateTime += 1000L;
|
||||
this.fpsCounter = 0;
|
||||
this.usageSnooper.addMemoryStatsToSnooper();
|
||||
/*if(isGonnaTakeDatScreenShot) {
|
||||
isGonnaTakeDatScreenShot = false;
|
||||
EaglerAdapter.saveScreenshot();
|
||||
}*/
|
||||
|
||||
if (!this.usageSnooper.isSnooperRunning())
|
||||
{
|
||||
this.usageSnooper.startSnooper();
|
||||
}
|
||||
}
|
||||
|
||||
this.mcProfiler.endSection();
|
||||
|
||||
if (this.getLimitFramerate() > 0)
|
||||
{
|
||||
Display.sync(EntityRenderer.performanceToFps(this.getLimitFramerate()));
|
||||
}
|
||||
EaglerAdapter.doJavascriptCoroutines();
|
||||
}
|
||||
|
||||
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.
|
||||
*/
|
||||
|
@ -2037,7 +1982,7 @@ public class Minecraft implements IPlayerUsage
|
|||
*/
|
||||
public final boolean isDemo()
|
||||
{
|
||||
return this.isDemo;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -25,7 +25,7 @@ public class RenderGlobal implements IWorldAccess
|
|||
private WorldClient theWorld;
|
||||
|
||||
/** The RenderEngine instance used by RenderGlobal */
|
||||
private final TextureManager renderEngine;
|
||||
private final RenderEngine renderEngine;
|
||||
private List worldRenderersToUpdate = new ArrayList();
|
||||
private WorldRenderer[] sortedWorldRenderers;
|
||||
private WorldRenderer[] worldRenderers;
|
||||
|
@ -155,10 +155,10 @@ public class RenderGlobal implements IWorldAccess
|
|||
*/
|
||||
int frustumCheckOffset;
|
||||
|
||||
public RenderGlobal(Minecraft par1Minecraft)
|
||||
public RenderGlobal(Minecraft par1Minecraft, RenderEngine renderEngine)
|
||||
{
|
||||
this.mc = par1Minecraft;
|
||||
this.renderEngine = par1Minecraft.getTextureManager();
|
||||
this.renderEngine = renderEngine;
|
||||
byte var2 = 34;
|
||||
byte var3 = 32;
|
||||
this.glRenderListBase = GLAllocation.generateDisplayLists(var2 * var2 * var3 * 3);
|
||||
|
@ -400,7 +400,7 @@ public class RenderGlobal implements IWorldAccess
|
|||
else
|
||||
{
|
||||
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);
|
||||
this.countEntitiesTotal = 0;
|
||||
this.countEntitiesRendered = 0;
|
||||
|
|
|
@ -39,7 +39,7 @@ public class RenderManager
|
|||
public double viewerPosZ;
|
||||
public static boolean field_85095_o;
|
||||
|
||||
private RenderManager()
|
||||
RenderManager()
|
||||
{
|
||||
this.entityRenderMap.put(EntityCaveSpider.class, new RenderCaveSpider());
|
||||
this.entityRenderMap.put(EntitySpider.class, new RenderSpider());
|
||||
|
|
|
@ -12,7 +12,7 @@ public class ResourcePackRepositoryEntry
|
|||
private ResourcePack reResourcePack;
|
||||
private PackMetadataSection rePackMetadataSection;
|
||||
private BufferedImage texturePackIcon;
|
||||
private TextureLocation locationTexturePackIcon;
|
||||
//private TextureLocation locationTexturePackIcon;
|
||||
|
||||
final ResourcePackRepository reResourcePackRepository;
|
||||
|
||||
|
@ -44,14 +44,14 @@ public class ResourcePackRepositoryEntry
|
|||
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));
|
||||
}
|
||||
|
||||
par1TextureManager.bindTexture(this.locationTexturePackIcon);
|
||||
par1TextureManager.bindTexture(this.locationTexturePackIcon);*/
|
||||
}
|
||||
|
||||
public void closeResourcePack()
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
import net.lax1dude.eaglercraft.EaglerAdapter;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import paulscode.sound.SoundSystem;
|
||||
import paulscode.sound.SoundSystemConfig;
|
||||
|
@ -41,7 +38,7 @@ public class SoundManager implements ResourceManagerReloadListener
|
|||
private int latestSoundID;
|
||||
|
||||
/** A reference to the game settings. */
|
||||
private final GameSettings options;
|
||||
private GameSettings options;
|
||||
private final File fileAssets;
|
||||
|
||||
/** Identifiers of all currently playing sounds. Type: HashSet<String> */
|
||||
|
@ -52,6 +49,8 @@ public class SoundManager implements ResourceManagerReloadListener
|
|||
private Random rand = new Random();
|
||||
private int ticksBeforeMusic;
|
||||
|
||||
private HashMap<String,Integer> sounddefinitions;
|
||||
|
||||
public SoundManager(ResourceManager par1ResourceManager, GameSettings par2GameSettings, File par3File)
|
||||
{
|
||||
this.ticksBeforeMusic = this.rand.nextInt(12000);
|
||||
|
@ -60,6 +59,7 @@ public class SoundManager implements ResourceManagerReloadListener
|
|||
this.soundPoolSounds = new SoundPool(par1ResourceManager, "sound", true);
|
||||
this.soundPoolStreaming = new SoundPool(par1ResourceManager, "records", false);
|
||||
this.soundPoolMusic = new SoundPool(par1ResourceManager, "music", true);
|
||||
this.sounddefinitions = null;
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -76,6 +76,32 @@ public class SoundManager implements ResourceManagerReloadListener
|
|||
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)
|
||||
{
|
||||
this.stopAllSounds();
|
||||
|
@ -158,21 +184,13 @@ public class SoundManager implements ResourceManagerReloadListener
|
|||
/**
|
||||
* Called when one of the sound level options has changed.
|
||||
*/
|
||||
public void onSoundOptionsChanged()
|
||||
public void onSoundOptionsChanged() // FIX THIS (maybe)
|
||||
{
|
||||
if (this.loaded)
|
||||
{
|
||||
if (this.options.musicVolume == 0.0F)
|
||||
{
|
||||
this.sndSystem.stop("BgMusic");
|
||||
this.sndSystem.stop("streaming");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.sndSystem.setVolume("BgMusic", this.options.musicVolume);
|
||||
this.sndSystem.setVolume("streaming", this.options.musicVolume);
|
||||
}
|
||||
EaglerAdapter.setMusicVolume(options.musicVolume);
|
||||
if(options.musicVolume > 0.0f) {
|
||||
EaglerAdapter.fireTitleMusicEvent(titleMusic != -1, options.musicVolume);
|
||||
}
|
||||
EaglerAdapter.setMasterVolume(options.soundVolume);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -593,4 +611,23 @@ public class SoundManager implements ResourceManagerReloadListener
|
|||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ public class SoundPool
|
|||
private URL func_110654_c(String par1Str) throws MalformedURLException
|
||||
{
|
||||
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);
|
||||
return new URL((URL)null, var3, var4);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ public class TileEntityRenderer
|
|||
public static double staticPlayerZ;
|
||||
|
||||
/** The RenderEngine instance used by the TileEntityRenderer */
|
||||
public TextureManager renderEngine;
|
||||
public RenderEngine renderEngine;
|
||||
|
||||
/** Reference to the World object. */
|
||||
public World worldObj;
|
||||
|
@ -103,7 +103,7 @@ public class TileEntityRenderer
|
|||
* bound EntityLiving's interpolated pitch, yaw and position. Args: world, renderengine, fontrenderer, entityliving,
|
||||
* 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)
|
||||
{
|
||||
|
|
|
@ -13,7 +13,7 @@ public abstract class TileEntitySpecialRenderer
|
|||
|
||||
protected void bindTexture(TextureLocation par1TextureLocation)
|
||||
{
|
||||
TextureManager var2 = this.tileEntityRenderer.renderEngine;
|
||||
RenderEngine var2 = this.tileEntityRenderer.renderEngine;
|
||||
|
||||
if (var2 != null)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue