Removed remaining usage of ITextureProvider

This commit is contained in:
Krapht 2012-08-11 18:44:24 +02:00
parent c1f189f931
commit 5971330432
6 changed files with 21 additions and 48 deletions

View file

@ -56,25 +56,18 @@ public class GuiCombustionEngine extends GuiEngine {
}
private void displayGauge(int j, int k, int line, int col, int squaled, int liquidId) {
Object o = null;
int liquidImgIndex = 0;
if (liquidId < Block.blocksList.length && Block.blocksList[liquidId] != null) {
o = Block.blocksList[liquidId];
MinecraftForgeClient.bindTexture(Block.blocksList[liquidId].getTextureFile());
liquidImgIndex = Block.blocksList[liquidId].blockIndexInTexture;
} else if (Item.itemsList[liquidId] != null) {
o = Item.itemsList[liquidId];
MinecraftForgeClient.bindTexture(Item.itemsList[liquidId].getTextureFile());
liquidImgIndex = Item.itemsList[liquidId].getIconFromDamage(0);
} else {
return;
}
if (o == null)
return;
if (o instanceof ITextureProvider)
MinecraftForgeClient.bindTexture(((ITextureProvider) o).getTextureFile());
else
MinecraftForgeClient.bindTexture("/terrain.png");
int imgLine = liquidImgIndex / 16;
int imgColumn = liquidImgIndex - imgLine * 16;

View file

@ -16,7 +16,6 @@ import buildcraft.core.TextureLiquidsFX;
public class TextureFuelFX extends TextureLiquidsFX {
public TextureFuelFX() {
super(150, 250, 150, 250, 0, 10, BuildCraftEnergy.fuel.getIconFromDamage(0), ((ITextureProvider) BuildCraftEnergy.fuel)
.getTextureFile());
super(150, 250, 150, 250, 0, 10, BuildCraftEnergy.fuel.getIconFromDamage(0), BuildCraftEnergy.fuel.getTextureFile());
}
}

View file

@ -16,7 +16,6 @@ import buildcraft.core.TextureLiquidsFX;
public class TextureOilFX extends TextureLiquidsFX {
public TextureOilFX() {
super(10, 31, 10, 31, 10, 31, BuildCraftEnergy.oilStill.blockIndexInTexture,
((ITextureProvider) BuildCraftEnergy.oilStill).getTextureFile());
super(10, 31, 10, 31, 10, 31, BuildCraftEnergy.oilStill.blockIndexInTexture, BuildCraftEnergy.oilStill.getTextureFile());
}
}

View file

@ -250,16 +250,10 @@ public class RenderRefinery extends TileEntitySpecialRenderer implements IInvent
}
public void setTextureFor(int liquidId) {
Object o = null;
if (liquidId < Block.blocksList.length && Block.blocksList[liquidId] != null)
o = Block.blocksList[liquidId];
else
o = Item.itemsList[liquidId];
if (o instanceof ITextureProvider)
MinecraftForgeClient.bindTexture(((ITextureProvider) o).getTextureFile());
else
MinecraftForgeClient.bindTexture("/terrain.png");
if (liquidId < Block.blocksList.length && Block.blocksList[liquidId] != null) {
MinecraftForgeClient.bindTexture(Block.blocksList[liquidId].getTextureFile());
} else {
MinecraftForgeClient.bindTexture(Item.itemsList[liquidId].getTextureFile());
}
}
}

View file

@ -82,17 +82,11 @@ public class RenderTank extends TileEntitySpecialRenderer {
GL11.glPushMatrix();
GL11.glDisable(2896 /* GL_LIGHTING */);
Object obj = null;
if (liquid.itemID < Block.blocksList.length && Block.blocksList[liquid.itemID] != null)
obj = Block.blocksList[liquid.itemID];
else
obj = Item.itemsList[liquid.itemID];
if (obj instanceof ITextureProvider)
MinecraftForgeClient.bindTexture(((ITextureProvider) obj).getTextureFile());
else
MinecraftForgeClient.bindTexture("/terrain.png");
if (liquid.itemID < Block.blocksList.length && Block.blocksList[liquid.itemID] != null) {
MinecraftForgeClient.bindTexture(Block.blocksList[liquid.itemID].getTextureFile());
} else {
MinecraftForgeClient.bindTexture(Item.itemsList[liquid.itemID].getTextureFile());
}
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F);

View file

@ -381,17 +381,11 @@ public class RenderPipe extends TileEntitySpecialRenderer {
if (liquidId == 0)
return null;
Object o = null;
if (liquidId < Block.blocksList.length && Block.blocksList[liquidId] != null)
o = Block.blocksList[liquidId];
else
o = Item.itemsList[liquidId];
// should be safe, items and block all implement ITextureProvider now
// and if o is null, something else is wrong somewhere
MinecraftForgeClient.bindTexture(((ITextureProvider) o).getTextureFile());
if (liquidId < Block.blocksList.length && Block.blocksList[liquidId] != null) {
MinecraftForgeClient.bindTexture(Block.blocksList[liquidId].getTextureFile());
} else {
MinecraftForgeClient.bindTexture(Item.itemsList[liquidId].getTextureFile());
}
return getDisplayLiquidLists(liquidId, stack.itemMeta, world);
}