fix RenderTank
This commit is contained in:
parent
f9b6980993
commit
4d92a9b918
2 changed files with 31 additions and 4 deletions
|
@ -12,11 +12,14 @@ import java.util.TreeMap;
|
|||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.common.Configuration;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.Property;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
import net.minecraftforge.liquids.LiquidContainerData;
|
||||
import net.minecraftforge.liquids.LiquidContainerRegistry;
|
||||
import net.minecraftforge.liquids.LiquidDictionary;
|
||||
|
@ -53,6 +56,8 @@ import cpw.mods.fml.common.network.NetworkMod;
|
|||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@Mod(name = "BuildCraft Energy", version = Version.VERSION, useMetadata = false, modid = "BuildCraft|Energy", dependencies = DefaultProps.DEPENDENCY_CORE)
|
||||
@NetworkMod(channels = { DefaultProps.NET_CHANNEL_NAME }, packetHandler = PacketHandler.class, clientSideRequired = true, serverSideRequired = true)
|
||||
|
@ -160,6 +165,18 @@ public class BuildCraftEnergy {
|
|||
bucketOil), new ItemStack(Item.bucketEmpty)));
|
||||
LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getLiquid("Fuel", LiquidContainerRegistry.BUCKET_VOLUME),
|
||||
new ItemStack(bucketFuel), new ItemStack(Item.bucketEmpty)));
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@ForgeSubscribe
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void textureHook(TextureStitchEvent.Post event) {
|
||||
if (event.map == Minecraft.getMinecraft().renderEngine.textureMapItems) {
|
||||
LiquidDictionary.getCanonicalLiquid("Fuel").setRenderingIcon(fuel.getIconFromDamage(0));
|
||||
} else {
|
||||
LiquidDictionary.getCanonicalLiquid("Oil").setRenderingIcon(oilStill.getBlockTextureFromSide(1));
|
||||
}
|
||||
}
|
||||
|
||||
public static void loadRecipes() {
|
||||
|
|
|
@ -11,6 +11,7 @@ package buildcraft.factory.render;
|
|||
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GLAllocation;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
|
@ -29,7 +30,7 @@ public class RenderTank extends TileEntitySpecialRenderer {
|
|||
|
||||
final static private int displayStages = 100;
|
||||
|
||||
private HashMap<LiquidStack, int[]> stage = new HashMap<LiquidStack, int[]>();
|
||||
private final HashMap<LiquidStack, int[]> stage = new HashMap<LiquidStack, int[]>();
|
||||
|
||||
private int[] getDisplayLists(LiquidStack liquid, World world) {
|
||||
|
||||
|
@ -41,13 +42,22 @@ public class RenderTank extends TileEntitySpecialRenderer {
|
|||
stage.put(liquid, d);
|
||||
|
||||
BlockInterface block = new BlockInterface();
|
||||
block.baseBlock = Block.waterStill;
|
||||
block.texture = liquid.getRenderingIcon();
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture("/terrain.png");
|
||||
|
||||
String spriteSet = "/gui/items.png";
|
||||
|
||||
if (liquid.itemID < Block.blocksList.length) {
|
||||
spriteSet = "/terrain.png";
|
||||
block.baseBlock = Block.blocksList[liquid.itemID];
|
||||
}
|
||||
|
||||
for (int s = 0; s < displayStages; ++s) {
|
||||
d[s] = GLAllocation.generateDisplayLists(1);
|
||||
GL11.glNewList(d[s], 4864 /* GL_COMPILE */);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(spriteSet);
|
||||
|
||||
block.minX = 0.125 + 0.01;
|
||||
block.minY = 0;
|
||||
block.minZ = 0.125 + 0.01;
|
||||
|
|
Loading…
Reference in a new issue