resonant-induction/minecraft/dark/BasicUtilities/ItemRenderHelper.java
Rseifert 494d98bb05 where do i begin
I've made a mess of changes since last upload. Main big change is change
in forge file formate that merged minecraft and common folder. The other
is the complete rewrite to Forge Liquid api. So far only the pump,
boiler, and pipe are converted to the new system. The pipe will actual
not fully work with most machines since it can't drain liquids out of
machines. In future update there will be a block to do this called a
pipe pump. Other than those changes nothing much is diffrent.
2012-12-22 04:44:17 -05:00

68 lines
2.7 KiB
Java

package dark.BasicUtilities;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
import dark.BasicUtilities.renders.ModelGearRod;
import dark.BasicUtilities.renders.ModelGenerator;
import dark.BasicUtilities.renders.ModelPump;
public class ItemRenderHelper implements ISimpleBlockRenderingHandler {
public static ItemRenderHelper instance = new ItemRenderHelper();
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
private ModelPump modelPump = new ModelPump();
private ModelGearRod modelRod = new ModelGearRod();
private ModelGenerator modelGen = new ModelGenerator();
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
if(block.blockID == BasicUtilitiesMain.machine.blockID && metadata < 4)
{
GL11.glPushMatrix();
GL11.glTranslatef((float) 0.0F, (float)1.1F, (float)0.0F);
GL11.glRotatef(180f, 0f, 0f, 1f);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(BasicUtilitiesMain.textureFile+"pumps/Pump.png"));
modelPump.renderMain(0.0725F);
modelPump.renderC1(0.0725F);
modelPump.renderC2(0.0725F);
modelPump.renderC3(0.0725F);
GL11.glPopMatrix();
}
if(block.blockID == BasicUtilitiesMain.rod.blockID)
{
GL11.glPushMatrix();
GL11.glTranslatef((float) 0.0F, (float)1.5F, (float)0.0F);
GL11.glRotatef(180f, 0f, 0f, 1f);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(BasicUtilitiesMain.textureFile+"mechanical/GearRod.png"));
modelRod.render(0.0825F,0);
GL11.glPopMatrix();
}
if(block.blockID == BasicUtilitiesMain.generator.blockID)
{
GL11.glPushMatrix();
GL11.glTranslatef((float) 0.0F, (float)1.3F, (float)0.0F);
GL11.glRotatef(180f, 0f, 0f, 1f);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(BasicUtilitiesMain.textureFile+"mechanical/Generator.png"));
modelGen.RenderMain(0.0725F);
GL11.glPopMatrix();
}
}
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
return false;
}
public boolean shouldRender3DInInventory() {
return true;
}
public int getRenderId()
{
return renderID;
}
}