Just some light work on the Alchemy Table renderers
This commit is contained in:
parent
abab67886f
commit
0a5db4c0ca
5 changed files with 221 additions and 20 deletions
|
@ -5,6 +5,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import com.pahimar.ee3.EquivalentExchange3;
|
import com.pahimar.ee3.EquivalentExchange3;
|
||||||
|
import com.pahimar.ee3.lib.RenderIds;
|
||||||
import com.pahimar.ee3.lib.Strings;
|
import com.pahimar.ee3.lib.Strings;
|
||||||
import com.pahimar.ee3.tileentity.TileAlchemyTable;
|
import com.pahimar.ee3.tileentity.TileAlchemyTable;
|
||||||
|
|
||||||
|
@ -29,24 +30,23 @@ public class BlockAlchemyTable extends BlockEE {
|
||||||
return unlocalizedName.toString();
|
return unlocalizedName.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO Finish getting the rendering nice looking
|
@Override
|
||||||
// @Override
|
public boolean renderAsNormalBlock() {
|
||||||
// public boolean renderAsNormalBlock() {
|
|
||||||
//
|
return false;
|
||||||
// return false;
|
}
|
||||||
// }
|
|
||||||
//
|
@Override
|
||||||
// @Override
|
public boolean isOpaqueCube() {
|
||||||
// public boolean isOpaqueCube() {
|
|
||||||
//
|
return false;
|
||||||
// return false;
|
}
|
||||||
// }
|
|
||||||
//
|
@Override
|
||||||
// @Override
|
public int getRenderType() {
|
||||||
// public int getRenderType() {
|
|
||||||
//
|
return RenderIds.alchemyTable;
|
||||||
// return RenderIds.alchemyTable;
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world) {
|
public TileEntity createNewTileEntity(World world) {
|
||||||
|
|
|
@ -1,10 +1,31 @@
|
||||||
package com.pahimar.ee3.client.model;
|
package com.pahimar.ee3.client.model;
|
||||||
|
|
||||||
import net.minecraft.client.model.ModelBase;
|
import net.minecraft.client.model.ModelBase;
|
||||||
|
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||||
|
import net.minecraftforge.client.model.IModelCustom;
|
||||||
|
|
||||||
|
import com.pahimar.ee3.lib.Models;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class ModelAlchemyTable extends ModelBase {
|
public class ModelAlchemyTable extends ModelBase {
|
||||||
|
|
||||||
|
private IModelCustom modelAlchemyTable;
|
||||||
|
|
||||||
|
public ModelAlchemyTable() {
|
||||||
|
|
||||||
|
modelAlchemyTable = AdvancedModelLoader.loadModel(Models.ALCHEMY_TABLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void render() {
|
||||||
|
|
||||||
|
modelAlchemyTable.renderAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void renderPart(String partName) {
|
||||||
|
|
||||||
|
modelAlchemyTable.renderPart(partName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,113 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package com.pahimar.ee3.client.renderer.item;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraftforge.client.IItemRenderer;
|
||||||
|
|
||||||
|
import com.pahimar.ee3.client.model.ModelAlchemyTable;
|
||||||
|
import com.pahimar.ee3.lib.Textures;
|
||||||
|
|
||||||
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Equivalent-Exchange-3
|
||||||
|
*
|
||||||
|
* ItemAlchemyTableRenderer
|
||||||
|
*
|
||||||
|
* @author pahimar
|
||||||
|
* @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public class ItemAlchemyTableRenderer implements IItemRenderer {
|
||||||
|
|
||||||
|
private ModelAlchemyTable modelAlchemyTable;
|
||||||
|
|
||||||
|
public ItemAlchemyTableRenderer() {
|
||||||
|
|
||||||
|
modelAlchemyTable = new ModelAlchemyTable();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
* @see
|
||||||
|
* net.minecraftforge.client.IItemRenderer#handleRenderType(net.minecraft
|
||||||
|
* .item.ItemStack, net.minecraftforge.client.IItemRenderer.ItemRenderType)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
* @see net.minecraftforge.client.IItemRenderer#shouldUseRenderHelper(net.
|
||||||
|
* minecraftforge.client.IItemRenderer.ItemRenderType,
|
||||||
|
* net.minecraft.item.ItemStack,
|
||||||
|
* net.minecraftforge.client.IItemRenderer.ItemRendererHelper)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
* @see
|
||||||
|
* net.minecraftforge.client.IItemRenderer#renderItem(net.minecraftforge
|
||||||
|
* .client.IItemRenderer.ItemRenderType, net.minecraft.item.ItemStack,
|
||||||
|
* java.lang.Object[])
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case ENTITY: {
|
||||||
|
renderAlchemyTable(-0.5F, 0.0F, 0.5F, 1.0F);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
case EQUIPPED: {
|
||||||
|
renderAlchemyTable(0.0F, 0.0F, 1.0F, 1.0F);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
case EQUIPPED_FIRST_PERSON: {
|
||||||
|
renderAlchemyTable(0.0F, 0.0F, 1.0F, 1.0F);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
case INVENTORY: {
|
||||||
|
renderAlchemyTable(0.0F, -0.1F, 1.0F, 1.0F);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void renderAlchemyTable(float x, float y, float z, float scale) {
|
||||||
|
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glDisable(GL11.GL_LIGHTING);
|
||||||
|
|
||||||
|
// Scale, Translate, Rotate
|
||||||
|
GL11.glScalef(scale, scale, scale);
|
||||||
|
GL11.glTranslatef(x, y, z);
|
||||||
|
GL11.glRotatef(-90F, 1F, 0, 0);
|
||||||
|
|
||||||
|
// Bind texture
|
||||||
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(Textures.MODEL_ALCHEMY_TABLE);
|
||||||
|
|
||||||
|
// Render
|
||||||
|
modelAlchemyTable.render();
|
||||||
|
|
||||||
|
GL11.glEnable(GL11.GL_LIGHTING);
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,64 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package com.pahimar.ee3.client.renderer.tileentity;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import com.pahimar.ee3.client.model.ModelAlchemyTable;
|
||||||
|
import com.pahimar.ee3.lib.Textures;
|
||||||
|
import com.pahimar.ee3.tileentity.TileAlchemyTable;
|
||||||
|
|
||||||
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Equivalent-Exchange-3
|
||||||
|
*
|
||||||
|
* TileEntityAlchemyTableRenderer
|
||||||
|
*
|
||||||
|
* @author pahimar
|
||||||
|
* @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public class TileEntityAlchemyTableRenderer extends TileEntitySpecialRenderer {
|
||||||
|
|
||||||
|
private ModelAlchemyTable modelAlchemyTable = new ModelAlchemyTable();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
* @see net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer#
|
||||||
|
* renderTileEntityAt(net.minecraft.tileentity.TileEntity, double, double,
|
||||||
|
* double, float)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float tick) {
|
||||||
|
|
||||||
|
if (tileEntity instanceof TileAlchemyTable) {
|
||||||
|
// TODO Use the TileAlchemyTable to determine what circle to project on the server of the table
|
||||||
|
TileAlchemyTable tileAlchemyTable = (TileAlchemyTable) tileEntity;
|
||||||
|
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glDisable(GL11.GL_LIGHTING);
|
||||||
|
|
||||||
|
// Scale, Translate, Rotate
|
||||||
|
GL11.glScalef(1.0F, 1.0F, 1.0F);
|
||||||
|
GL11.glTranslatef((float) x + 0.0F, (float) y + 0.0F, (float) z + 1.0F);
|
||||||
|
|
||||||
|
// Bind texture
|
||||||
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(Textures.MODEL_ALCHEMY_TABLE);
|
||||||
|
|
||||||
|
// Render
|
||||||
|
modelAlchemyTable.render();
|
||||||
|
|
||||||
|
GL11.glEnable(GL11.GL_LIGHTING);
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -11,11 +11,13 @@ import net.minecraftforge.common.MinecraftForge;
|
||||||
import com.pahimar.ee3.EquivalentExchange3;
|
import com.pahimar.ee3.EquivalentExchange3;
|
||||||
import com.pahimar.ee3.client.audio.SoundHandler;
|
import com.pahimar.ee3.client.audio.SoundHandler;
|
||||||
import com.pahimar.ee3.client.renderer.item.ItemAlchemicalChestRenderer;
|
import com.pahimar.ee3.client.renderer.item.ItemAlchemicalChestRenderer;
|
||||||
|
import com.pahimar.ee3.client.renderer.item.ItemAlchemyTableRenderer;
|
||||||
import com.pahimar.ee3.client.renderer.item.ItemAludelRenderer;
|
import com.pahimar.ee3.client.renderer.item.ItemAludelRenderer;
|
||||||
import com.pahimar.ee3.client.renderer.item.ItemCalcinatorRenderer;
|
import com.pahimar.ee3.client.renderer.item.ItemCalcinatorRenderer;
|
||||||
import com.pahimar.ee3.client.renderer.item.ItemGlassBellRenderer;
|
import com.pahimar.ee3.client.renderer.item.ItemGlassBellRenderer;
|
||||||
import com.pahimar.ee3.client.renderer.item.ItemRenderingTankRenderer;
|
import com.pahimar.ee3.client.renderer.item.ItemRenderingTankRenderer;
|
||||||
import com.pahimar.ee3.client.renderer.tileentity.TileEntityAlchemicalChestRenderer;
|
import com.pahimar.ee3.client.renderer.tileentity.TileEntityAlchemicalChestRenderer;
|
||||||
|
import com.pahimar.ee3.client.renderer.tileentity.TileEntityAlchemyTableRenderer;
|
||||||
import com.pahimar.ee3.client.renderer.tileentity.TileEntityAludelRenderer;
|
import com.pahimar.ee3.client.renderer.tileentity.TileEntityAludelRenderer;
|
||||||
import com.pahimar.ee3.client.renderer.tileentity.TileEntityCalcinatorRenderer;
|
import com.pahimar.ee3.client.renderer.tileentity.TileEntityCalcinatorRenderer;
|
||||||
import com.pahimar.ee3.client.renderer.tileentity.TileEntityGlassBellRenderer;
|
import com.pahimar.ee3.client.renderer.tileentity.TileEntityGlassBellRenderer;
|
||||||
|
@ -34,6 +36,7 @@ import com.pahimar.ee3.lib.RenderIds;
|
||||||
import com.pahimar.ee3.network.PacketTypeHandler;
|
import com.pahimar.ee3.network.PacketTypeHandler;
|
||||||
import com.pahimar.ee3.network.packet.PacketRequestEvent;
|
import com.pahimar.ee3.network.packet.PacketRequestEvent;
|
||||||
import com.pahimar.ee3.tileentity.TileAlchemicalChest;
|
import com.pahimar.ee3.tileentity.TileAlchemicalChest;
|
||||||
|
import com.pahimar.ee3.tileentity.TileAlchemyTable;
|
||||||
import com.pahimar.ee3.tileentity.TileAludel;
|
import com.pahimar.ee3.tileentity.TileAludel;
|
||||||
import com.pahimar.ee3.tileentity.TileCalcinator;
|
import com.pahimar.ee3.tileentity.TileCalcinator;
|
||||||
import com.pahimar.ee3.tileentity.TileEE;
|
import com.pahimar.ee3.tileentity.TileEE;
|
||||||
|
@ -104,7 +107,7 @@ public class ClientProxy extends CommonProxy {
|
||||||
MinecraftForgeClient.registerItemRenderer(BlockIds.ALUDEL_BASE, new ItemAludelRenderer());
|
MinecraftForgeClient.registerItemRenderer(BlockIds.ALUDEL_BASE, new ItemAludelRenderer());
|
||||||
MinecraftForgeClient.registerItemRenderer(BlockIds.ALCHEMICAL_CHEST, new ItemAlchemicalChestRenderer());
|
MinecraftForgeClient.registerItemRenderer(BlockIds.ALCHEMICAL_CHEST, new ItemAlchemicalChestRenderer());
|
||||||
MinecraftForgeClient.registerItemRenderer(BlockIds.GLASS_BELL, new ItemGlassBellRenderer());
|
MinecraftForgeClient.registerItemRenderer(BlockIds.GLASS_BELL, new ItemGlassBellRenderer());
|
||||||
// TODO Alchemy Table item renderer
|
MinecraftForgeClient.registerItemRenderer(BlockIds.ALCHEMY_TABLE, new ItemAlchemyTableRenderer());
|
||||||
MinecraftForgeClient.registerItemRenderer(BlockIds.RENDERING_TANK, new ItemRenderingTankRenderer());
|
MinecraftForgeClient.registerItemRenderer(BlockIds.RENDERING_TANK, new ItemRenderingTankRenderer());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,7 +120,7 @@ public class ClientProxy extends CommonProxy {
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileAludel.class, new TileEntityAludelRenderer());
|
ClientRegistry.bindTileEntitySpecialRenderer(TileAludel.class, new TileEntityAludelRenderer());
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileAlchemicalChest.class, new TileEntityAlchemicalChestRenderer());
|
ClientRegistry.bindTileEntitySpecialRenderer(TileAlchemicalChest.class, new TileEntityAlchemicalChestRenderer());
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileGlassBell.class, new TileEntityGlassBellRenderer());
|
ClientRegistry.bindTileEntitySpecialRenderer(TileGlassBell.class, new TileEntityGlassBellRenderer());
|
||||||
// TODO Alchemy Table TESR
|
ClientRegistry.bindTileEntitySpecialRenderer(TileAlchemyTable.class, new TileEntityAlchemyTableRenderer());
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileRenderingTank.class, new TileEntityRenderingTankRenderer());
|
ClientRegistry.bindTileEntitySpecialRenderer(TileRenderingTank.class, new TileEntityRenderingTankRenderer());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue