84 errors, fixing TextureLocation

This commit is contained in:
catfoolyou 2025-01-30 13:52:13 -05:00
parent 1552a76fe3
commit 49504c5a7b
72 changed files with 2032 additions and 2827 deletions

View File

@ -1,98 +0,0 @@
package net.minecraft.src;
public abstract class AbstractClientPlayer extends EntityPlayer
{
public static final ResourceLocation locationStevePng = new ResourceLocation("textures/entity/steve.png");
private ThreadDownloadImageData downloadImageSkin;
private ThreadDownloadImageData downloadImageCape;
private ResourceLocation locationSkin;
private ResourceLocation locationCape;
public AbstractClientPlayer(World par1World, String par2Str)
{
super(par1World, par2Str);
this.setupCustomSkin();
}
protected void setupCustomSkin()
{
System.out.println("Setting up custom skins");
if (this.username != null && !this.username.isEmpty())
{
this.locationSkin = getLocationSkin(this.username);
this.locationCape = getLocationCape(this.username);
this.downloadImageSkin = getDownloadImageSkin(this.locationSkin, this.username);
this.downloadImageCape = getDownloadImageCape(this.locationCape, this.username);
}
}
public ThreadDownloadImageData getTextureSkin()
{
return this.downloadImageSkin;
}
public ThreadDownloadImageData getTextureCape()
{
return this.downloadImageCape;
}
public ResourceLocation getLocationSkin()
{
return this.locationSkin;
}
public ResourceLocation getLocationCape()
{
return this.locationCape;
}
public static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation par0ResourceLocation, String par1Str)
{
return getDownloadImage(par0ResourceLocation, getSkinUrl(par1Str), locationStevePng, new ImageBufferDownload());
}
public static ThreadDownloadImageData getDownloadImageCape(ResourceLocation par0ResourceLocation, String par1Str)
{
return getDownloadImage(par0ResourceLocation, getCapeUrl(par1Str), (ResourceLocation)null, (IImageBuffer)null);
}
private static ThreadDownloadImageData getDownloadImage(ResourceLocation par0ResourceLocation, String par1Str, ResourceLocation par2ResourceLocation, IImageBuffer par3IImageBuffer)
{
TextureManager var4 = Minecraft.getMinecraft().getTextureManager();
Object var5 = var4.getTexture(par0ResourceLocation);
if (var5 == null)
{
var5 = new ThreadDownloadImageData(par1Str, par2ResourceLocation, par3IImageBuffer);
var4.loadTexture(par0ResourceLocation, (TextureObject)var5);
}
return (ThreadDownloadImageData)var5;
}
public static String getSkinUrl(String par0Str)
{
return String.format("http://skins.minecraft.net/MinecraftSkins/%s.png", new Object[] {StringUtils.stripControlCodes(par0Str)});
}
public static String getCapeUrl(String par0Str)
{
return String.format("http://skins.minecraft.net/MinecraftCloaks/%s.png", new Object[] {StringUtils.stripControlCodes(par0Str)});
}
public static ResourceLocation getLocationSkin(String par0Str)
{
return new ResourceLocation("skins/" + StringUtils.stripControlCodes(par0Str));
}
public static ResourceLocation getLocationCape(String par0Str)
{
return new ResourceLocation("cloaks/" + StringUtils.stripControlCodes(par0Str));
}
public static ResourceLocation getLocationSkull(String par0Str)
{
return new ResourceLocation("skull/" + StringUtils.stripControlCodes(par0Str));
}
}

View File

@ -1,139 +0,0 @@
package net.minecraft.src;
public class DemoWorldManager extends ItemInWorldManager
{
private boolean field_73105_c;
private boolean demoTimeExpired;
private int field_73104_e;
private int field_73102_f;
public DemoWorldManager(World par1World)
{
super(par1World);
}
public void updateBlockRemoving()
{
super.updateBlockRemoving();
++this.field_73102_f;
long var1 = this.theWorld.getTotalWorldTime();
long var3 = var1 / 24000L + 1L;
if (!this.field_73105_c && this.field_73102_f > 20)
{
this.field_73105_c = true;
this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(5, 0));
}
this.demoTimeExpired = var1 > 120500L;
if (this.demoTimeExpired)
{
++this.field_73104_e;
}
if (var1 % 24000L == 500L)
{
if (var3 <= 6L)
{
this.thisPlayerMP.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("demo.day." + var3));
}
}
else if (var3 == 1L)
{
if (var1 == 100L)
{
this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(5, 101));
}
else if (var1 == 175L)
{
this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(5, 102));
}
else if (var1 == 250L)
{
this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(5, 103));
}
}
else if (var3 == 5L && var1 % 24000L == 22000L)
{
this.thisPlayerMP.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("demo.day.warning"));
}
}
/**
* Sends a message to the player reminding them that this is the demo version
*/
private void sendDemoReminder()
{
if (this.field_73104_e > 100)
{
this.thisPlayerMP.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("demo.reminder"));
this.field_73104_e = 0;
}
}
/**
* if not creative, it calls destroyBlockInWorldPartially untill the block is broken first. par4 is the specific
* side. tryHarvestBlock can also be the result of this call
*/
public void onBlockClicked(int par1, int par2, int par3, int par4)
{
if (this.demoTimeExpired)
{
this.sendDemoReminder();
}
else
{
super.onBlockClicked(par1, par2, par3, par4);
}
}
public void uncheckedTryHarvestBlock(int par1, int par2, int par3)
{
if (!this.demoTimeExpired)
{
super.uncheckedTryHarvestBlock(par1, par2, par3);
}
}
/**
* Attempts to harvest a block at the given coordinate
*/
public boolean tryHarvestBlock(int par1, int par2, int par3)
{
return this.demoTimeExpired ? false : super.tryHarvestBlock(par1, par2, par3);
}
/**
* Attempts to right-click use an item by the given EntityPlayer in the given World
*/
public boolean tryUseItem(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack)
{
if (this.demoTimeExpired)
{
this.sendDemoReminder();
return false;
}
else
{
return super.tryUseItem(par1EntityPlayer, par2World, par3ItemStack);
}
}
/**
* Activate the clicked on block, otherwise use the held item. Args: player, world, itemStack, x, y, z, side,
* xOffset, yOffset, zOffset
*/
public boolean activateBlockOrUseItem(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
if (this.demoTimeExpired)
{
this.sendDemoReminder();
return false;
}
else
{
return super.activateBlockOrUseItem(par1EntityPlayer, par2World, par3ItemStack, par4, par5, par6, par7, par8, par9, par10);
}
}
}

View File

@ -1,14 +0,0 @@
package net.minecraft.src;
import net.minecraft.server.MinecraftServer;
public class DemoWorldServer extends WorldServer
{
private static final long demoWorldSeed = (long)"North Carolina".hashCode();
public static final WorldSettings demoWorldSettings = (new WorldSettings(demoWorldSeed, EnumGameType.SURVIVAL, true, false, WorldType.DEFAULT)).enableBonusChest();
public DemoWorldServer(MinecraftServer par1MinecraftServer, ISaveHandler par2ISaveHandler, String par3Str, int par4, Profiler par5Profiler, ILogAgent par6ILogAgent)
{
super(par1MinecraftServer, par2ISaveHandler, par3Str, par4, demoWorldSettings, par5Profiler, par6ILogAgent);
}
}

View File

@ -3,11 +3,13 @@ package net.minecraft.src;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
public class EffectRenderer public class EffectRenderer
{ {
private static final ResourceLocation particleTextures = new ResourceLocation("textures/particle/particles.png"); private static final TextureLocation particleTextures = new TextureLocation("textures/particle/particles.png");
/** Reference to the World object. */ /** Reference to the World object. */
protected World worldObj; protected World worldObj;
@ -83,15 +85,15 @@ public class EffectRenderer
{ {
case 0: case 0:
default: default:
this.renderer.bindTexture(particleTextures); particleTextures.bindTexture();
break; break;
case 1: case 1:
this.renderer.bindTexture(TextureMap.locationBlocksTexture); TextureMap.locationBlocksTexture.bindTexture();
break; break;
case 2: case 2:
this.renderer.bindTexture(TextureMap.locationItemsTexture); TextureMap.locationItemsTexture.bindTexture();
} }
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

View File

@ -1,10 +1,11 @@
package net.minecraft.src; package net.minecraft.src;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
public class EntityFootStepFX extends EntityFX public class EntityFootStepFX extends EntityFX
{ {
private static final ResourceLocation field_110126_a = new ResourceLocation("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 TextureManager currentFootSteps;
@ -35,7 +36,7 @@ public class EntityFootStepFX extends EntityFX
float var12 = (float)(this.posY - interpPosY); float var12 = (float)(this.posY - interpPosY);
float var13 = (float)(this.posZ - interpPosZ); float var13 = (float)(this.posZ - interpPosZ);
float var14 = this.worldObj.getLightBrightness(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)); float var14 = this.worldObj.getLightBrightness(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ));
this.currentFootSteps.bindTexture(field_110126_a); field_110126_a.bindTexture();
GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
par1Tessellator.startDrawingQuads(); par1Tessellator.startDrawingQuads();

View File

@ -1,10 +1,11 @@
package net.minecraft.src; package net.minecraft.src;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
public class EntityLargeExplodeFX extends EntityFX public class EntityLargeExplodeFX extends EntityFX
{ {
private static final ResourceLocation field_110127_a = new ResourceLocation("textures/entity/explosion.png"); private static final TextureLocation field_110127_a = new TextureLocation("textures/entity/explosion.png");
private int field_70581_a; private int field_70581_a;
private int field_70584_aq; private int field_70584_aq;
@ -27,7 +28,7 @@ public class EntityLargeExplodeFX extends EntityFX
if (var8 <= 15) if (var8 <= 15)
{ {
this.theRenderEngine.bindTexture(field_110127_a); field_110127_a.bindTexture();
float var9 = (float)(var8 % 4) / 4.0F; float var9 = (float)(var8 % 4) / 4.0F;
float var10 = var9 + 0.24975F; float var10 = var9 + 0.24975F;
float var11 = (float)(var8 / 4) / 4.0F; float var11 = (float)(var8 / 4) / 4.0F;

View File

@ -3,6 +3,9 @@ package net.minecraft.src;
import java.nio.FloatBuffer; import java.nio.FloatBuffer;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
import net.lax1dude.eaglercraft.EaglerImage;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.input.Mouse; import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.Display; import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
@ -11,8 +14,8 @@ import org.lwjgl.util.glu.Project;
public class EntityRenderer public class EntityRenderer
{ {
private static final ResourceLocation locationRainPng = new ResourceLocation("textures/environment/rain.png"); private static final TextureLocation locationRainPng = new TextureLocation("textures/environment/rain.png");
private static final ResourceLocation locationSnowPng = new ResourceLocation("textures/environment/snow.png"); private static final TextureLocation locationSnowPng = new TextureLocation("textures/environment/snow.png");
public static boolean anaglyphEnable; public static boolean anaglyphEnable;
/** Anaglyph field (0=R, 1=GB) */ /** Anaglyph field (0=R, 1=GB) */
@ -79,7 +82,7 @@ public class EntityRenderer
* Colors computed in updateLightmap() and loaded into the lightmap emptyTexture * Colors computed in updateLightmap() and loaded into the lightmap emptyTexture
*/ */
private final int[] lightmapColors; private final int[] lightmapColors;
private final ResourceLocation locationLightMap; private final TextureLocation locationLightMap;
/** FOV modifier hand */ /** FOV modifier hand */
private float fovModifierHand; private float fovModifierHand;
@ -159,7 +162,7 @@ public class EntityRenderer
this.mc = par1Minecraft; this.mc = par1Minecraft;
this.itemRenderer = new ItemRenderer(par1Minecraft); this.itemRenderer = new ItemRenderer(par1Minecraft);
this.lightmapTexture = new DynamicTexture(16, 16); this.lightmapTexture = new DynamicTexture(16, 16);
this.locationLightMap = par1Minecraft.getTextureManager().getDynamicTextureLocation("lightMap", this.lightmapTexture); this.locationLightMap = par1Minecraft.renderEngine.allocateAndSetupTexture(new EaglerImage(16, 16, true));
this.lightmapColors = this.lightmapTexture.getTextureData(); this.lightmapColors = this.lightmapTexture.getTextureData();
} }

File diff suppressed because it is too large Load Diff

View File

@ -10,49 +10,53 @@ import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import org.lwjgl.opengl.GL11;
public class GLAllocation import net.lax1dude.eaglercraft.EaglerAdapter;
{
public class GLAllocation {
private static final Map field_74531_a = new HashMap(); private static final Map field_74531_a = new HashMap();
private static final List field_74530_b = new ArrayList(); private static final List field_74530_b = new ArrayList();
/** /**
* Generates the specified number of display lists and returns the first index. * Generates the specified number of display lists and returns the first index.
*/ */
public static synchronized int generateDisplayLists(int par0) public static int generateDisplayLists(int par0) {
{ int var1 = EaglerAdapter.glGenLists(par0);
int var1 = GL11.glGenLists(par0);
field_74531_a.put(Integer.valueOf(var1), Integer.valueOf(par0)); field_74531_a.put(Integer.valueOf(var1), Integer.valueOf(par0));
return var1; return var1;
} }
public static synchronized void deleteDisplayLists(int par0) /**
{ * Generates texture names and stores them in the specified buffer.
GL11.glDeleteLists(par0, ((Integer)field_74531_a.remove(Integer.valueOf(par0))).intValue()); */
public static int generateTextureNames() {
int var0 = EaglerAdapter.glGenTextures();
field_74530_b.add(Integer.valueOf(var0));
return var0;
} }
public static synchronized void func_98302_b() public static void deleteDisplayLists(int par0) {
{ EaglerAdapter.glDeleteLists(par0, ((Integer) field_74531_a.remove(Integer.valueOf(par0))).intValue());
for (int var0 = 0; var0 < field_74530_b.size(); ++var0) }
{
GL11.glDeleteTextures(((Integer)field_74530_b.get(var0)).intValue()); public static void func_98302_b() {
for (int var0 = 0; var0 < field_74530_b.size(); ++var0) {
EaglerAdapter.glDeleteTextures(((Integer) field_74530_b.get(var0)).intValue());
} }
field_74530_b.clear(); field_74530_b.clear();
} }
/** /**
* Deletes all textures and display lists. Called when Minecraft is shutdown to free up resources. * Deletes all textures and display lists. Called when Minecraft is shutdown to
* free up resources.
*/ */
public static synchronized void deleteTexturesAndDisplayLists() public static void deleteTexturesAndDisplayLists() {
{
Iterator var0 = field_74531_a.entrySet().iterator(); Iterator var0 = field_74531_a.entrySet().iterator();
while (var0.hasNext()) while (var0.hasNext()) {
{
Entry var1 = (Entry) var0.next(); Entry var1 = (Entry) var0.next();
GL11.glDeleteLists(((Integer)var1.getKey()).intValue(), ((Integer)var1.getValue()).intValue()); EaglerAdapter.glDeleteLists(((Integer) var1.getKey()).intValue(), ((Integer) var1.getValue()).intValue());
} }
field_74531_a.clear(); field_74531_a.clear();
@ -60,27 +64,26 @@ public class GLAllocation
} }
/** /**
* Creates and returns a direct byte buffer with the specified capacity. Applies native ordering to speed up access. * Creates and returns a direct byte buffer with the specified capacity. Applies
* native ordering to speed up access.
*/ */
public static synchronized ByteBuffer createDirectByteBuffer(int par0) public static ByteBuffer createDirectByteBuffer(int par0) {
{ return EaglerAdapter.isWebGL ? ByteBuffer.wrap(new byte[par0]) : ByteBuffer.allocateDirect(par0).order(ByteOrder.nativeOrder());
return ByteBuffer.allocateDirect(par0).order(ByteOrder.nativeOrder());
} }
/** /**
* Creates and returns a direct int buffer with the specified capacity. Applies native ordering to speed up access. * Creates and returns a direct int buffer with the specified capacity. Applies
* native ordering to speed up access.
*/ */
public static IntBuffer createDirectIntBuffer(int par0) public static IntBuffer createDirectIntBuffer(int par0) {
{ return EaglerAdapter.isWebGL ? IntBuffer.wrap(new int[par0]) : createDirectByteBuffer(par0 << 2).asIntBuffer();
return createDirectByteBuffer(par0 << 2).asIntBuffer();
} }
/** /**
* Creates and returns a direct float buffer with the specified capacity. Applies native ordering to speed up * Creates and returns a direct float buffer with the specified capacity.
* access. * Applies native ordering to speed up access.
*/ */
public static FloatBuffer createDirectFloatBuffer(int par0) public static FloatBuffer createDirectFloatBuffer(int par0) {
{ return EaglerAdapter.isWebGL ? FloatBuffer.wrap(new float[par0]) : createDirectByteBuffer(par0 << 2).asFloatBuffer();
return createDirectByteBuffer(par0 << 2).asFloatBuffer();
} }
} }

View File

@ -1,12 +1,13 @@
package net.minecraft.src; package net.minecraft.src;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
public class Gui public class Gui
{ {
public static final ResourceLocation optionsBackground = new ResourceLocation("textures/gui/options_background.png"); public static final TextureLocation optionsBackground = new TextureLocation("textures/gui/options_background.png");
public static final ResourceLocation statIcons = new ResourceLocation("textures/gui/container/stats_icons.png"); public static final TextureLocation statIcons = new TextureLocation("textures/gui/container/stats_icons.png");
public static final ResourceLocation icons = new ResourceLocation("textures/gui/icons.png"); public static final TextureLocation icons = new TextureLocation("textures/gui/icons.png");
protected float zLevel; protected float zLevel;
protected void drawHorizontalLine(int par1, int par2, int par3, int par4) protected void drawHorizontalLine(int par1, int par2, int par3, int par4)

View File

@ -1,11 +1,12 @@
package net.minecraft.src; package net.minecraft.src;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12; import org.lwjgl.opengl.GL12;
public class GuiAchievement extends Gui public class GuiAchievement extends Gui
{ {
private static final ResourceLocation achievementTextures = new ResourceLocation("textures/gui/achievement/achievement_background.png"); private static final TextureLocation achievementTextures = new TextureLocation("textures/gui/achievement/achievement_background.png");
/** Holds the instance of the game (Minecraft) */ /** Holds the instance of the game (Minecraft) */
private Minecraft theGame; private Minecraft theGame;
@ -121,7 +122,7 @@ public class GuiAchievement extends Gui
int var6 = 0 - (int)(var3 * 36.0D); int var6 = 0 - (int)(var3 * 36.0D);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_TEXTURE_2D);
this.theGame.getTextureManager().bindTexture(achievementTextures); achievementTextures.bindTexture();
GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_LIGHTING);
this.drawTexturedModalRect(var5, var6, 96, 202, 160, 32); this.drawTexturedModalRect(var5, var6, 96, 202, 160, 32);

View File

@ -1,6 +1,8 @@
package net.minecraft.src; package net.minecraft.src;
import java.util.Random; import java.util.Random;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.input.Mouse; import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12; import org.lwjgl.opengl.GL12;
@ -18,7 +20,7 @@ public class GuiAchievements extends GuiScreen
/** The right y coordinate of the achievement map */ /** The right y coordinate of the achievement map */
private static final int guiMapRight = AchievementList.maxDisplayRow * 24 - 77; private static final int guiMapRight = AchievementList.maxDisplayRow * 24 - 77;
private static final ResourceLocation achievementTextures = new ResourceLocation("textures/gui/achievement/achievement_background.png"); private static final TextureLocation achievementTextures = new TextureLocation("textures/gui/achievement/achievement_background.png");
protected int achievementsPaneWidth = 256; protected int achievementsPaneWidth = 256;
protected int achievementsPaneHeight = 202; protected int achievementsPaneHeight = 202;
@ -284,7 +286,7 @@ public class GuiAchievements extends GuiScreen
var24 = Block.bedrock.getIcon(0, 0); var24 = Block.bedrock.getIcon(0, 0);
} }
this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); TextureMap.locationBlocksTexture.bindTexture();
this.drawTexturedModelRectFromIcon(var8 + var22 * 16 - var12, var9 + var20 * 16 - var13, var24, 16, 16); this.drawTexturedModelRectFromIcon(var8 + var22 * 16 - var12, var9 + var20 * 16 - var13, var24, 16, 16);
} }
} }
@ -360,7 +362,7 @@ public class GuiAchievements extends GuiScreen
GL11.glColor4f(var36, var36, var36, 1.0F); GL11.glColor4f(var36, var36, var36, 1.0F);
} }
this.mc.getTextureManager().bindTexture(achievementTextures); achievementTextures.bindTexture();
var38 = var8 + var37; var38 = var8 + var37;
var39 = var9 + var25; var39 = var9 + var25;
@ -402,7 +404,7 @@ public class GuiAchievements extends GuiScreen
GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_BLEND);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(achievementTextures); achievementTextures.bindTexture();
this.drawTexturedModalRect(var6, var7, 0, 0, this.achievementsPaneWidth, this.achievementsPaneHeight); this.drawTexturedModalRect(var6, var7, 0, 0, this.achievementsPaneWidth, this.achievementsPaneHeight);
GL11.glPopMatrix(); GL11.glPopMatrix();
this.zLevel = 0.0F; this.zLevel = 0.0F;

View File

@ -3,11 +3,13 @@ package net.minecraft.src;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.util.Iterator; import java.util.Iterator;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
public class GuiBeacon extends GuiContainer public class GuiBeacon extends GuiContainer
{ {
private static final ResourceLocation beaconGuiTextures = new ResourceLocation("textures/gui/container/beacon.png"); private static final TextureLocation beaconGuiTextures = new TextureLocation("textures/gui/container/beacon.png");
private TileEntityBeacon beacon; private TileEntityBeacon beacon;
private GuiBeaconButtonConfirm beaconConfirmButton; private GuiBeaconButtonConfirm beaconConfirmButton;
private boolean buttonsNotDrawn; private boolean buttonsNotDrawn;
@ -193,7 +195,7 @@ public class GuiBeacon extends GuiContainer
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{ {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(beaconGuiTextures); beaconGuiTextures.bindTexture();
int var4 = (this.width - this.xSize) / 2; int var4 = (this.width - this.xSize) / 2;
int var5 = (this.height - this.ySize) / 2; int var5 = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize);
@ -205,7 +207,7 @@ public class GuiBeacon extends GuiContainer
itemRenderer.zLevel = 0.0F; itemRenderer.zLevel = 0.0F;
} }
static ResourceLocation getBeaconGuiTextures() static TextureLocation getBeaconGuiTextures()
{ {
return beaconGuiTextures; return beaconGuiTextures;
} }

View File

@ -1,16 +1,17 @@
package net.minecraft.src; package net.minecraft.src;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
class GuiBeaconButton extends GuiButton class GuiBeaconButton extends GuiButton
{ {
/** Texture for this button. */ /** Texture for this button. */
private final ResourceLocation buttonTexture; private final TextureLocation buttonTexture;
private final int field_82257_l; private final int field_82257_l;
private final int field_82258_m; private final int field_82258_m;
private boolean field_82256_n; private boolean field_82256_n;
protected GuiBeaconButton(int par1, int par2, int par3, ResourceLocation par4ResourceLocation, int par5, int par6) protected GuiBeaconButton(int par1, int par2, int par3, TextureLocation par4ResourceLocation, int par5, int par6)
{ {
super(par1, par2, par3, 22, 22, ""); super(par1, par2, par3, 22, 22, "");
this.buttonTexture = par4ResourceLocation; this.buttonTexture = par4ResourceLocation;
@ -25,7 +26,7 @@ class GuiBeaconButton extends GuiButton
{ {
if (this.drawButton) if (this.drawButton)
{ {
par1Minecraft.getTextureManager().bindTexture(GuiBeacon.getBeaconGuiTextures()); GuiBeacon.getBeaconGuiTextures().bindTexture();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.field_82253_i = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; this.field_82253_i = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height;
short var4 = 219; short var4 = 219;
@ -48,7 +49,7 @@ class GuiBeaconButton extends GuiButton
if (!GuiBeacon.getBeaconGuiTextures().equals(this.buttonTexture)) if (!GuiBeacon.getBeaconGuiTextures().equals(this.buttonTexture))
{ {
par1Minecraft.getTextureManager().bindTexture(this.buttonTexture); this.buttonTexture.bindTexture();
} }
this.drawTexturedModalRect(this.xPosition + 2, this.yPosition + 2, this.field_82257_l, this.field_82258_m, 18, 18); this.drawTexturedModalRect(this.xPosition + 2, this.yPosition + 2, this.field_82257_l, this.field_82258_m, 18, 18);

View File

@ -1,10 +1,11 @@
package net.minecraft.src; package net.minecraft.src;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import net.lax1dude.eaglercraft.TextureLocation;
public class GuiBrewingStand extends GuiContainer public class GuiBrewingStand extends GuiContainer
{ {
private static final ResourceLocation brewingStandGuiTextures = new ResourceLocation("textures/gui/container/brewing_stand.png"); private static final TextureLocation brewingStandGuiTextures = new TextureLocation("textures/gui/container/brewing_stand.png");
private TileEntityBrewingStand brewingStand; private TileEntityBrewingStand brewingStand;
public GuiBrewingStand(InventoryPlayer par1InventoryPlayer, TileEntityBrewingStand par2TileEntityBrewingStand) public GuiBrewingStand(InventoryPlayer par1InventoryPlayer, TileEntityBrewingStand par2TileEntityBrewingStand)
@ -29,7 +30,7 @@ public class GuiBrewingStand extends GuiContainer
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{ {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(brewingStandGuiTextures); brewingStandGuiTextures.bindTexture();
int var4 = (this.width - this.xSize) / 2; int var4 = (this.width - this.xSize) / 2;
int var5 = (this.height - this.ySize) / 2; int var5 = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize);

View File

@ -22,7 +22,7 @@ class GuiButtonMerchant extends GuiButton
{ {
if (this.drawButton) if (this.drawButton)
{ {
par1Minecraft.getTextureManager().bindTexture(GuiMerchant.func_110417_h()); GuiMerchant.func_110417_h().bindTexture();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
boolean var4 = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; boolean var4 = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height;
int var5 = 0; int var5 = 0;

View File

@ -24,7 +24,7 @@ class GuiButtonNextPage extends GuiButton
{ {
boolean var4 = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; boolean var4 = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height;
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
par1Minecraft.getTextureManager().bindTexture(GuiScreenBook.func_110404_g()); GuiScreenBook.func_110404_g().bindTexture();
int var5 = 0; int var5 = 0;
int var6 = 192; int var6 = 192;

View File

@ -1,10 +1,11 @@
package net.minecraft.src; package net.minecraft.src;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
public class GuiChest extends GuiContainer public class GuiChest extends GuiContainer
{ {
private static final ResourceLocation field_110421_t = new ResourceLocation("textures/gui/container/generic_54.png"); private static final TextureLocation field_110421_t = new TextureLocation("textures/gui/container/generic_54.png");
private IInventory upperChestInventory; private IInventory upperChestInventory;
private IInventory lowerChestInventory; private IInventory lowerChestInventory;
@ -40,7 +41,7 @@ public class GuiChest extends GuiContainer
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{ {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(field_110421_t); field_110421_t.bindTexture();
int var4 = (this.width - this.xSize) / 2; int var4 = (this.width - this.xSize) / 2;
int var5 = (this.height - this.ySize) / 2; int var5 = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.inventoryRows * 18 + 17); this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.inventoryRows * 18 + 17);

View File

@ -5,13 +5,15 @@ import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12; import org.lwjgl.opengl.GL12;
public abstract class GuiContainer extends GuiScreen public abstract class GuiContainer extends GuiScreen
{ {
protected static final ResourceLocation field_110408_a = new ResourceLocation("textures/gui/container/inventory.png"); protected static final TextureLocation field_110408_a = new TextureLocation("textures/gui/container/inventory.png");
/** Stacks renderer. Icons, stack size, health, etc... */ /** Stacks renderer. Icons, stack size, health, etc... */
protected static RenderItem itemRenderer = new RenderItem(); protected static RenderItem itemRenderer = new RenderItem();
@ -372,7 +374,7 @@ public abstract class GuiContainer extends GuiScreen
if (var9 != null) if (var9 != null)
{ {
GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_LIGHTING);
this.mc.getTextureManager().bindTexture(TextureMap.locationItemsTexture); TextureMap.locationItemsTexture.bindTexture();
this.drawTexturedModelRectFromIcon(var2, var3, var9, 16, 16); this.drawTexturedModelRectFromIcon(var2, var3, var9, 16, 16);
GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_LIGHTING);
var6 = true; var6 = true;

View File

@ -4,6 +4,8 @@ import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse; import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
@ -11,7 +13,7 @@ import org.lwjgl.opengl.GL12;
public class GuiContainerCreative extends InventoryEffectRenderer public class GuiContainerCreative extends InventoryEffectRenderer
{ {
private static final ResourceLocation field_110424_t = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); private static final TextureLocation field_110424_t = new TextureLocation("textures/gui/container/creative_inventory/tabs.png");
private static InventoryBasic inventory = new InventoryBasic("tmp", true, 45); private static InventoryBasic inventory = new InventoryBasic("tmp", true, 45);
/** Currently selected creative inventory tab index. */ /** Currently selected creative inventory tab index. */
@ -720,7 +722,7 @@ public class GuiContainerCreative extends InventoryEffectRenderer
for (var7 = 0; var7 < var6; ++var7) for (var7 = 0; var7 < var6; ++var7)
{ {
CreativeTabs var8 = var5[var7]; CreativeTabs var8 = var5[var7];
this.mc.getTextureManager().bindTexture(field_110424_t); field_110424_t.bindTexture();
if (var8.getTabIndex() != selectedTabIndex) if (var8.getTabIndex() != selectedTabIndex)
{ {
@ -728,14 +730,14 @@ public class GuiContainerCreative extends InventoryEffectRenderer
} }
} }
this.mc.getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/creative_inventory/tab_" + var4.getBackgroundImageName())); new TextureLocation("textures/gui/container/creative_inventory/tab_" + var4.getBackgroundImageName()).bindTexture();
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
this.searchField.drawTextBox(); this.searchField.drawTextBox();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
int var9 = this.guiLeft + 175; int var9 = this.guiLeft + 175;
var6 = this.guiTop + 18; var6 = this.guiTop + 18;
var7 = var6 + 112; var7 = var6 + 112;
this.mc.getTextureManager().bindTexture(field_110424_t); field_110424_t.bindTexture();
if (var4.shouldHidePlayerInventory()) if (var4.shouldHidePlayerInventory())
{ {

View File

@ -1,10 +1,11 @@
package net.minecraft.src; package net.minecraft.src;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
public class GuiCrafting extends GuiContainer public class GuiCrafting extends GuiContainer
{ {
private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation("textures/gui/container/crafting_table.png"); private static final TextureLocation craftingTableGuiTextures = new TextureLocation("textures/gui/container/crafting_table.png");
public GuiCrafting(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5) public GuiCrafting(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5)
{ {
@ -26,7 +27,7 @@ public class GuiCrafting extends GuiContainer
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{ {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(craftingTableGuiTextures); craftingTableGuiTextures.bindTexture();
int var4 = (this.width - this.xSize) / 2; int var4 = (this.width - this.xSize) / 2;
int var5 = (this.height - this.ySize) / 2; int var5 = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize);

View File

@ -40,7 +40,7 @@ class GuiCreateFlatWorldListSlot extends GuiSlot
private void func_82450_b(int par1, int par2, int par3, int par4) private void func_82450_b(int par1, int par2, int par3, int par4)
{ {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.createFlatWorldGui.mc.getTextureManager().bindTexture(Gui.statIcons); Gui.statIcons.bindTexture();
float var5 = 0.0078125F; float var5 = 0.0078125F;
float var6 = 0.0078125F; float var6 = 0.0078125F;
boolean var7 = true; boolean var7 = true;

View File

@ -1,10 +1,11 @@
package net.minecraft.src; package net.minecraft.src;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
public class GuiDispenser extends GuiContainer public class GuiDispenser extends GuiContainer
{ {
private static final ResourceLocation dispenserGuiTextures = new ResourceLocation("textures/gui/container/dispenser.png"); private static final TextureLocation dispenserGuiTextures = new TextureLocation("textures/gui/container/dispenser.png");
public TileEntityDispenser theDispenser; public TileEntityDispenser theDispenser;
public GuiDispenser(InventoryPlayer par1InventoryPlayer, TileEntityDispenser par2TileEntityDispenser) public GuiDispenser(InventoryPlayer par1InventoryPlayer, TileEntityDispenser par2TileEntityDispenser)
@ -29,7 +30,7 @@ public class GuiDispenser extends GuiContainer
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{ {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(dispenserGuiTextures); dispenserGuiTextures.bindTexture();
int var4 = (this.width - this.xSize) / 2; int var4 = (this.width - this.xSize) / 2;
int var5 = (this.height - this.ySize) / 2; int var5 = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize);

View File

@ -1,14 +1,16 @@
package net.minecraft.src; package net.minecraft.src;
import java.util.Random; import java.util.Random;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12; import org.lwjgl.opengl.GL12;
import org.lwjgl.util.glu.Project; import org.lwjgl.util.glu.Project;
public class GuiEnchantment extends GuiContainer public class GuiEnchantment extends GuiContainer
{ {
private static final ResourceLocation enchantingTableGuiTextures = new ResourceLocation("textures/gui/container/enchanting_table.png"); private static final TextureLocation enchantingTableGuiTextures = new TextureLocation("textures/gui/container/enchanting_table.png");
private static final ResourceLocation enchantingTableBookTextures = new ResourceLocation("textures/entity/enchanting_table_book.png"); private static final TextureLocation enchantingTableBookTextures = new TextureLocation("textures/entity/enchanting_table_book.png");
/** The book model used on the GUI. */ /** The book model used on the GUI. */
private static final ModelBook bookModel = new ModelBook(); private static final ModelBook bookModel = new ModelBook();
@ -78,7 +80,7 @@ public class GuiEnchantment extends GuiContainer
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{ {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(enchantingTableGuiTextures); enchantingTableGuiTextures.bindTexture();
int var4 = (this.width - this.xSize) / 2; int var4 = (this.width - this.xSize) / 2;
int var5 = (this.height - this.ySize) / 2; int var5 = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize);
@ -99,7 +101,7 @@ public class GuiEnchantment extends GuiContainer
float var8 = 5.0F; float var8 = 5.0F;
GL11.glScalef(var8, var8, var8); GL11.glScalef(var8, var8, var8);
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
this.mc.getTextureManager().bindTexture(enchantingTableBookTextures); enchantingTableBookTextures.bindTexture();
GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F);
float var9 = this.field_74208_u + (this.field_74209_t - this.field_74208_u) * par1; float var9 = this.field_74208_u + (this.field_74209_t - this.field_74208_u) * par1;
GL11.glTranslatef((1.0F - var9) * 0.2F, (1.0F - var9) * 0.1F, (1.0F - var9) * 0.25F); GL11.glTranslatef((1.0F - var9) * 0.2F, (1.0F - var9) * 0.1F, (1.0F - var9) * 0.25F);
@ -147,7 +149,7 @@ public class GuiEnchantment extends GuiContainer
{ {
String var13 = EnchantmentNameParts.instance.generateRandomEnchantName(); String var13 = EnchantmentNameParts.instance.generateRandomEnchantName();
this.zLevel = 0.0F; this.zLevel = 0.0F;
this.mc.getTextureManager().bindTexture(enchantingTableGuiTextures); enchantingTableGuiTextures.bindTexture();
int var14 = this.containerEnchantment.enchantLevels[var12]; int var14 = this.containerEnchantment.enchantLevels[var12];
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

View File

@ -35,7 +35,7 @@ class GuiFlatPresetsListSlot extends GuiSlot
private void func_82455_b(int par1, int par2, int par3, int par4) private void func_82455_b(int par1, int par2, int par3, int par4)
{ {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.flatPresetsGui.mc.getTextureManager().bindTexture(Gui.statIcons); Gui.statIcons.bindTexture();
float var5 = 0.0078125F; float var5 = 0.0078125F;
float var6 = 0.0078125F; float var6 = 0.0078125F;
boolean var7 = true; boolean var7 = true;

View File

@ -1,10 +1,11 @@
package net.minecraft.src; package net.minecraft.src;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
public class GuiFurnace extends GuiContainer public class GuiFurnace extends GuiContainer
{ {
private static final ResourceLocation furnaceGuiTextures = new ResourceLocation("textures/gui/container/furnace.png"); private static final TextureLocation furnaceGuiTextures = new TextureLocation("textures/gui/container/furnace.png");
private TileEntityFurnace furnaceInventory; private TileEntityFurnace furnaceInventory;
public GuiFurnace(InventoryPlayer par1InventoryPlayer, TileEntityFurnace par2TileEntityFurnace) public GuiFurnace(InventoryPlayer par1InventoryPlayer, TileEntityFurnace par2TileEntityFurnace)
@ -29,7 +30,7 @@ public class GuiFurnace extends GuiContainer
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{ {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(furnaceGuiTextures); furnaceGuiTextures.bindTexture();
int var4 = (this.width - this.xSize) / 2; int var4 = (this.width - this.xSize) / 2;
int var5 = (this.height - this.ySize) / 2; int var5 = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize);

View File

@ -1,10 +1,11 @@
package net.minecraft.src; package net.minecraft.src;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
public class GuiHopper extends GuiContainer public class GuiHopper extends GuiContainer
{ {
private static final ResourceLocation hopperGuiTextures = new ResourceLocation("textures/gui/container/hopper.png"); private static final TextureLocation hopperGuiTextures = new TextureLocation("textures/gui/container/hopper.png");
private IInventory field_94081_r; private IInventory field_94081_r;
private IInventory field_94080_s; private IInventory field_94080_s;
@ -32,7 +33,7 @@ public class GuiHopper extends GuiContainer
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{ {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(hopperGuiTextures); hopperGuiTextures.bindTexture();
int var4 = (this.width - this.xSize) / 2; int var4 = (this.width - this.xSize) / 2;
int var5 = (this.height - this.ySize) / 2; int var5 = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize);

View File

@ -5,14 +5,16 @@ import java.util.Collection;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12; import org.lwjgl.opengl.GL12;
public class GuiIngame extends Gui public class GuiIngame extends Gui
{ {
private static final ResourceLocation vignetteTexPath = new ResourceLocation("textures/misc/vignette.png"); private static final TextureLocation vignetteTexPath = new TextureLocation("textures/misc/vignette.png");
private static final ResourceLocation widgetsTexPath = new ResourceLocation("textures/gui/widgets.png"); private static final TextureLocation widgetsTexPath = new TextureLocation("textures/gui/widgets.png");
private static final ResourceLocation pumpkinBlurTexPath = new ResourceLocation("textures/misc/pumpkinblur.png"); private static final TextureLocation pumpkinBlurTexPath = new TextureLocation("textures/misc/pumpkinblur.png");
private static final RenderItem itemRenderer = new RenderItem(); private static final RenderItem itemRenderer = new RenderItem();
private final Random rand = new Random(); private final Random rand = new Random();
private final Minecraft mc; private final Minecraft mc;
@ -88,12 +90,12 @@ public class GuiIngame extends Gui
if (!this.mc.playerController.enableEverythingIsScrewedUpMode()) if (!this.mc.playerController.enableEverythingIsScrewedUpMode())
{ {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(widgetsTexPath); widgetsTexPath.bindTexture();
InventoryPlayer var31 = this.mc.thePlayer.inventory; InventoryPlayer var31 = this.mc.thePlayer.inventory;
this.zLevel = -90.0F; this.zLevel = -90.0F;
this.drawTexturedModalRect(var6 / 2 - 91, var7 - 22, 0, 0, 182, 22); this.drawTexturedModalRect(var6 / 2 - 91, var7 - 22, 0, 0, 182, 22);
this.drawTexturedModalRect(var6 / 2 - 91 - 1 + var31.currentItem * 20, var7 - 22 - 1, 0, 22, 24, 22); this.drawTexturedModalRect(var6 / 2 - 91 - 1 + var31.currentItem * 20, var7 - 22 - 1, 0, 22, 24, 22);
this.mc.getTextureManager().bindTexture(icons); icons.bindTexture();
GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR); GL11.glBlendFunc(GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR);
this.drawTexturedModalRect(var6 / 2 - 7, var7 / 2 - 7, 0, 0, 16, 16); this.drawTexturedModalRect(var6 / 2 - 7, var7 / 2 - 7, 0, 0, 16, 16);
@ -159,7 +161,7 @@ public class GuiIngame extends Gui
if (this.mc.thePlayer.isRidingHorse()) if (this.mc.thePlayer.isRidingHorse())
{ {
this.mc.mcProfiler.startSection("jumpBar"); this.mc.mcProfiler.startSection("jumpBar");
this.mc.getTextureManager().bindTexture(Gui.icons); Gui.icons.bindTexture();
var34 = this.mc.thePlayer.getHorseJumpPower(); var34 = this.mc.thePlayer.getHorseJumpPower();
var35 = 182; var35 = 182;
var14 = (int)(var34 * (float)(var35 + 1)); var14 = (int)(var34 * (float)(var35 + 1));
@ -176,7 +178,7 @@ public class GuiIngame extends Gui
else if (this.mc.playerController.func_78763_f()) else if (this.mc.playerController.func_78763_f())
{ {
this.mc.mcProfiler.startSection("expBar"); this.mc.mcProfiler.startSection("expBar");
this.mc.getTextureManager().bindTexture(Gui.icons); Gui.icons.bindTexture();
var12 = this.mc.thePlayer.xpBarCap(); var12 = this.mc.thePlayer.xpBarCap();
if (var12 > 0) if (var12 > 0)
@ -414,7 +416,7 @@ public class GuiIngame extends Gui
} }
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(icons); icons.bindTexture();
byte var51 = 0; byte var51 = 0;
boolean var52 = false; boolean var52 = false;
byte var53; byte var53;
@ -807,7 +809,7 @@ public class GuiIngame extends Gui
String var8 = BossStatus.bossName; String var8 = BossStatus.bossName;
var1.drawStringWithShadow(var8, var3 / 2 - var1.getStringWidth(var8) / 2, var7 - 10, 16777215); var1.drawStringWithShadow(var8, var3 / 2 - var1.getStringWidth(var8) / 2, var7 - 10, 16777215);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(icons); icons.bindTexture();
} }
} }
@ -818,7 +820,7 @@ public class GuiIngame extends Gui
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glDisable(GL11.GL_ALPHA_TEST);
this.mc.getTextureManager().bindTexture(pumpkinBlurTexPath); pumpkinBlurTexPath.bindTexture();
Tessellator var3 = Tessellator.instance; Tessellator var3 = Tessellator.instance;
var3.startDrawingQuads(); var3.startDrawingQuads();
var3.addVertexWithUV(0.0D, (double)par2, -90.0D, 0.0D, 1.0D); var3.addVertexWithUV(0.0D, (double)par2, -90.0D, 0.0D, 1.0D);
@ -854,7 +856,7 @@ public class GuiIngame extends Gui
GL11.glDepthMask(false); GL11.glDepthMask(false);
GL11.glBlendFunc(GL11.GL_ZERO, GL11.GL_ONE_MINUS_SRC_COLOR); GL11.glBlendFunc(GL11.GL_ZERO, GL11.GL_ONE_MINUS_SRC_COLOR);
GL11.glColor4f(this.prevVignetteBrightness, this.prevVignetteBrightness, this.prevVignetteBrightness, 1.0F); GL11.glColor4f(this.prevVignetteBrightness, this.prevVignetteBrightness, this.prevVignetteBrightness, 1.0F);
this.mc.getTextureManager().bindTexture(vignetteTexPath); vignetteTexPath.bindTexture();
Tessellator var4 = Tessellator.instance; Tessellator var4 = Tessellator.instance;
var4.startDrawingQuads(); var4.startDrawingQuads();
var4.addVertexWithUV(0.0D, (double)par3, -90.0D, 0.0D, 1.0D); var4.addVertexWithUV(0.0D, (double)par3, -90.0D, 0.0D, 1.0D);
@ -883,7 +885,7 @@ public class GuiIngame extends Gui
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glColor4f(1.0F, 1.0F, 1.0F, par1); GL11.glColor4f(1.0F, 1.0F, 1.0F, par1);
Icon var4 = Block.portal.getBlockTextureFromSide(1); Icon var4 = Block.portal.getBlockTextureFromSide(1);
this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); TextureMap.locationBlocksTexture.bindTexture();
float var5 = var4.getMinU(); float var5 = var4.getMinU();
float var6 = var4.getMinV(); float var6 = var4.getMinV();
float var7 = var4.getMaxU(); float var7 = var4.getMaxU();

View File

@ -74,7 +74,7 @@ public class GuiInventory extends InventoryEffectRenderer
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{ {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(field_110408_a); field_110408_a.bindTexture();
int var4 = this.guiLeft; int var4 = this.guiLeft;
int var5 = this.guiTop; int var5 = this.guiTop;
this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize);

File diff suppressed because it is too large Load Diff

View File

@ -2,12 +2,14 @@ package net.minecraft.src;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12; import org.lwjgl.opengl.GL12;
public class GuiMerchant extends GuiContainer public class GuiMerchant extends GuiContainer
{ {
private static final ResourceLocation merchantGuiTextures = new ResourceLocation("textures/gui/container/villager.png"); private static final TextureLocation merchantGuiTextures = new TextureLocation("textures/gui/container/villager.png");
/** Instance of IMerchant interface. */ /** Instance of IMerchant interface. */
private IMerchant theIMerchant; private IMerchant theIMerchant;
@ -103,7 +105,7 @@ public class GuiMerchant extends GuiContainer
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{ {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(merchantGuiTextures); merchantGuiTextures.bindTexture();
int var4 = (this.width - this.xSize) / 2; int var4 = (this.width - this.xSize) / 2;
int var5 = (this.height - this.ySize) / 2; int var5 = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize);
@ -116,7 +118,7 @@ public class GuiMerchant extends GuiContainer
if (var8.func_82784_g()) if (var8.func_82784_g())
{ {
this.mc.getTextureManager().bindTexture(merchantGuiTextures); merchantGuiTextures.bindTexture();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_LIGHTING);
this.drawTexturedModalRect(this.guiLeft + 83, this.guiTop + 21, 212, 0, 28, 21); this.drawTexturedModalRect(this.guiLeft + 83, this.guiTop + 21, 212, 0, 28, 21);
@ -191,7 +193,7 @@ public class GuiMerchant extends GuiContainer
return this.theIMerchant; return this.theIMerchant;
} }
static ResourceLocation func_110417_h() static TextureLocation func_110417_h()
{ {
return merchantGuiTextures; return merchantGuiTextures;
} }

View File

@ -1,12 +1,14 @@
package net.minecraft.src; package net.minecraft.src;
import java.util.List; import java.util.List;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
public class GuiRepair extends GuiContainer implements ICrafting public class GuiRepair extends GuiContainer implements ICrafting
{ {
private static final ResourceLocation anvilGuiTextures = new ResourceLocation("textures/gui/container/anvil.png"); private static final TextureLocation anvilGuiTextures = new TextureLocation("textures/gui/container/anvil.png");
private ContainerRepair repairContainer; private ContainerRepair repairContainer;
private GuiTextField itemNameField; private GuiTextField itemNameField;
private InventoryPlayer field_82325_q; private InventoryPlayer field_82325_q;
@ -153,7 +155,7 @@ public class GuiRepair extends GuiContainer implements ICrafting
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{ {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(anvilGuiTextures); anvilGuiTextures.bindTexture();
int var4 = (this.width - this.xSize) / 2; int var4 = (this.width - this.xSize) / 2;
int var5 = (this.height - this.ySize) / 2; int var5 = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize);

View File

@ -2,12 +2,14 @@ package net.minecraft.src;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
public class GuiScreenBook extends GuiScreen public class GuiScreenBook extends GuiScreen
{ {
private static final ResourceLocation bookGuiTextures = new ResourceLocation("textures/gui/book.png"); private static final TextureLocation bookGuiTextures = new TextureLocation("textures/gui/book.png");
/** The player editing the book */ /** The player editing the book */
private final EntityPlayer editingPlayer; private final EntityPlayer editingPlayer;
@ -374,7 +376,7 @@ public class GuiScreenBook extends GuiScreen
public void drawScreen(int par1, int par2, float par3) public void drawScreen(int par1, int par2, float par3)
{ {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(bookGuiTextures); bookGuiTextures.bindTexture();
int var4 = (this.width - this.bookImageWidth) / 2; int var4 = (this.width - this.bookImageWidth) / 2;
byte var5 = 2; byte var5 = 2;
this.drawTexturedModalRect(var4, var5, 0, 0, this.bookImageWidth, this.bookImageHeight); this.drawTexturedModalRect(var4, var5, 0, 0, this.bookImageWidth, this.bookImageHeight);
@ -444,7 +446,7 @@ public class GuiScreenBook extends GuiScreen
super.drawScreen(par1, par2, par3); super.drawScreen(par1, par2, par3);
} }
static ResourceLocation func_110404_g() static TextureLocation func_110404_g()
{ {
return bookGuiTextures; return bookGuiTextures;
} }

View File

@ -1,89 +0,0 @@
package net.minecraft.src;
import java.net.URI;
import org.lwjgl.opengl.GL11;
public class GuiScreenDemo extends GuiScreen
{
private static final ResourceLocation field_110407_a = new ResourceLocation("textures/gui/demo_background.png");
/**
* Adds the buttons (and other controls) to the screen in question.
*/
public void initGui()
{
this.buttonList.clear();
byte var1 = -16;
this.buttonList.add(new GuiButton(1, this.width / 2 - 116, this.height / 2 + 62 + var1, 114, 20, I18n.getString("demo.help.buy")));
this.buttonList.add(new GuiButton(2, this.width / 2 + 2, this.height / 2 + 62 + var1, 114, 20, I18n.getString("demo.help.later")));
}
/**
* Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e).
*/
protected void actionPerformed(GuiButton par1GuiButton)
{
switch (par1GuiButton.id)
{
case 1:
par1GuiButton.enabled = false;
try
{
Class var2 = Class.forName("java.awt.Desktop");
Object var3 = var2.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]);
var2.getMethod("browse", new Class[] {URI.class}).invoke(var3, new Object[] {new URI("http://www.minecraft.net/store?source=demo")});
}
catch (Throwable var4)
{
var4.printStackTrace();
}
break;
case 2:
this.mc.displayGuiScreen((GuiScreen)null);
this.mc.setIngameFocus();
}
}
/**
* Called from the main game loop to update the screen.
*/
public void updateScreen()
{
super.updateScreen();
}
/**
* Draws either a gradient over the background screen (when it exists) or a flat gradient over background.png
*/
public void drawDefaultBackground()
{
super.drawDefaultBackground();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(field_110407_a);
int var1 = (this.width - 248) / 2;
int var2 = (this.height - 166) / 2;
this.drawTexturedModalRect(var1, var2, 0, 0, 248, 166);
}
/**
* Draws the screen and all the components in it.
*/
public void drawScreen(int par1, int par2, float par3)
{
this.drawDefaultBackground();
int var4 = (this.width - 248) / 2 + 10;
int var5 = (this.height - 166) / 2 + 8;
this.fontRenderer.drawString(I18n.getString("demo.help.title"), var4, var5, 2039583);
var5 += 12;
GameSettings var6 = this.mc.gameSettings;
this.fontRenderer.drawString(I18n.getStringParams("demo.help.movementShort", new Object[] {GameSettings.getKeyDisplayString(var6.keyBindForward.keyCode), GameSettings.getKeyDisplayString(var6.keyBindLeft.keyCode), GameSettings.getKeyDisplayString(var6.keyBindBack.keyCode), GameSettings.getKeyDisplayString(var6.keyBindRight.keyCode)}), var4, var5, 5197647);
this.fontRenderer.drawString(I18n.getString("demo.help.movementMouse"), var4, var5 + 12, 5197647);
this.fontRenderer.drawString(I18n.getStringParams("demo.help.jump", new Object[] {GameSettings.getKeyDisplayString(var6.keyBindJump.keyCode)}), var4, var5 + 24, 5197647);
this.fontRenderer.drawString(I18n.getStringParams("demo.help.inventory", new Object[] {GameSettings.getKeyDisplayString(var6.keyBindInventory.keyCode)}), var4, var5 + 36, 5197647);
this.fontRenderer.drawSplitString(I18n.getString("demo.help.fullWrapped"), var4, var5 + 68, 218, 2039583);
super.drawScreen(par1, par2, par3);
}
}

View File

@ -1,10 +1,11 @@
package net.minecraft.src; package net.minecraft.src;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
public class GuiScreenHorseInventory extends GuiContainer public class GuiScreenHorseInventory extends GuiContainer
{ {
private static final ResourceLocation horseGuiTextures = new ResourceLocation("textures/gui/container/horse.png"); private static final TextureLocation horseGuiTextures = new TextureLocation("textures/gui/container/horse.png");
private IInventory field_110413_u; private IInventory field_110413_u;
private IInventory field_110412_v; private IInventory field_110412_v;
private EntityHorse field_110411_w; private EntityHorse field_110411_w;
@ -35,7 +36,7 @@ public class GuiScreenHorseInventory extends GuiContainer
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{ {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(horseGuiTextures); horseGuiTextures.bindTexture();
int var4 = (this.width - this.xSize) / 2; int var4 = (this.width - this.xSize) / 2;
int var5 = (this.height - this.ySize) / 2; int var5 = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize);

View File

@ -8,12 +8,14 @@ import java.net.InetSocketAddress;
import java.net.Socket; import java.net.Socket;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
public class GuiScreenOnlineServers extends GuiScreen public class GuiScreenOnlineServers extends GuiScreen
{ {
private static final ResourceLocation field_130039_a = new ResourceLocation("textures/gui/widgets.png"); private static final TextureLocation field_130039_a = new TextureLocation("textures/gui/widgets.png");
private GuiScreen field_96188_a; private GuiScreen field_96188_a;
private GuiSlotOnlineServerList field_96186_b; private GuiSlotOnlineServerList field_96186_b;
private static int field_96187_c; private static int field_96187_c;
@ -337,7 +339,7 @@ public class GuiScreenOnlineServers extends GuiScreen
{ {
int var3 = field_96194_t.func_130124_d(); int var3 = field_96194_t.func_130124_d();
boolean var4 = this.func_130037_c(par1, par2); boolean var4 = this.func_130037_c(par1, par2);
this.mc.getTextureManager().bindTexture(field_130039_a); field_130039_a.bindTexture();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glPushMatrix(); GL11.glPushMatrix();
this.drawTexturedModalRect(this.width / 2 + 58, 15, var4 ? 166 : 182, 22, 16, 16); this.drawTexturedModalRect(this.width / 2 + 58, 15, var4 ? 166 : 182, 22, 16, 16);
@ -349,7 +351,7 @@ public class GuiScreenOnlineServers extends GuiScreen
{ {
var5 = 198 + (Math.min(var3, 6) - 1) * 8; var5 = 198 + (Math.min(var3, 6) - 1) * 8;
var6 = (int)(Math.max(0.0F, Math.max(MathHelper.sin((float)(10 + this.field_104044_y) * 0.57F), MathHelper.cos((float)this.field_104044_y * 0.35F))) * -6.0F); var6 = (int)(Math.max(0.0F, Math.max(MathHelper.sin((float)(10 + this.field_104044_y) * 0.57F), MathHelper.cos((float)this.field_104044_y * 0.35F))) * -6.0F);
this.mc.getTextureManager().bindTexture(field_130039_a); field_130039_a.bindTexture();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glPushMatrix(); GL11.glPushMatrix();
this.drawTexturedModalRect(this.width / 2 + 58 + 4, 19 + var6, var5, 22, 8, 8); this.drawTexturedModalRect(this.width / 2 + 58 + 4, 19 + var6, var5, 22, 8, 8);
@ -391,7 +393,7 @@ public class GuiScreenOnlineServers extends GuiScreen
private void func_101008_c(int par1, int par2, int par3, int par4) private void func_101008_c(int par1, int par2, int par3, int par4)
{ {
this.mc.getTextureManager().bindTexture(field_130039_a); field_130039_a.bindTexture();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glScalef(0.5F, 0.5F, 0.5F); GL11.glScalef(0.5F, 0.5F, 0.5F);
@ -408,7 +410,7 @@ public class GuiScreenOnlineServers extends GuiScreen
{ {
if (this.field_104044_y % 20 < 10) if (this.field_104044_y % 20 < 10)
{ {
this.mc.getTextureManager().bindTexture(field_130039_a); field_130039_a.bindTexture();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glScalef(0.5F, 0.5F, 0.5F); GL11.glScalef(0.5F, 0.5F, 0.5F);
@ -435,7 +437,7 @@ public class GuiScreenOnlineServers extends GuiScreen
private void func_101006_d(int par1, int par2, int par3, int par4) private void func_101006_d(int par1, int par2, int par3, int par4)
{ {
this.mc.getTextureManager().bindTexture(field_130039_a); field_130039_a.bindTexture();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glScalef(0.5F, 0.5F, 0.5F); GL11.glScalef(0.5F, 0.5F, 0.5F);
@ -450,7 +452,7 @@ public class GuiScreenOnlineServers extends GuiScreen
private void func_101001_e(int par1, int par2, int par3, int par4) private void func_101001_e(int par1, int par2, int par3, int par4)
{ {
this.mc.getTextureManager().bindTexture(field_130039_a); field_130039_a.bindTexture();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glScalef(0.5F, 0.5F, 0.5F); GL11.glScalef(0.5F, 0.5F, 0.5F);

View File

@ -247,7 +247,7 @@ public abstract class GuiScreenSelectLocation
GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_FOG); GL11.glDisable(GL11.GL_FOG);
Tessellator var18 = Tessellator.instance; Tessellator var18 = Tessellator.instance;
this.field_104092_f.getTextureManager().bindTexture(Gui.optionsBackground); Gui.optionsBackground.bindTexture();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
float var17 = 32.0F; float var17 = 32.0F;
var18.startDrawingQuads(); var18.startDrawingQuads();
@ -403,7 +403,7 @@ public abstract class GuiScreenSelectLocation
private void func_104083_b(int par1, int par2, int par3, int par4) private void func_104083_b(int par1, int par2, int par3, int par4)
{ {
Tessellator var5 = Tessellator.instance; Tessellator var5 = Tessellator.instance;
this.field_104092_f.getTextureManager().bindTexture(Gui.optionsBackground); Gui.optionsBackground.bindTexture();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
float var6 = 32.0F; float var6 = 32.0F;
var5.startDrawingQuads(); var5.startDrawingQuads();

View File

@ -2,13 +2,15 @@ package net.minecraft.src;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import net.lax1dude.eaglercraft.adapter.Tessellator; import net.lax1dude.eaglercraft.adapter.Tessellator;
class GuiScreenTemporaryResourcePackSelectSelectionList extends GuiSlot class GuiScreenTemporaryResourcePackSelectSelectionList extends GuiSlot
{ {
private final ResourcePackRepository field_110511_b; private final ResourcePackRepository field_110511_b;
private ResourceLocation field_110513_h; private TextureLocation field_110513_h;
final GuiScreenTemporaryResourcePackSelect field_110512_a; final GuiScreenTemporaryResourcePackSelect field_110512_a;
@ -93,7 +95,7 @@ class GuiScreenTemporaryResourcePackSelectSelectionList extends GuiSlot
this.field_110513_h = var6.getDynamicTextureLocation("texturepackicon", new DynamicTexture(var12.getPackImage())); this.field_110513_h = var6.getDynamicTextureLocation("texturepackicon", new DynamicTexture(var12.getPackImage()));
} }
var6.bindTexture(this.field_110513_h); this.field_110513_h.bindTexture();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
par5Tessellator.startDrawingQuads(); par5Tessellator.startDrawingQuads();
par5Tessellator.setColorOpaque_I(16777215); par5Tessellator.setColorOpaque_I(16777215);

View File

@ -134,7 +134,7 @@ class GuiSlotOnlineServerList extends GuiScreenSelectLocation
} }
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GuiScreenOnlineServers.func_142023_q(this.field_96294_a).getTextureManager().bindTexture(Gui.icons); Gui.icons.bindTexture();
} }
} }
} }

View File

@ -166,7 +166,7 @@ class GuiSlotServer extends GuiSlot
} }
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.parentGui.mc.getTextureManager().bindTexture(Gui.icons); Gui.icons.bindTexture();
byte var15 = 0; byte var15 = 0;
boolean var11 = false; boolean var11 = false;
String var12 = ""; String var12 = "";

View File

@ -5,13 +5,15 @@ import java.io.InputStreamReader;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
import net.lax1dude.eaglercraft.TextureLocation;
import org.apache.commons.io.Charsets; import org.apache.commons.io.Charsets;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
public class GuiWinGame extends GuiScreen public class GuiWinGame extends GuiScreen
{ {
private static final ResourceLocation minecraftLogoTexture = new ResourceLocation("textures/gui/title/minecraft.png"); private static final TextureLocation minecraftLogoTexture = new TextureLocation("textures/gui/title/minecraft.png");
private static final ResourceLocation field_110361_b = new ResourceLocation("textures/misc/vignette.png"); private static final TextureLocation field_110361_b = new TextureLocation("textures/misc/vignette.png");
/** Counts the number of screen updates. */ /** Counts the number of screen updates. */
private int updateCounter; private int updateCounter;
@ -124,7 +126,7 @@ public class GuiWinGame extends GuiScreen
private void func_73986_b(int par1, int par2, float par3) private void func_73986_b(int par1, int par2, float par3)
{ {
Tessellator var4 = Tessellator.instance; Tessellator var4 = Tessellator.instance;
this.mc.getTextureManager().bindTexture(Gui.optionsBackground); Gui.optionsBackground.bindTexture();
var4.startDrawingQuads(); var4.startDrawingQuads();
var4.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F); var4.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F);
int var5 = this.width; int var5 = this.width;
@ -168,7 +170,7 @@ public class GuiWinGame extends GuiScreen
float var8 = -((float)this.updateCounter + par3) * this.field_73987_d; float var8 = -((float)this.updateCounter + par3) * this.field_73987_d;
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef(0.0F, var8, 0.0F); GL11.glTranslatef(0.0F, var8, 0.0F);
this.mc.getTextureManager().bindTexture(minecraftLogoTexture); minecraftLogoTexture.bindTexture();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.drawTexturedModalRect(var6, var7, 0, 0, 155, 44); this.drawTexturedModalRect(var6, var7, 0, 0, 155, 44);
this.drawTexturedModalRect(var6 + 155, var7, 0, 45, 155, 44); this.drawTexturedModalRect(var6 + 155, var7, 0, 45, 155, 44);
@ -207,7 +209,7 @@ public class GuiWinGame extends GuiScreen
} }
GL11.glPopMatrix(); GL11.glPopMatrix();
this.mc.getTextureManager().bindTexture(field_110361_b); field_110361_b.bindTexture();
GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_ZERO, GL11.GL_ONE_MINUS_SRC_COLOR); GL11.glBlendFunc(GL11.GL_ZERO, GL11.GL_ONE_MINUS_SRC_COLOR);
var4.startDrawingQuads(); var4.startDrawingQuads();

View File

@ -1,6 +1,11 @@
package net.minecraft.src; package net.minecraft.src;
public interface IconRegister public interface IconRegister {
{
Icon registerIcon(String var1); Icon registerIcon(String var1, int w);
default Icon registerIcon(String var1) {
return registerIcon(var1, 1);
}
} }

View File

@ -3,8 +3,7 @@ package net.minecraft.src;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
public class IntHashMap public class IntHashMap {
{
/** An array of HashEntries representing the heads of hash slot lists */ /** An array of HashEntries representing the heads of hash slot lists */
private transient IntHashMapEntry[] slots = new IntHashMapEntry[16]; private transient IntHashMapEntry[] slots = new IntHashMapEntry[16];
@ -26,8 +25,7 @@ public class IntHashMap
/** /**
* Makes the passed in integer suitable for hashing by a number of shifts * Makes the passed in integer suitable for hashing by a number of shifts
*/ */
private static int computeHash(int par0) private static int computeHash(int par0) {
{
par0 ^= par0 >>> 20 ^ par0 >>> 12; par0 ^= par0 >>> 20 ^ par0 >>> 12;
return par0 ^ par0 >>> 7 ^ par0 >>> 4; return par0 ^ par0 >>> 7 ^ par0 >>> 4;
} }
@ -35,22 +33,18 @@ public class IntHashMap
/** /**
* Computes the index of the slot for the hash and slot count passed in. * Computes the index of the slot for the hash and slot count passed in.
*/ */
private static int getSlotIndex(int par0, int par1) private static int getSlotIndex(int par0, int par1) {
{
return par0 & par1 - 1; return par0 & par1 - 1;
} }
/** /**
* Returns the object associated to a key * Returns the object associated to a key
*/ */
public Object lookup(int par1) public Object lookup(int par1) {
{
int var2 = computeHash(par1); int var2 = computeHash(par1);
for (IntHashMapEntry var3 = this.slots[getSlotIndex(var2, this.slots.length)]; var3 != null; var3 = var3.nextEntry) for (IntHashMapEntry var3 = this.slots[getSlotIndex(var2, this.slots.length)]; var3 != null; var3 = var3.nextEntry) {
{ if (var3.hashEntry == par1) {
if (var3.hashEntry == par1)
{
return var3.valueEntry; return var3.valueEntry;
} }
} }
@ -61,22 +55,18 @@ public class IntHashMap
/** /**
* Return true if an object is associated with the given key * Return true if an object is associated with the given key
*/ */
public boolean containsItem(int par1) public boolean containsItem(int par1) {
{
return this.lookupEntry(par1) != null; return this.lookupEntry(par1) != null;
} }
/** /**
* Returns the key/object mapping for a given key as a MCHashEntry * Returns the key/object mapping for a given key as a MCHashEntry
*/ */
final IntHashMapEntry lookupEntry(int par1) final IntHashMapEntry lookupEntry(int par1) {
{
int var2 = computeHash(par1); int var2 = computeHash(par1);
for (IntHashMapEntry var3 = this.slots[getSlotIndex(var2, this.slots.length)]; var3 != null; var3 = var3.nextEntry) for (IntHashMapEntry var3 = this.slots[getSlotIndex(var2, this.slots.length)]; var3 != null; var3 = var3.nextEntry) {
{ if (var3.hashEntry == par1) {
if (var3.hashEntry == par1)
{
return var3; return var3;
} }
} }
@ -87,16 +77,13 @@ public class IntHashMap
/** /**
* Adds a key and associated value to this map * Adds a key and associated value to this map
*/ */
public void addKey(int par1, Object par2Obj) public void addKey(int par1, Object par2Obj) {
{
this.keySet.add(Integer.valueOf(par1)); this.keySet.add(Integer.valueOf(par1));
int var3 = computeHash(par1); int var3 = computeHash(par1);
int var4 = getSlotIndex(var3, this.slots.length); int var4 = getSlotIndex(var3, this.slots.length);
for (IntHashMapEntry var5 = this.slots[var4]; var5 != null; var5 = var5.nextEntry) for (IntHashMapEntry var5 = this.slots[var4]; var5 != null; var5 = var5.nextEntry) {
{ if (var5.hashEntry == par1) {
if (var5.hashEntry == par1)
{
var5.valueEntry = par2Obj; var5.valueEntry = par2Obj;
return; return;
} }
@ -109,17 +96,13 @@ public class IntHashMap
/** /**
* Increases the number of hash slots * Increases the number of hash slots
*/ */
private void grow(int par1) private void grow(int par1) {
{
IntHashMapEntry[] var2 = this.slots; IntHashMapEntry[] var2 = this.slots;
int var3 = var2.length; int var3 = var2.length;
if (var3 == 1073741824) if (var3 == 1073741824) {
{
this.threshold = Integer.MAX_VALUE; this.threshold = Integer.MAX_VALUE;
} } else {
else
{
IntHashMapEntry[] var4 = new IntHashMapEntry[par1]; IntHashMapEntry[] var4 = new IntHashMapEntry[par1];
this.copyTo(var4); this.copyTo(var4);
this.slots = var4; this.slots = var4;
@ -130,29 +113,24 @@ public class IntHashMap
/** /**
* Copies the hash slots to a new array * Copies the hash slots to a new array
*/ */
private void copyTo(IntHashMapEntry[] par1ArrayOfIntHashMapEntry) private void copyTo(IntHashMapEntry[] par1ArrayOfIntHashMapEntry) {
{
IntHashMapEntry[] var2 = this.slots; IntHashMapEntry[] var2 = this.slots;
int var3 = par1ArrayOfIntHashMapEntry.length; int var3 = par1ArrayOfIntHashMapEntry.length;
for (int var4 = 0; var4 < var2.length; ++var4) for (int var4 = 0; var4 < var2.length; ++var4) {
{
IntHashMapEntry var5 = var2[var4]; IntHashMapEntry var5 = var2[var4];
if (var5 != null) if (var5 != null) {
{
var2[var4] = null; var2[var4] = null;
IntHashMapEntry var6; IntHashMapEntry var6;
do do {
{
var6 = var5.nextEntry; var6 = var5.nextEntry;
int var7 = getSlotIndex(var5.slotHash, var3); int var7 = getSlotIndex(var5.slotHash, var3);
var5.nextEntry = par1ArrayOfIntHashMapEntry[var7]; var5.nextEntry = par1ArrayOfIntHashMapEntry[var7];
par1ArrayOfIntHashMapEntry[var7] = var5; par1ArrayOfIntHashMapEntry[var7] = var5;
var5 = var6; var5 = var6;
} } while (var6 != null);
while (var6 != null);
} }
} }
} }
@ -160,8 +138,7 @@ public class IntHashMap
/** /**
* Removes the specified object from the map and returns it * Removes the specified object from the map and returns it
*/ */
public Object removeObject(int par1) public Object removeObject(int par1) {
{
this.keySet.remove(Integer.valueOf(par1)); this.keySet.remove(Integer.valueOf(par1));
IntHashMapEntry var2 = this.removeEntry(par1); IntHashMapEntry var2 = this.removeEntry(par1);
return var2 == null ? null : var2.valueEntry; return var2 == null ? null : var2.valueEntry;
@ -170,29 +147,23 @@ public class IntHashMap
/** /**
* Removes the specified entry from the map and returns it * Removes the specified entry from the map and returns it
*/ */
final IntHashMapEntry removeEntry(int par1) final IntHashMapEntry removeEntry(int par1) {
{
int var2 = computeHash(par1); int var2 = computeHash(par1);
int var3 = getSlotIndex(var2, this.slots.length); int var3 = getSlotIndex(var2, this.slots.length);
IntHashMapEntry var4 = this.slots[var3]; IntHashMapEntry var4 = this.slots[var3];
IntHashMapEntry var5; IntHashMapEntry var5;
IntHashMapEntry var6; IntHashMapEntry var6;
for (var5 = var4; var5 != null; var5 = var6) for (var5 = var4; var5 != null; var5 = var6) {
{
var6 = var5.nextEntry; var6 = var5.nextEntry;
if (var5.hashEntry == par1) if (var5.hashEntry == par1) {
{
++this.versionStamp; ++this.versionStamp;
--this.count; --this.count;
if (var4 == var5) if (var4 == var5) {
{
this.slots[var3] = var6; this.slots[var3] = var6;
} } else {
else
{
var4.nextEntry = var6; var4.nextEntry = var6;
} }
@ -208,13 +179,11 @@ public class IntHashMap
/** /**
* Removes all entries from the map * Removes all entries from the map
*/ */
public void clearMap() public void clearMap() {
{
++this.versionStamp; ++this.versionStamp;
IntHashMapEntry[] var1 = this.slots; IntHashMapEntry[] var1 = this.slots;
for (int var2 = 0; var2 < var1.length; ++var2) for (int var2 = 0; var2 < var1.length; ++var2) {
{
var1[var2] = null; var1[var2] = null;
} }
@ -224,22 +193,26 @@ public class IntHashMap
/** /**
* Adds an object to a slot * Adds an object to a slot
*/ */
private void insert(int par1, int par2, Object par3Obj, int par4) private void insert(int par1, int par2, Object par3Obj, int par4) {
{
IntHashMapEntry var5 = this.slots[par4]; IntHashMapEntry var5 = this.slots[par4];
this.slots[par4] = new IntHashMapEntry(par1, par2, par3Obj, var5); this.slots[par4] = new IntHashMapEntry(par1, par2, par3Obj, var5);
if (this.count++ >= this.threshold) if (this.count++ >= this.threshold) {
{
this.grow(2 * this.slots.length); this.grow(2 * this.slots.length);
} }
} }
/**
* Return the Set of all keys stored in this MCHash object
*/
public Set getKeySet() {
return this.keySet;
}
/** /**
* Returns the hash code for a key * Returns the hash code for a key
*/ */
static int getHash(int par0) static int getHash(int par0) {
{
return computeHash(par0); return computeHash(par0);
} }
} }

View File

@ -1,7 +1,6 @@
package net.minecraft.src; package net.minecraft.src;
class IntHashMapEntry class IntHashMapEntry {
{
/** The hash code of this entry */ /** The hash code of this entry */
final int hashEntry; final int hashEntry;
@ -14,8 +13,7 @@ class IntHashMapEntry
/** The id of the hash slot computed from the hash */ /** The id of the hash slot computed from the hash */
final int slotHash; final int slotHash;
IntHashMapEntry(int par1, int par2, Object par3Obj, IntHashMapEntry par4IntHashMapEntry) IntHashMapEntry(int par1, int par2, Object par3Obj, IntHashMapEntry par4IntHashMapEntry) {
{
this.valueEntry = par3Obj; this.valueEntry = par3Obj;
this.nextEntry = par4IntHashMapEntry; this.nextEntry = par4IntHashMapEntry;
this.hashEntry = par2; this.hashEntry = par2;
@ -25,38 +23,30 @@ class IntHashMapEntry
/** /**
* Returns the hash code for this entry * Returns the hash code for this entry
*/ */
public final int getHash() public final int getHash() {
{
return this.hashEntry; return this.hashEntry;
} }
/** /**
* Returns the object stored in this entry * Returns the object stored in this entry
*/ */
public final Object getValue() public final Object getValue() {
{
return this.valueEntry; return this.valueEntry;
} }
public final boolean equals(Object par1Obj) public final boolean equals(Object par1Obj) {
{ if (!(par1Obj instanceof IntHashMapEntry)) {
if (!(par1Obj instanceof IntHashMapEntry))
{
return false; return false;
} } else {
else
{
IntHashMapEntry var2 = (IntHashMapEntry) par1Obj; IntHashMapEntry var2 = (IntHashMapEntry) par1Obj;
Integer var3 = Integer.valueOf(this.getHash()); Integer var3 = Integer.valueOf(this.getHash());
Integer var4 = Integer.valueOf(var2.getHash()); Integer var4 = Integer.valueOf(var2.getHash());
if (var3 == var4 || var3 != null && var3.equals(var4)) if (var3 == var4 || var3 != null && var3.equals(var4)) {
{
Object var5 = this.getValue(); Object var5 = this.getValue();
Object var6 = var2.getValue(); Object var6 = var2.getValue();
if (var5 == var6 || var5 != null && var5.equals(var6)) if (var5 == var6 || var5 != null && var5.equals(var6)) {
{
return true; return true;
} }
} }
@ -65,13 +55,11 @@ class IntHashMapEntry
} }
} }
public final int hashCode() public final int hashCode() {
{
return IntHashMap.getHash(this.hashEntry); return IntHashMap.getHash(this.hashEntry);
} }
public final String toString() public final String toString() {
{
return this.getHash() + "=" + this.getValue(); return this.getHash() + "=" + this.getValue();
} }
} }

View File

@ -66,7 +66,7 @@ public abstract class InventoryEffectRenderer extends GuiContainer
PotionEffect var7 = (PotionEffect)var6.next(); PotionEffect var7 = (PotionEffect)var6.next();
Potion var8 = Potion.potionTypes[var7.getPotionID()]; Potion var8 = Potion.potionTypes[var7.getPotionID()];
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(field_110408_a); field_110408_a.bindTexture();
this.drawTexturedModalRect(var1, var2, 0, 166, 140, 32); this.drawTexturedModalRect(var1, var2, 0, 166, 140, 32);
if (var8.hasStatusIcon()) if (var8.hasStatusIcon())

View File

@ -1,13 +1,14 @@
package net.minecraft.src; package net.minecraft.src;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12; import org.lwjgl.opengl.GL12;
public class ItemRenderer public class ItemRenderer
{ {
private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); private static final TextureLocation RES_ITEM_GLINT = new TextureLocation("textures/misc/enchanted_item_glint.png");
private static final ResourceLocation RES_MAP_BACKGROUND = new ResourceLocation("textures/map/map_background.png"); private static final TextureLocation RES_MAP_BACKGROUND = new TextureLocation("textures/map/map_background.png");
private static final ResourceLocation RES_UNDERWATER_OVERLAY = new ResourceLocation("textures/misc/underwater.png"); private static final TextureLocation RES_UNDERWATER_OVERLAY = new TextureLocation("textures/misc/underwater.png");
/** A reference to the Minecraft object. */ /** A reference to the Minecraft object. */
private Minecraft mc; private Minecraft mc;
@ -42,7 +43,7 @@ public class ItemRenderer
if (par2ItemStack.getItemSpriteNumber() == 0 && par2ItemStack.itemID < Block.blocksList.length && Block.blocksList[par2ItemStack.itemID] != null && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType())) if (par2ItemStack.getItemSpriteNumber() == 0 && par2ItemStack.itemID < Block.blocksList.length && Block.blocksList[par2ItemStack.itemID] != null && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType()))
{ {
var4.bindTexture(var4.getResourceLocation(0)); var4.getResourceLocation(0).bindTexture();
this.renderBlocksInstance.renderBlockAsItem(Block.blocksList[par2ItemStack.itemID], par2ItemStack.getItemDamage(), 1.0F); this.renderBlocksInstance.renderBlockAsItem(Block.blocksList[par2ItemStack.itemID], par2ItemStack.getItemDamage(), 1.0F);
} }
else else
@ -55,7 +56,7 @@ public class ItemRenderer
return; return;
} }
var4.bindTexture(var4.getResourceLocation(par2ItemStack.getItemSpriteNumber())); var4.getResourceLocation(par2ItemStack.getItemSpriteNumber()).bindTexture();
Tessellator var6 = Tessellator.instance; Tessellator var6 = Tessellator.instance;
float var7 = var5.getMinU(); float var7 = var5.getMinU();
float var8 = var5.getMaxU(); float var8 = var5.getMaxU();
@ -76,7 +77,7 @@ public class ItemRenderer
{ {
GL11.glDepthFunc(GL11.GL_EQUAL); GL11.glDepthFunc(GL11.GL_EQUAL);
GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_LIGHTING);
var4.bindTexture(RES_ITEM_GLINT); RES_ITEM_GLINT.bindTexture();
GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
float var14 = 0.76F; float var14 = 0.76F;
@ -269,7 +270,7 @@ public class ItemRenderer
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(var21 * -85.0F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(var21 * -85.0F, 0.0F, 0.0F, 1.0F);
GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glEnable(GL12.GL_RESCALE_NORMAL);
this.mc.getTextureManager().bindTexture(var3.getLocationSkin()); this.mc.getTextureManager().bindTexture();
for (var12 = 0; var12 < 2; ++var12) for (var12 = 0; var12 < 2; ++var12)
{ {
@ -527,7 +528,7 @@ public class ItemRenderer
*/ */
private void renderInsideOfBlock(float par1, Icon par2Icon) private void renderInsideOfBlock(float par1, Icon par2Icon)
{ {
this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); TextureMap.locationBlocksTexture.bindTexture();
Tessellator var3 = Tessellator.instance; Tessellator var3 = Tessellator.instance;
float var4 = 0.1F; float var4 = 0.1F;
GL11.glColor4f(var4, var4, var4, 0.5F); GL11.glColor4f(var4, var4, var4, 0.5F);

View File

@ -1,15 +1,17 @@
package net.minecraft.src; package net.minecraft.src;
import java.util.Iterator; import java.util.Iterator;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
public class MapItemRenderer public class MapItemRenderer
{ {
private static final ResourceLocation field_111277_a = new ResourceLocation("textures/map/map_icons.png"); private static final TextureLocation field_111277_a = new TextureLocation("textures/map/map_icons.png");
private final DynamicTexture bufferedImage; private final DynamicTexture bufferedImage;
private int[] intArray = new int[16384]; private int[] intArray = new int[16384];
private GameSettings gameSettings; private GameSettings gameSettings;
private final ResourceLocation field_111276_e; private final TextureLocation field_111276_e;
public MapItemRenderer(GameSettings par1GameSettings, TextureManager par2TextureManager) public MapItemRenderer(GameSettings par1GameSettings, TextureManager par2TextureManager)
{ {
@ -62,7 +64,7 @@ public class MapItemRenderer
byte var16 = 0; byte var16 = 0;
Tessellator var17 = Tessellator.instance; Tessellator var17 = Tessellator.instance;
float var18 = 0.0F; float var18 = 0.0F;
par2TextureManager.bindTexture(this.field_111276_e); this.field_111276_e.bindTexture();
GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glDisable(GL11.GL_ALPHA_TEST);
@ -74,7 +76,7 @@ public class MapItemRenderer
var17.draw(); var17.draw();
GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glDisable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_BLEND);
par2TextureManager.bindTexture(field_111277_a); field_111277_a.bindTexture();
int var19 = 0; int var19 = 0;
for (Iterator var20 = par3MapData.playersVisibleOnMap.values().iterator(); var20.hasNext(); ++var19) for (Iterator var20 = par3MapData.playersVisibleOnMap.values().iterator(); var20.hasNext(); ++var19)

View File

@ -9,15 +9,17 @@ import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Random; import java.util.Random;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.opengl.ARBOcclusionQuery; import org.lwjgl.opengl.ARBOcclusionQuery;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
public class RenderGlobal implements IWorldAccess public class RenderGlobal implements IWorldAccess
{ {
private static final ResourceLocation locationMoonPhasesPng = new ResourceLocation("textures/environment/moon_phases.png"); private static final TextureLocation locationMoonPhasesPng = new TextureLocation("textures/environment/moon_phases.png");
private static final ResourceLocation locationSunPng = new ResourceLocation("textures/environment/sun.png"); private static final TextureLocation locationSunPng = new TextureLocation("textures/environment/sun.png");
private static final ResourceLocation locationCloudsPng = new ResourceLocation("textures/environment/clouds.png"); private static final TextureLocation locationCloudsPng = new TextureLocation("textures/environment/clouds.png");
private static final ResourceLocation locationEndSkyPng = new ResourceLocation("textures/environment/end_sky.png"); private static final TextureLocation locationEndSkyPng = new TextureLocation("textures/environment/end_sky.png");
public List tileEntities = new ArrayList(); public List tileEntities = new ArrayList();
private WorldClient theWorld; private WorldClient theWorld;
@ -900,7 +902,7 @@ public class RenderGlobal implements IWorldAccess
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
RenderHelper.disableStandardItemLighting(); RenderHelper.disableStandardItemLighting();
GL11.glDepthMask(false); GL11.glDepthMask(false);
this.renderEngine.bindTexture(locationEndSkyPng); locationEndSkyPng.bindTexture();
Tessellator var21 = Tessellator.instance; Tessellator var21 = Tessellator.instance;
for (int var22 = 0; var22 < 6; ++var22) for (int var22 = 0; var22 < 6; ++var22)
@ -1036,7 +1038,7 @@ public class RenderGlobal implements IWorldAccess
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(this.theWorld.getCelestialAngle(par1) * 360.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(this.theWorld.getCelestialAngle(par1) * 360.0F, 1.0F, 0.0F, 0.0F);
var12 = 30.0F; var12 = 30.0F;
this.renderEngine.bindTexture(locationSunPng); locationSunPng.bindTexture();
var23.startDrawingQuads(); var23.startDrawingQuads();
var23.addVertexWithUV((double)(-var12), 100.0D, (double)(-var12), 0.0D, 0.0D); var23.addVertexWithUV((double)(-var12), 100.0D, (double)(-var12), 0.0D, 0.0D);
var23.addVertexWithUV((double)var12, 100.0D, (double)(-var12), 1.0D, 0.0D); var23.addVertexWithUV((double)var12, 100.0D, (double)(-var12), 1.0D, 0.0D);
@ -1044,7 +1046,7 @@ public class RenderGlobal implements IWorldAccess
var23.addVertexWithUV((double)(-var12), 100.0D, (double)var12, 0.0D, 1.0D); var23.addVertexWithUV((double)(-var12), 100.0D, (double)var12, 0.0D, 1.0D);
var23.draw(); var23.draw();
var12 = 20.0F; var12 = 20.0F;
this.renderEngine.bindTexture(locationMoonPhasesPng); locationMoonPhasesPng.bindTexture();
int var28 = this.theWorld.getMoonPhase(); int var28 = this.theWorld.getMoonPhase();
int var29 = var28 % 4; int var29 = var28 % 4;
int var30 = var28 / 4 % 2; int var30 = var28 / 4 % 2;
@ -1143,7 +1145,7 @@ public class RenderGlobal implements IWorldAccess
byte var3 = 32; byte var3 = 32;
int var4 = 256 / var3; int var4 = 256 / var3;
Tessellator var5 = Tessellator.instance; Tessellator var5 = Tessellator.instance;
this.renderEngine.bindTexture(locationCloudsPng); locationCloudsPng.bindTexture();
GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
Vec3 var6 = this.theWorld.getCloudColour(par1); Vec3 var6 = this.theWorld.getCloudColour(par1);
@ -1221,7 +1223,7 @@ public class RenderGlobal implements IWorldAccess
int var14 = MathHelper.floor_double(var10 / 2048.0D); int var14 = MathHelper.floor_double(var10 / 2048.0D);
var8 -= (double)(var13 * 2048); var8 -= (double)(var13 * 2048);
var10 -= (double)(var14 * 2048); var10 -= (double)(var14 * 2048);
this.renderEngine.bindTexture(locationCloudsPng); locationCloudsPng.bindTexture();
GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
Vec3 var15 = this.theWorld.getCloudColour(par1); Vec3 var15 = this.theWorld.getCloudColour(par1);
@ -1546,7 +1548,7 @@ public class RenderGlobal implements IWorldAccess
if (!this.damagedBlocks.isEmpty()) if (!this.damagedBlocks.isEmpty())
{ {
GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_SRC_COLOR); GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_SRC_COLOR);
this.renderEngine.bindTexture(TextureMap.locationBlocksTexture); TextureMap.locationBlocksTexture.bindTexture();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.5F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.5F);
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glDisable(GL11.GL_ALPHA_TEST);

View File

@ -1,12 +1,14 @@
package net.minecraft.src; package net.minecraft.src;
import java.util.Random; import java.util.Random;
import net.lax1dude.eaglercraft.TextureLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12; import org.lwjgl.opengl.GL12;
public class RenderItem extends Render public class RenderItem extends Render
{ {
private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); private static final TextureLocation RES_ITEM_GLINT = new TextureLocation("textures/misc/enchanted_item_glint.png");
private RenderBlocks itemRenderBlocks = new RenderBlocks(); private RenderBlocks itemRenderBlocks = new RenderBlocks();
/** The RNG used in RenderItem (for bobbing itemstacks on the ground) */ /** The RNG used in RenderItem (for bobbing itemstacks on the ground) */
@ -249,11 +251,11 @@ public class RenderItem extends Render
if (var18.getItemSpriteNumber() == 0 && Block.blocksList[var18.itemID] != null) if (var18.getItemSpriteNumber() == 0 && Block.blocksList[var18.itemID] != null)
{ {
this.bindTexture(TextureMap.locationBlocksTexture); TextureMap.locationBlocksTexture.bindTexture();
} }
else else
{ {
this.bindTexture(TextureMap.locationItemsTexture); TextureMap.locationItemsTexture.bindTexture();
} }
GL11.glColor4f(par5, par6, par7, 1.0F); GL11.glColor4f(par5, par6, par7, 1.0F);
@ -263,7 +265,7 @@ public class RenderItem extends Render
{ {
GL11.glDepthFunc(GL11.GL_EQUAL); GL11.glDepthFunc(GL11.GL_EQUAL);
GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_LIGHTING);
this.renderManager.renderEngine.bindTexture(RES_ITEM_GLINT); RES_ITEM_GLINT.bindTexture();
GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
float var21 = 0.76F; float var21 = 0.76F;
@ -340,7 +342,7 @@ public class RenderItem extends Render
if (par3ItemStack.getItemSpriteNumber() == 0 && RenderBlocks.renderItemIn3d(Block.blocksList[var6].getRenderType())) if (par3ItemStack.getItemSpriteNumber() == 0 && RenderBlocks.renderItemIn3d(Block.blocksList[var6].getRenderType()))
{ {
par2TextureManager.bindTexture(TextureMap.locationBlocksTexture); TextureMap.locationBlocksTexture.bindTexture();
Block var16 = Block.blocksList[var6]; Block var16 = Block.blocksList[var6];
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float)(par4 - 2), (float)(par5 + 3), -3.0F + this.zLevel); GL11.glTranslatef((float)(par4 - 2), (float)(par5 + 3), -3.0F + this.zLevel);
@ -368,7 +370,7 @@ public class RenderItem extends Render
else if (Item.itemsList[var6].requiresMultipleRenderPasses()) else if (Item.itemsList[var6].requiresMultipleRenderPasses())
{ {
GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_LIGHTING);
par2TextureManager.bindTexture(TextureMap.locationItemsTexture); TextureMap.locationItemsTexture.bindTexture();
for (int var9 = 0; var9 <= 1; ++var9) for (int var9 = 0; var9 <= 1; ++var9)
{ {
@ -391,8 +393,8 @@ public class RenderItem extends Render
else else
{ {
GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_LIGHTING);
ResourceLocation var15 = par2TextureManager.getResourceLocation(par3ItemStack.getItemSpriteNumber()); TextureLocation var15 = par2TextureManager.getResourceLocation(par3ItemStack.getItemSpriteNumber());
par2TextureManager.bindTexture(var15); var15.bindTexture();
if (var8 == null) if (var8 == null)
{ {

View File

@ -1,82 +0,0 @@
package net.minecraft.src;
import org.apache.commons.lang3.Validate;
public class ResourceLocation
{
private final String resourceDomain;
private final String resourcePath;
public ResourceLocation(String par1Str, String par2Str)
{
Validate.notNull(par2Str);
if (par1Str != null && par1Str.length() != 0)
{
this.resourceDomain = par1Str;
}
else
{
this.resourceDomain = "minecraft";
}
this.resourcePath = par2Str;
}
public ResourceLocation(String par1Str)
{
String var2 = "minecraft";
String var3 = par1Str;
int var4 = par1Str.indexOf(58);
if (var4 >= 0)
{
var3 = par1Str.substring(var4 + 1, par1Str.length());
if (var4 > 1)
{
var2 = par1Str.substring(0, var4);
}
}
this.resourceDomain = var2.toLowerCase();
this.resourcePath = var3;
}
public String getResourcePath()
{
return this.resourcePath;
}
public String getResourceDomain()
{
return this.resourceDomain;
}
public String toString()
{
return this.resourceDomain + ":" + this.resourcePath;
}
public boolean equals(Object par1Obj)
{
if (this == par1Obj)
{
return true;
}
else if (!(par1Obj instanceof ResourceLocation))
{
return false;
}
else
{
ResourceLocation var2 = (ResourceLocation)par1Obj;
return this.resourceDomain.equals(var2.resourceDomain) && this.resourcePath.equals(var2.resourcePath);
}
}
public int hashCode()
{
return 31 * this.resourceDomain.hashCode() + this.resourcePath.hashCode();
}
}

View File

@ -1,60 +0,0 @@
package net.minecraft.src;
import java.io.IOException;
class RunnableTitleScreen extends Thread
{
final GuiMainMenu theMainMenu;
RunnableTitleScreen(GuiMainMenu par1GuiMainMenu)
{
this.theMainMenu = par1GuiMainMenu;
}
public void run()
{
McoClient var1 = new McoClient(GuiMainMenu.func_110348_a(this.theMainMenu).getSession());
boolean var2 = false;
for (int var3 = 0; var3 < 3; ++var3)
{
try
{
Boolean var4 = var1.func_96375_b();
if (var4.booleanValue())
{
GuiMainMenu.func_130021_b(this.theMainMenu);
}
GuiMainMenu.func_110349_a(var4.booleanValue());
}
catch (ExceptionRetryCall var6)
{
var2 = true;
}
catch (ExceptionMcoService var7)
{
GuiMainMenu.func_130018_c(this.theMainMenu).getLogAgent().logSevere(var7.toString());
}
catch (IOException var8)
{
GuiMainMenu.func_130019_d(this.theMainMenu).getLogAgent().logWarning("Realms: could not parse response");
}
if (!var2)
{
break;
}
try
{
Thread.sleep(10000L);
}
catch (InterruptedException var5)
{
Thread.currentThread().interrupt();
}
}
}
}

View File

@ -185,7 +185,7 @@ public abstract class SelectionListBase
GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_FOG); GL11.glDisable(GL11.GL_FOG);
Tessellator var18 = Tessellator.instance; Tessellator var18 = Tessellator.instance;
this.mc.getTextureManager().bindTexture(Gui.optionsBackground); Gui.optionsBackground.bindTexture();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
float var17 = 32.0F; float var17 = 32.0F;
var18.startDrawingQuads(); var18.startDrawingQuads();

View File

@ -1,95 +1,79 @@
package net.minecraft.src; package net.minecraft.src;
public class StitchHolder implements Comparable
{
private final TextureAtlasSprite theTexture; public class StitchHolder implements Comparable {
private final Texture theTexture;
private final int width; private final int width;
private final int height; private final int height;
private boolean rotated; private boolean rotated;
private float scaleFactor = 1.0F; private float scaleFactor = 1.0F;
public StitchHolder(TextureAtlasSprite par1TextureAtlasSprite) public StitchHolder(Texture par1Texture) {
{ this.theTexture = par1Texture;
this.theTexture = par1TextureAtlasSprite; this.width = par1Texture.getWidth();
this.width = par1TextureAtlasSprite.getIconWidth(); this.height = par1Texture.getHeight();
this.height = par1TextureAtlasSprite.getIconHeight();
this.rotated = this.ceil16(this.height) > this.ceil16(this.width); this.rotated = this.ceil16(this.height) > this.ceil16(this.width);
} }
public TextureAtlasSprite getAtlasSprite() public Texture func_98150_a() {
{
return this.theTexture; return this.theTexture;
} }
public int getWidth() public int getWidth() {
{
return this.rotated ? this.ceil16((int) ((float) this.height * this.scaleFactor)) : this.ceil16((int) ((float) this.width * this.scaleFactor)); return this.rotated ? this.ceil16((int) ((float) this.height * this.scaleFactor)) : this.ceil16((int) ((float) this.width * this.scaleFactor));
} }
public int getHeight() public int getHeight() {
{
return this.rotated ? this.ceil16((int) ((float) this.width * this.scaleFactor)) : this.ceil16((int) ((float) this.height * this.scaleFactor)); return this.rotated ? this.ceil16((int) ((float) this.width * this.scaleFactor)) : this.ceil16((int) ((float) this.height * this.scaleFactor));
} }
public void rotate() public void rotate() {
{
this.rotated = !this.rotated; this.rotated = !this.rotated;
} }
public boolean isRotated() public boolean isRotated() {
{
return this.rotated; return this.rotated;
} }
private int ceil16(int par1) private int ceil16(int par1) {
{
return (par1 >> 0) + ((par1 & 0) == 0 ? 0 : 1) << 0; return (par1 >> 0) + ((par1 & 0) == 0 ? 0 : 1) << 0;
} }
public void setNewDimension(int par1) public void setNewDimension(int par1) {
{ if (this.width > par1 && this.height > par1) {
if (this.width > par1 && this.height > par1)
{
this.scaleFactor = (float) par1 / (float) Math.min(this.width, this.height); this.scaleFactor = (float) par1 / (float) Math.min(this.width, this.height);
} }
} }
public String toString() public String toString() {
{ return "TextureHolder{width=" + this.width + ", height=" + this.height + '}';
return "Holder{width=" + this.width + ", height=" + this.height + '}';
} }
/** /**
* See Comparable.compareTo. * See Comparable.compareTo.
*/ */
public int compareToStitchHolder(StitchHolder par1StitchHolder) public int compareToStitchHolder(StitchHolder par1StitchHolder) {
{
int var2; int var2;
if (this.getHeight() == par1StitchHolder.getHeight()) if (this.getHeight() == par1StitchHolder.getHeight()) {
{ if (this.getWidth() == par1StitchHolder.getWidth()) {
if (this.getWidth() == par1StitchHolder.getWidth()) if (this.theTexture.getTextureName() == null) {
{ return par1StitchHolder.theTexture.getTextureName() == null ? 0 : -1;
if (this.theTexture.getIconName() == null)
{
return par1StitchHolder.theTexture.getIconName() == null ? 0 : -1;
} }
return this.theTexture.getIconName().compareTo(par1StitchHolder.theTexture.getIconName()); return this.theTexture.getTextureName().compareTo(par1StitchHolder.theTexture.getTextureName());
} }
var2 = this.getWidth() < par1StitchHolder.getWidth() ? 1 : -1; var2 = this.getWidth() < par1StitchHolder.getWidth() ? 1 : -1;
} } else {
else
{
var2 = this.getHeight() < par1StitchHolder.getHeight() ? 1 : -1; var2 = this.getHeight() < par1StitchHolder.getHeight() ? 1 : -1;
} }
return var2; return var2;
} }
public int compareTo(Object par1Obj) public int compareTo(Object par1Obj) {
{
return this.compareToStitchHolder((StitchHolder) par1Obj); return this.compareToStitchHolder((StitchHolder) par1Obj);
} }
} }

View File

@ -4,8 +4,9 @@ import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
public class StitchSlot
{
public class StitchSlot {
private final int originX; private final int originX;
private final int originY; private final int originY;
private final int width; private final int width;
@ -13,78 +14,57 @@ public class StitchSlot
private List subSlots; private List subSlots;
private StitchHolder holder; private StitchHolder holder;
public StitchSlot(int par1, int par2, int par3, int par4) public StitchSlot(int par1, int par2, int par3, int par4) {
{
this.originX = par1; this.originX = par1;
this.originY = par2; this.originY = par2;
this.width = par3; this.width = par3;
this.height = par4; this.height = par4;
} }
public StitchHolder getStitchHolder() public StitchHolder getStitchHolder() {
{
return this.holder; return this.holder;
} }
public int getOriginX() public int getOriginX() {
{
return this.originX; return this.originX;
} }
public int getOriginY() public int getOriginY() {
{
return this.originY; return this.originY;
} }
public boolean addSlot(StitchHolder par1StitchHolder) public boolean func_94182_a(StitchHolder par1StitchHolder) {
{ if (this.holder != null) {
if (this.holder != null)
{
return false; return false;
} } else {
else
{
int var2 = par1StitchHolder.getWidth(); int var2 = par1StitchHolder.getWidth();
int var3 = par1StitchHolder.getHeight(); int var3 = par1StitchHolder.getHeight();
if (var2 <= this.width && var3 <= this.height) if (var2 <= this.width && var3 <= this.height) {
{ if (var2 == this.width && var3 == this.height) {
if (var2 == this.width && var3 == this.height)
{
this.holder = par1StitchHolder; this.holder = par1StitchHolder;
return true; return true;
} } else {
else if (this.subSlots == null) {
{
if (this.subSlots == null)
{
this.subSlots = new ArrayList(1); this.subSlots = new ArrayList(1);
this.subSlots.add(new StitchSlot(this.originX, this.originY, var2, var3)); this.subSlots.add(new StitchSlot(this.originX, this.originY, var2, var3));
int var4 = this.width - var2; int var4 = this.width - var2;
int var5 = this.height - var3; int var5 = this.height - var3;
if (var5 > 0 && var4 > 0) if (var5 > 0 && var4 > 0) {
{
int var6 = Math.max(this.height, var4); int var6 = Math.max(this.height, var4);
int var7 = Math.max(this.width, var5); int var7 = Math.max(this.width, var5);
if (var6 >= var7) if (var6 >= var7) {
{
this.subSlots.add(new StitchSlot(this.originX, this.originY + var3, var2, var5)); this.subSlots.add(new StitchSlot(this.originX, this.originY + var3, var2, var5));
this.subSlots.add(new StitchSlot(this.originX + var2, this.originY, var4, this.height)); this.subSlots.add(new StitchSlot(this.originX + var2, this.originY, var4, this.height));
} } else {
else
{
this.subSlots.add(new StitchSlot(this.originX + var2, this.originY, var4, var3)); this.subSlots.add(new StitchSlot(this.originX + var2, this.originY, var4, var3));
this.subSlots.add(new StitchSlot(this.originX, this.originY + var3, this.width, var5)); this.subSlots.add(new StitchSlot(this.originX, this.originY + var3, this.width, var5));
} }
} } else if (var4 == 0) {
else if (var4 == 0)
{
this.subSlots.add(new StitchSlot(this.originX, this.originY + var3, var2, var5)); this.subSlots.add(new StitchSlot(this.originX, this.originY + var3, var2, var5));
} } else if (var5 == 0) {
else if (var5 == 0)
{
this.subSlots.add(new StitchSlot(this.originX + var2, this.originY, var4, var3)); this.subSlots.add(new StitchSlot(this.originX + var2, this.originY, var4, var3));
} }
} }
@ -92,22 +72,17 @@ public class StitchSlot
Iterator var8 = this.subSlots.iterator(); Iterator var8 = this.subSlots.iterator();
StitchSlot var9; StitchSlot var9;
do do {
{ if (!var8.hasNext()) {
if (!var8.hasNext())
{
return false; return false;
} }
var9 = (StitchSlot) var8.next(); var9 = (StitchSlot) var8.next();
} } while (!var9.func_94182_a(par1StitchHolder));
while (!var9.addSlot(par1StitchHolder));
return true; return true;
} }
} } else {
else
{
return false; return false;
} }
} }
@ -116,26 +91,20 @@ public class StitchSlot
/** /**
* Gets the slot and all its subslots * Gets the slot and all its subslots
*/ */
public void getAllStitchSlots(List par1List) public void getAllStitchSlots(List par1List) {
{ if (this.holder != null) {
if (this.holder != null)
{
par1List.add(this); par1List.add(this);
} } else if (this.subSlots != null) {
else if (this.subSlots != null)
{
Iterator var2 = this.subSlots.iterator(); Iterator var2 = this.subSlots.iterator();
while (var2.hasNext()) while (var2.hasNext()) {
{
StitchSlot var3 = (StitchSlot) var2.next(); StitchSlot var3 = (StitchSlot) var2.next();
var3.getAllStitchSlots(par1List); var3.getAllStitchSlots(par1List);
} }
} }
} }
public String toString() public String toString() {
{
return "Slot{originX=" + this.originX + ", originY=" + this.originY + ", width=" + this.width + ", height=" + this.height + ", texture=" + this.holder + ", subSlots=" + this.subSlots + '}'; return "Slot{originX=" + this.originX + ", originY=" + this.originY + ", width=" + this.width + ", height=" + this.height + ", texture=" + this.holder + ", subSlots=" + this.subSlots + '}';
} }
} }

View File

@ -1,6 +1,5 @@
package net.minecraft.src; package net.minecraft.src;
import com.google.common.collect.Lists;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashSet; import java.util.HashSet;
@ -8,8 +7,10 @@ import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
public class Stitcher import net.lax1dude.eaglercraft.EaglerAdapter;
{
public class Stitcher {
private final Set setStitchHolders; private final Set setStitchHolders;
private final List stitchSlots; private final List stitchSlots;
private int currentWidth; private int currentWidth;
@ -20,100 +21,83 @@ public class Stitcher
/** Max size (width or height) of a single tile */ /** Max size (width or height) of a single tile */
private final int maxTileDimension; private final int maxTileDimension;
private Texture atlasTexture;
private final String textureName;
public Stitcher(int par1, int par2, boolean par3) public Stitcher(String par1Str, int par2, int par3, boolean par4) {
{ this(par1Str, par2, par3, par4, 0);
this(par1, par2, par3, 0);
} }
public Stitcher(int par1, int par2, boolean par3, int par4) public Stitcher(String par1, int par2, int par3, boolean par4, int par5) {
{
this.setStitchHolders = new HashSet(256); this.setStitchHolders = new HashSet(256);
this.stitchSlots = new ArrayList(256); this.stitchSlots = new ArrayList(256);
this.maxWidth = par1; this.currentWidth = 0;
this.maxHeight = par2; this.currentHeight = 0;
this.forcePowerOf2 = par3; this.textureName = par1;
this.maxTileDimension = par4; this.maxWidth = par2;
this.maxHeight = par3;
this.forcePowerOf2 = par4;
this.maxTileDimension = par5;
} }
public int getCurrentWidth() public void addStitchHolder(StitchHolder par1StitchHolder) {
{ if (this.maxTileDimension > 0) {
return this.currentWidth; par1StitchHolder.setNewDimension(this.maxTileDimension);
} }
public int getCurrentHeight() this.setStitchHolders.add(par1StitchHolder);
{
return this.currentHeight;
} }
public void addSprite(TextureAtlasSprite par1TextureAtlasSprite) public Texture getTexture() {
{ if (this.forcePowerOf2) {
StitchHolder var2 = new StitchHolder(par1TextureAtlasSprite);
if (this.maxTileDimension > 0)
{
var2.setNewDimension(this.maxTileDimension);
}
this.setStitchHolders.add(var2);
}
public void doStitch()
{
StitchHolder[] var1 = (StitchHolder[])this.setStitchHolders.toArray(new StitchHolder[this.setStitchHolders.size()]);
Arrays.sort(var1);
StitchHolder[] var2 = var1;
int var3 = var1.length;
for (int var4 = 0; var4 < var3; ++var4)
{
StitchHolder var5 = var2[var4];
if (!this.allocateSlot(var5))
{
String var6 = String.format("Unable to fit: %s - size: %dx%d - Maybe try a lowerresolution texturepack?", new Object[] {var5.getAtlasSprite().getIconName(), Integer.valueOf(var5.getAtlasSprite().getIconWidth()), Integer.valueOf(var5.getAtlasSprite().getIconHeight())});
throw new StitcherException(var5, var6);
}
}
if (this.forcePowerOf2)
{
this.currentWidth = this.getCeilPowerOf2(this.currentWidth); this.currentWidth = this.getCeilPowerOf2(this.currentWidth);
this.currentHeight = this.getCeilPowerOf2(this.currentHeight); this.currentHeight = this.getCeilPowerOf2(this.currentHeight);
} }
this.atlasTexture = TextureManager.instance().createEmptyTexture(this.textureName, 1, this.currentWidth, this.currentHeight, EaglerAdapter.GL_CLAMP);
this.atlasTexture.fillRect(this.atlasTexture.getTextureRect(), -65536);
List var1 = this.getStichSlots();
for (int var2 = 0; var2 < var1.size(); ++var2) {
StitchSlot var3 = (StitchSlot) var1.get(var2);
StitchHolder var4 = var3.getStitchHolder();
this.atlasTexture.copyFrom(var3.getOriginX(), var3.getOriginY(), var4.func_98150_a(), var4.isRotated());
} }
public List getStichSlots() TextureManager.instance().registerTexture(this.textureName, this.atlasTexture);
{ return this.atlasTexture;
ArrayList var1 = Lists.newArrayList(); }
public void doStitch() {
StitchHolder[] var1 = (StitchHolder[]) this.setStitchHolders.toArray(new StitchHolder[this.setStitchHolders.size()]);
Arrays.sort(var1);
this.atlasTexture = null;
for (int var2 = 0; var2 < var1.length; ++var2) {
StitchHolder var3 = var1[var2];
if (!this.allocateSlot(var3)) {
throw new StitcherException(var3);
}
}
}
public List getStichSlots() {
ArrayList var1 = new ArrayList();
Iterator var2 = this.stitchSlots.iterator(); Iterator var2 = this.stitchSlots.iterator();
while (var2.hasNext()) while (var2.hasNext()) {
{
StitchSlot var3 = (StitchSlot) var2.next(); StitchSlot var3 = (StitchSlot) var2.next();
var3.getAllStitchSlots(var1); var3.getAllStitchSlots(var1);
} }
ArrayList var7 = Lists.newArrayList(); return var1;
Iterator var8 = var1.iterator();
while (var8.hasNext())
{
StitchSlot var4 = (StitchSlot)var8.next();
StitchHolder var5 = var4.getStitchHolder();
TextureAtlasSprite var6 = var5.getAtlasSprite();
var6.initSprite(this.currentWidth, this.currentHeight, var4.getOriginX(), var4.getOriginY(), var5.isRotated());
var7.add(var6);
}
return var7;
} }
/** /**
* Returns power of 2 >= the specified value * Returns power of 2 >= the specified value
*/ */
private int getCeilPowerOf2(int par1) private int getCeilPowerOf2(int par1) {
{
int var2 = par1 - 1; int var2 = par1 - 1;
var2 |= var2 >> 1; var2 |= var2 >> 1;
var2 |= var2 >> 2; var2 |= var2 >> 2;
@ -126,19 +110,15 @@ public class Stitcher
/** /**
* Attempts to find space for specified tile * Attempts to find space for specified tile
*/ */
private boolean allocateSlot(StitchHolder par1StitchHolder) private boolean allocateSlot(StitchHolder par1StitchHolder) {
{ for (int var2 = 0; var2 < this.stitchSlots.size(); ++var2) {
for (int var2 = 0; var2 < this.stitchSlots.size(); ++var2) if (((StitchSlot) this.stitchSlots.get(var2)).func_94182_a(par1StitchHolder)) {
{
if (((StitchSlot)this.stitchSlots.get(var2)).addSlot(par1StitchHolder))
{
return true; return true;
} }
par1StitchHolder.rotate(); par1StitchHolder.rotate();
if (((StitchSlot)this.stitchSlots.get(var2)).addSlot(par1StitchHolder)) if (((StitchSlot) this.stitchSlots.get(var2)).func_94182_a(par1StitchHolder)) {
{
return true; return true;
} }
@ -151,14 +131,12 @@ public class Stitcher
/** /**
* Expand stitched texture in order to make space for specified tile * Expand stitched texture in order to make space for specified tile
*/ */
private boolean expandAndAllocateSlot(StitchHolder par1StitchHolder) private boolean expandAndAllocateSlot(StitchHolder par1StitchHolder) {
{
int var2 = Math.min(par1StitchHolder.getHeight(), par1StitchHolder.getWidth()); int var2 = Math.min(par1StitchHolder.getHeight(), par1StitchHolder.getWidth());
boolean var3 = this.currentWidth == 0 && this.currentHeight == 0; boolean var3 = this.currentWidth == 0 && this.currentHeight == 0;
boolean var4; boolean var4;
if (this.forcePowerOf2) if (this.forcePowerOf2) {
{
int var5 = this.getCeilPowerOf2(this.currentWidth); int var5 = this.getCeilPowerOf2(this.currentWidth);
int var6 = this.getCeilPowerOf2(this.currentHeight); int var6 = this.getCeilPowerOf2(this.currentHeight);
int var7 = this.getCeilPowerOf2(this.currentWidth + var2); int var7 = this.getCeilPowerOf2(this.currentWidth + var2);
@ -166,37 +144,29 @@ public class Stitcher
boolean var9 = var7 <= this.maxWidth; boolean var9 = var7 <= this.maxWidth;
boolean var10 = var8 <= this.maxHeight; boolean var10 = var8 <= this.maxHeight;
if (!var9 && !var10) if (!var9 && !var10) {
{
return false; return false;
} }
int var11 = Math.max(par1StitchHolder.getHeight(), par1StitchHolder.getWidth()); int var11 = Math.max(par1StitchHolder.getHeight(), par1StitchHolder.getWidth());
if (var3 && !var9 && this.getCeilPowerOf2(this.currentHeight + var11) > this.maxHeight) if (var3 && !var9 && this.getCeilPowerOf2(this.currentHeight + var11) > this.maxHeight) {
{
return false; return false;
} }
boolean var12 = var5 != var7; boolean var12 = var5 != var7;
boolean var13 = var6 != var8; boolean var13 = var6 != var8;
if (var12 ^ var13) if (var12 ^ var13) {
{
var4 = var12 && var9; var4 = var12 && var9;
} } else {
else
{
var4 = var9 && var5 <= var6; var4 = var9 && var5 <= var6;
} }
} } else {
else
{
boolean var14 = this.currentWidth + var2 <= this.maxWidth; boolean var14 = this.currentWidth + var2 <= this.maxWidth;
boolean var16 = this.currentHeight + var2 <= this.maxHeight; boolean var16 = this.currentHeight + var2 <= this.maxHeight;
if (!var14 && !var16) if (!var14 && !var16) {
{
return false; return false;
} }
@ -205,28 +175,23 @@ public class Stitcher
StitchSlot var15; StitchSlot var15;
if (var4) if (var4) {
{ if (par1StitchHolder.getWidth() > par1StitchHolder.getHeight()) {
if (par1StitchHolder.getWidth() > par1StitchHolder.getHeight())
{
par1StitchHolder.rotate(); par1StitchHolder.rotate();
} }
if (this.currentHeight == 0) if (this.currentHeight == 0) {
{
this.currentHeight = par1StitchHolder.getHeight(); this.currentHeight = par1StitchHolder.getHeight();
} }
var15 = new StitchSlot(this.currentWidth, 0, par1StitchHolder.getWidth(), this.currentHeight); var15 = new StitchSlot(this.currentWidth, 0, par1StitchHolder.getWidth(), this.currentHeight);
this.currentWidth += par1StitchHolder.getWidth(); this.currentWidth += par1StitchHolder.getWidth();
} } else {
else
{
var15 = new StitchSlot(0, this.currentHeight, this.currentWidth, par1StitchHolder.getHeight()); var15 = new StitchSlot(0, this.currentHeight, this.currentWidth, par1StitchHolder.getHeight());
this.currentHeight += par1StitchHolder.getHeight(); this.currentHeight += par1StitchHolder.getHeight();
} }
var15.addSlot(par1StitchHolder); var15.func_94182_a(par1StitchHolder);
this.stitchSlots.add(var15); this.stitchSlots.add(var15);
return true; return true;
} }

View File

@ -1,12 +1,9 @@
package net.minecraft.src; package net.minecraft.src;
public class StitcherException extends RuntimeException public class StitcherException extends RuntimeException {
{
private final StitchHolder field_98149_a; private final StitchHolder field_98149_a;
public StitcherException(StitchHolder par1StitchHolder, String par2Str) public StitcherException(StitchHolder par1StitchHolder) {
{
super(par2Str);
this.field_98149_a = par1StitchHolder; this.field_98149_a = par1StitchHolder;
} }
} }

View File

@ -1,26 +1,21 @@
package net.minecraft.src; package net.minecraft.src;
import com.google.common.collect.Lists; import java.util.ArrayList;
import com.google.common.collect.Maps; import java.util.HashMap;
import java.io.IOException;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
public class TextureManager implements Tickable, ResourceManagerReloadListener import net.lax1dude.eaglercraft.EaglerAdapter;
{ import net.lax1dude.eaglercraft.EaglerImage;
import net.minecraft.src.Minecraft;
public class TextureManager {
private static TextureManager instance; private static TextureManager instance;
private int nextTextureID = 0; private int nextTextureID = 0;
private final Map mapTextureObjects = Maps.newHashMap(); private final HashMap texturesMap = new HashMap();
private final Map mapResourceLocations = Maps.newHashMap(); private final HashMap mapNameToId = new HashMap();
private final List listTickables = Lists.newArrayList();
private final Map mapTextureCounters = Maps.newHashMap();
private ResourceManager theResourceManager;
public TextureManager(ResourceManager par1ResourceManager) public static void init() {
{ instance = new TextureManager();
this.theResourceManager = par1ResourceManager;
} }
public static TextureManager instance() { public static TextureManager instance() {
@ -31,121 +26,82 @@ public class TextureManager implements Tickable, ResourceManagerReloadListener
return this.nextTextureID++; return this.nextTextureID++;
} }
public void bindTexture(ResourceLocation par1ResourceLocation) public void registerTexture(String par1Str, Texture par2Texture) {
{ this.mapNameToId.put(par1Str, Integer.valueOf(par2Texture.getTextureId()));
Object var2 = (TextureObject)this.mapTextureObjects.get(par1ResourceLocation);
if (var2 == null) if (!this.texturesMap.containsKey(Integer.valueOf(par2Texture.getTextureId()))) {
{ this.texturesMap.put(Integer.valueOf(par2Texture.getTextureId()), par2Texture);
var2 = new SimpleTexture(par1ResourceLocation);
this.loadTexture(par1ResourceLocation, (TextureObject)var2);
}
TextureUtil.bindTexture(((TextureObject)var2).getGlTextureId());
}
public ResourceLocation getResourceLocation(int par1)
{
return (ResourceLocation)this.mapResourceLocations.get(Integer.valueOf(par1));
}
public boolean loadTextureMap(ResourceLocation par1ResourceLocation, TextureMap par2TextureMap)
{
if (this.loadTickableTexture(par1ResourceLocation, par2TextureMap))
{
this.mapResourceLocations.put(Integer.valueOf(par2TextureMap.getTextureType()), par1ResourceLocation);
return true;
}
else
{
return false;
} }
} }
public boolean loadTickableTexture(ResourceLocation par1ResourceLocation, TickableTextureObject par2TickableTextureObject) public void registerTexture(Texture par1Texture) {
{ if (this.texturesMap.containsValue(par1Texture)) {
if (this.loadTexture(par1ResourceLocation, par2TickableTextureObject)) System.out.println("TextureManager.registerTexture called, but this texture has already been registered. ignoring.");
{ } else {
this.listTickables.add(par2TickableTextureObject); this.texturesMap.put(Integer.valueOf(par1Texture.getTextureId()), par1Texture);
return true;
}
else
{
return false;
} }
} }
public boolean loadTexture(ResourceLocation par1ResourceLocation, TextureObject par2TextureObject) public Stitcher createStitcher(String par1Str) {
{ int var2 = Minecraft.getGLMaximumTextureSize();
boolean var3 = true; return new Stitcher(par1Str, var2, var2, true);
try
{
((TextureObject)par2TextureObject).loadTexture(this.theResourceManager);
}
catch (IOException var8)
{
Minecraft.getMinecraft().getLogAgent().logWarningException("Failed to load texture: " + par1ResourceLocation, var8);
par2TextureObject = TextureUtil.missingTexture;
this.mapTextureObjects.put(par1ResourceLocation, par2TextureObject);
var3 = false;
}
catch (Throwable var9)
{
CrashReport var5 = CrashReport.makeCrashReport(var9, "Registering texture");
CrashReportCategory var6 = var5.makeCategory("Resource location being registered");
var6.addCrashSection("Resource location", par1ResourceLocation);
var6.addCrashSectionCallable("Texture object class", new TextureManagerINNER1(this, (TextureObject)par2TextureObject));
throw new ReportedException(var5);
} }
this.mapTextureObjects.put(par1ResourceLocation, par2TextureObject); public List createTexture(String par1Str) {
return var3; ArrayList var2 = new ArrayList();
ITexturePack var3 = Minecraft.getMinecraft().texturePackList.getSelectedTexturePack();
byte[] b = var3.getResourceAsBytes("/" + par1Str);
if(b != null) {
//EaglerImage var9 = EaglerImage.loadImage(b);
EaglerImage var9 = EaglerAdapter.loadPNG(b);
int var10 = var9.w;
int var11 = var9.h;
String var12 = this.getBasename(par1Str);
if (this.hasAnimationTxt(par1Str, var3)) {
int var13 = var10;
int var15 = var11 / var10;
for (int var16 = 0; var16 < var15; ++var16) {
Texture var17 = this.makeTexture(var12, 2, var13, var13, EaglerAdapter.GL_CLAMP, EaglerAdapter.GL_RGBA, EaglerAdapter.GL_NEAREST, EaglerAdapter.GL_NEAREST, false, var9.getSubImage(0, var13 * var16, var13, var13));
var2.add(var17);
} }
} else if (var10 == var11) {
public TextureObject getTexture(ResourceLocation par1ResourceLocation) var2.add(this.makeTexture(var12, 2, var10, var10, EaglerAdapter.GL_CLAMP, EaglerAdapter.GL_RGBA, EaglerAdapter.GL_NEAREST, EaglerAdapter.GL_NEAREST, false, var9));
{ } else {
return (TextureObject)this.mapTextureObjects.get(par1ResourceLocation); System.out.println("TextureManager.createTexture: Skipping " + par1Str + " because of broken aspect ratio and not animation");
}
public ResourceLocation getDynamicTextureLocation(String par1Str, DynamicTexture par2DynamicTexture)
{
Integer var3 = (Integer)this.mapTextureCounters.get(par1Str);
if (var3 == null)
{
var3 = Integer.valueOf(1);
}
else
{
var3 = Integer.valueOf(var3.intValue() + 1);
}
this.mapTextureCounters.put(par1Str, var3);
ResourceLocation var4 = new ResourceLocation(String.format("dynamic/%s_%d", new Object[] {par1Str, var3}));
this.loadTexture(var4, par2DynamicTexture);
return var4;
}
public void tick()
{
Iterator var1 = this.listTickables.iterator();
while (var1.hasNext())
{
Tickable var2 = (Tickable)var1.next();
var2.tick();
} }
} }
public void onResourceManagerReload(ResourceManager par1ResourceManager) return var2;
{ }
Iterator var2 = this.mapTextureObjects.entrySet().iterator();
while (var2.hasNext()) /**
{ * Strips directory and file extension from the specified path, returning only
Entry var3 = (Entry)var2.next(); * the filename
this.loadTexture((ResourceLocation)var3.getKey(), (TextureObject)var3.getValue()); */
} private String getBasename(String par1Str) {
String name = par1Str.substring(par1Str.lastIndexOf('/') + 1);
return name.substring(0, name.lastIndexOf(46));
}
/**
* Returns true if specified texture pack contains animation data for the
* specified texture file
*/
private boolean hasAnimationTxt(String par1Str, ITexturePack par2ITexturePack) {
String var3 = "/" + par1Str.substring(0, par1Str.lastIndexOf(46)) + ".txt";
boolean var4 = par2ITexturePack.func_98138_b("/" + par1Str, false);
return Minecraft.getMinecraft().texturePackList.getSelectedTexturePack().func_98138_b(var3, !var4);
}
public Texture makeTexture(String par1Str, int par2, int par3, int par4, int par5, int par6, int par7, int par8, boolean par9, EaglerImage par10BufferedImage) {
Texture var11 = new Texture(par1Str, par2, par3, par4, par5, par6, par7, par8, par10BufferedImage);
this.registerTexture(var11);
return var11;
}
public Texture createEmptyTexture(String par1Str, int par2, int par3, int par4, int par5) {
return this.makeTexture(par1Str, par2, par3, par4, EaglerAdapter.GL_CLAMP, par5, EaglerAdapter.GL_NEAREST, EaglerAdapter.GL_NEAREST, false, (EaglerImage) null);
} }
} }

View File

@ -1,152 +1,54 @@
package net.minecraft.src; package net.minecraft.src;
import com.google.common.collect.Lists; import java.util.ArrayList;
import com.google.common.collect.Maps; import java.util.Arrays;
import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry;
public class TextureMap extends AbstractTexture implements TickableTextureObject, IconRegister import net.lax1dude.eaglercraft.EaglerAdapter;
{ import net.lax1dude.eaglercraft.EaglerImage;
public static final ResourceLocation locationBlocksTexture = new ResourceLocation("textures/atlas/blocks.png"); import net.lax1dude.eaglercraft.TextureLocation;
public static final ResourceLocation locationItemsTexture = new ResourceLocation("textures/atlas/items.png"); import net.minecraft.src.Minecraft;
private final List listAnimatedSprites = Lists.newArrayList();
private final Map mapRegisteredSprites = Maps.newHashMap(); public class TextureMap implements IconRegister {
private final Map mapUploadedSprites = Maps.newHashMap(); public static final TextureLocation locationBlocksTexture = new TextureLocation("textures/atlas/blocks.png");
public static final TextureLocation locationItemsTexture = new TextureLocation("textures/atlas/items.png");
/** 0 = terrain.png, 1 = items.png */ /** 0 = terrain.png, 1 = items.png */
private final int textureType; private final int textureType;
private final String textureName;
private final String basePath; private final String basePath;
private final TextureAtlasSprite missingImage = new TextureAtlasSprite("missingno"); private final String textureExt;
private final HashMap mapTexturesStiched = new HashMap();
private EaglerImage missingImage;
private TextureStitched missingTextureStiched;
private Texture atlasTexture;
private final List listTextureStiched = new ArrayList();
private final Map textureStichedMap = new HashMap();
public TextureMap(int par1, String par2Str) public TextureMap(int par1, String par2, String par3Str, EaglerImage par4BufferedImage) {
{
this.textureType = par1; this.textureType = par1;
this.basePath = par2Str; this.textureName = par2;
this.registerIcons(); this.basePath = par3Str;
this.textureExt = ".png";
this.missingImage = par4BufferedImage;
} }
private void initMissingImage() public void refreshTextures() {
{ this.textureStichedMap.clear();
this.missingImage.setFramesTextureData(Lists.newArrayList(new int[][] {TextureUtil.missingTextureData}));
this.missingImage.setIconWidth(16);
this.missingImage.setIconHeight(16);
}
public void loadTexture(ResourceManager par1ResourceManager) throws IOException
{
this.initMissingImage();
this.loadTextureAtlas(par1ResourceManager);
}
public void loadTextureAtlas(ResourceManager par1ResourceManager)
{
int var2 = Minecraft.getGLMaximumTextureSize();
Stitcher var3 = new Stitcher(var2, var2, true);
this.mapUploadedSprites.clear();
this.listAnimatedSprites.clear();
Iterator var4 = this.mapRegisteredSprites.entrySet().iterator();
while (var4.hasNext())
{
Entry var5 = (Entry)var4.next();
ResourceLocation var6 = new ResourceLocation((String)var5.getKey());
TextureAtlasSprite var7 = (TextureAtlasSprite)var5.getValue();
ResourceLocation var8 = new ResourceLocation(var6.getResourceDomain(), String.format("%s/%s%s", new Object[] {this.basePath, var6.getResourcePath(), ".png"}));
try
{
var7.loadSprite(par1ResourceManager.getResource(var8));
}
catch (RuntimeException var13)
{
Minecraft.getMinecraft().getLogAgent().logSevere(String.format("Unable to parse animation metadata from %s: %s", new Object[] {var8, var13.getMessage()}));
continue;
}
catch (IOException var14)
{
Minecraft.getMinecraft().getLogAgent().logSevere("Using missing texture, unable to load: " + var8);
continue;
}
var3.addSprite(var7);
}
var3.addSprite(this.missingImage);
try
{
var3.doStitch();
}
catch (StitcherException var12)
{
throw var12;
}
TextureUtil.allocateTexture(this.getGlTextureId(), var3.getCurrentWidth(), var3.getCurrentHeight());
HashMap var15 = Maps.newHashMap(this.mapRegisteredSprites);
Iterator var16 = var3.getStichSlots().iterator();
TextureAtlasSprite var17;
while (var16.hasNext())
{
var17 = (TextureAtlasSprite)var16.next();
String var18 = var17.getIconName();
var15.remove(var18);
this.mapUploadedSprites.put(var18, var17);
try
{
TextureUtil.uploadTextureSub(var17.getFrameTextureData(0), var17.getIconWidth(), var17.getIconHeight(), var17.getOriginX(), var17.getOriginY(), false, false);
}
catch (Throwable var11)
{
CrashReport var9 = CrashReport.makeCrashReport(var11, "Stitching texture atlas");
CrashReportCategory var10 = var9.makeCategory("Texture being stitched together");
var10.addCrashSection("Atlas path", this.basePath);
var10.addCrashSection("Sprite", var17);
throw new ReportedException(var9);
}
if (var17.hasAnimationMetadata())
{
this.listAnimatedSprites.add(var17);
}
else
{
var17.clearFramesTextureData();
}
}
var16 = var15.values().iterator();
while (var16.hasNext())
{
var17 = (TextureAtlasSprite)var16.next();
var17.copyFrom(this.missingImage);
}
}
private void registerIcons()
{
this.mapRegisteredSprites.clear();
int var2; int var2;
int var3; int var3;
if (this.textureType == 0) if (this.textureType == 0) {
{
Block[] var1 = Block.blocksList; Block[] var1 = Block.blocksList;
var2 = var1.length; var2 = var1.length;
for (var3 = 0; var3 < var2; ++var3) for (var3 = 0; var3 < var2; ++var3) {
{
Block var4 = var1[var3]; Block var4 = var1[var3];
if (var4 != null) if (var4 != null) {
{
var4.registerIcons(this); var4.registerIcons(this);
} }
} }
@ -155,88 +57,132 @@ public class TextureMap extends AbstractTexture implements TickableTextureObject
RenderManager.instance.updateIcons(this); RenderManager.instance.updateIcons(this);
} }
Item[] var5 = Item.itemsList; Item[] var19 = Item.itemsList;
var2 = var5.length; var2 = var19.length;
for (var3 = 0; var3 < var2; ++var3) for (var3 = 0; var3 < var2; ++var3) {
{ Item var23 = var19[var3];
Item var6 = var5[var3];
if (var6 != null && var6.getSpriteNumber() == this.textureType) if (var23 != null && var23.getSpriteNumber() == this.textureType) {
{ var23.registerIcons(this);
var6.registerIcons(this); }
}
HashMap var20 = new HashMap();
Stitcher var21 = TextureManager.instance().createStitcher(this.textureName);
this.mapTexturesStiched.clear();
this.listTextureStiched.clear();
Texture var22 = TextureManager.instance().makeTexture("missingno", 2, this.missingImage.w, this.missingImage.h, EaglerAdapter.GL_CLAMP, EaglerAdapter.GL_RGBA, EaglerAdapter.GL_NEAREST, EaglerAdapter.GL_NEAREST, false, this.missingImage);
StitchHolder var24 = new StitchHolder(var22);
var21.addStitchHolder(var24);
var20.put(var24, Arrays.asList(new Texture[] { var22 }));
Iterator var5 = this.textureStichedMap.keySet().iterator();
while (var5.hasNext()) {
String var6 = (String) var5.next();
String var7 = this.basePath + var6 + this.textureExt;
List var8 = TextureManager.instance().createTexture(var7);
if (!var8.isEmpty()) {
StitchHolder var9 = new StitchHolder((Texture) var8.get(0));
var21.addStitchHolder(var9);
var20.put(var9, var8);
}
}
try {
var21.doStitch();
} catch (StitcherException var18) {
throw var18;
}
this.atlasTexture = var21.getTexture();
var5 = var21.getStichSlots().iterator();
while (var5.hasNext()) {
StitchSlot var25 = (StitchSlot) var5.next();
StitchHolder var27 = var25.getStitchHolder();
Texture var28 = var27.func_98150_a();
String var29 = var28.getTextureName();
List var10 = (List) var20.get(var27);
TextureStitched var11 = (TextureStitched) this.textureStichedMap.get(var29);
boolean var12 = false;
if (var11 == null) {
var12 = true;
var11 = TextureStitched.makeTextureStitched(var29);
if (!var29.equals("missingno")) {
System.out.println("Couldn\'t find premade icon for " + var29 + " doing " + this.textureName);
}
}
var11.init(this.atlasTexture, var10, var25.getOriginX(), var25.getOriginY(), var27.func_98150_a().getWidth(), var27.func_98150_a().getHeight(), var27.isRotated());
this.mapTexturesStiched.put(var29, var11);
if (!var12) {
this.textureStichedMap.remove(var29);
}
if (var10.size() > 1) {
this.listTextureStiched.add(var11);
String var13 = this.basePath + var29 + ".txt";
ITexturePack var14 = Minecraft.getMinecraft().texturePackList.getSelectedTexturePack();
boolean var15 = !var14.func_98138_b("/" + this.basePath + var29 + ".png", false);
if(var14.func_98138_b("/" + var13, false)) {
System.out.println("Found animation info for: " + var13);
var11.readAnimationInfo("/" + var13);
} }
} }
} }
public TextureAtlasSprite getAtlasSprite(String par1Str) this.missingTextureStiched = (TextureStitched) this.mapTexturesStiched.get("missingno");
{ var5 = this.textureStichedMap.values().iterator();
TextureAtlasSprite var2 = (TextureAtlasSprite)this.mapUploadedSprites.get(par1Str);
if (var2 == null) while (var5.hasNext()) {
{ TextureStitched var26 = (TextureStitched) var5.next();
var2 = this.missingImage; var26.copyFrom(this.missingTextureStiched);
} }
return var2; this.atlasTexture.writeImage("debug.stitched_" + this.textureName + ".png");
this.atlasTexture.uploadTexture();
} }
public void updateAnimations() public void updateAnimations() {
{ Iterator var1 = this.listTextureStiched.iterator();
TextureUtil.bindTexture(this.getGlTextureId());
Iterator var1 = this.listAnimatedSprites.iterator();
while (var1.hasNext()) while (var1.hasNext()) {
{ TextureStitched var2 = (TextureStitched) var1.next();
TextureAtlasSprite var2 = (TextureAtlasSprite)var1.next();
var2.updateAnimation(); var2.updateAnimation();
} }
} }
public Icon registerIcon(String par1Str) public Texture getTexture() {
{ return this.atlasTexture;
if (par1Str == null) }
{
public Icon registerIcon(String par1Str, int w) {
if(w != 1) {
System.err.println("Error, texture '" + par1Str + "' was registered with size " + w + ", the item texure map only supports size 1 (16px)");
return missingTextureStiched;
}else {
if (par1Str == null) {
(new RuntimeException("Don\'t register null!")).printStackTrace(); (new RuntimeException("Don\'t register null!")).printStackTrace();
} }
Object var2 = (TextureAtlasSprite)this.mapRegisteredSprites.get(par1Str); TextureStitched var2 = (TextureStitched) this.textureStichedMap.get(par1Str);
if (var2 == null) if (var2 == null) {
{ var2 = TextureStitched.makeTextureStitched(par1Str);
if (this.textureType == 1) this.textureStichedMap.put(par1Str, var2);
{
if ("clock".equals(par1Str))
{
var2 = new TextureClock(par1Str);
}
else if ("compass".equals(par1Str))
{
var2 = new TextureCompass(par1Str);
}
else
{
var2 = new TextureAtlasSprite(par1Str);
}
}
else
{
var2 = new TextureAtlasSprite(par1Str);
} }
this.mapRegisteredSprites.put(par1Str, var2); return var2;
}
} }
return (Icon)var2; public Icon getMissingIcon() {
} return this.missingTextureStiched;
public int getTextureType()
{
return this.textureType;
}
public void tick()
{
this.updateAnimations();
} }
} }

View File

@ -1,5 +1,7 @@
package net.minecraft.src; package net.minecraft.src;
import net.lax1dude.eaglercraft.TextureLocation;
public abstract class TileEntitySpecialRenderer public abstract class TileEntitySpecialRenderer
{ {
/** /**
@ -9,13 +11,13 @@ public abstract class TileEntitySpecialRenderer
public abstract void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8); public abstract void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8);
protected void bindTexture(ResourceLocation par1ResourceLocation) protected void bindTexture(TextureLocation par1ResourceLocation)
{ {
TextureManager var2 = this.tileEntityRenderer.renderEngine; TextureManager var2 = this.tileEntityRenderer.renderEngine;
if (var2 != null) if (var2 != null)
{ {
var2.bindTexture(par1ResourceLocation); par1ResourceLocation.bindTexture();
} }
} }