Stopped the ResourceLocation being created on RenderTick

This commit is contained in:
Ellpeck 2015-07-09 18:10:32 +02:00
parent a5274e9961
commit 5d963805d8

View file

@ -9,9 +9,11 @@ import org.lwjgl.opengl.GL11;
public class RenderTileEntity extends TileEntitySpecialRenderer{ public class RenderTileEntity extends TileEntitySpecialRenderer{
public ModelBaseAA theModel; public ModelBaseAA theModel;
private ResourceLocation resLoc;
public RenderTileEntity(ModelBaseAA model){ public RenderTileEntity(ModelBaseAA model){
this.theModel = model; this.theModel = model;
this.resLoc = new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/blocks/models/" + this.theModel.getName() + ".png");
} }
@Override @Override
@ -20,7 +22,7 @@ public class RenderTileEntity extends TileEntitySpecialRenderer{
GL11.glTranslatef((float)x + 0.5F, (float)y - 0.5F, (float)z + 0.5F); GL11.glTranslatef((float)x + 0.5F, (float)y - 0.5F, (float)z + 0.5F);
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
GL11.glTranslatef(0.0F, -2.0F, 0.0F); GL11.glTranslatef(0.0F, -2.0F, 0.0F);
this.bindTexture(new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/blocks/models/" + this.theModel.getName() + ".png")); this.bindTexture(resLoc);
if(theModel.doesRotate()){ if(theModel.doesRotate()){
int meta = tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord); int meta = tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord);