2014-06-11 02:31:33 +02:00
|
|
|
package resonantinduction.mechanical.process.mixer;
|
2014-02-19 03:51:22 +01:00
|
|
|
|
|
|
|
import static org.lwjgl.opengl.GL11.glPopMatrix;
|
|
|
|
import static org.lwjgl.opengl.GL11.glPushMatrix;
|
|
|
|
import static org.lwjgl.opengl.GL11.glRotatef;
|
|
|
|
import static org.lwjgl.opengl.GL11.glTranslatef;
|
|
|
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
|
|
|
import net.minecraft.util.ResourceLocation;
|
|
|
|
import net.minecraftforge.client.model.AdvancedModelLoader;
|
2014-02-19 10:38:24 +01:00
|
|
|
import net.minecraftforge.client.model.IModelCustom;
|
|
|
|
|
|
|
|
import org.lwjgl.opengl.GL11;
|
|
|
|
|
2014-05-14 07:32:00 +02:00
|
|
|
import resonant.api.items.ISimpleItemRenderer;
|
|
|
|
import resonant.lib.render.RenderUtility;
|
2014-02-19 03:51:22 +01:00
|
|
|
import resonantinduction.core.Reference;
|
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Calclavia
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
public class RenderMixer extends TileEntitySpecialRenderer implements ISimpleItemRenderer
|
|
|
|
{
|
2014-02-19 10:38:24 +01:00
|
|
|
public static final IModelCustom MODEL = AdvancedModelLoader.loadModel(Reference.MODEL_DIRECTORY + "mixer.tcn");
|
2014-02-19 03:51:22 +01:00
|
|
|
public static ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "mixer.png");
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void renderTileEntityAt(TileEntity t, double x, double y, double z, float f)
|
|
|
|
{
|
|
|
|
if (t instanceof TileMixer)
|
|
|
|
{
|
|
|
|
TileMixer tile = (TileMixer) t;
|
|
|
|
glPushMatrix();
|
|
|
|
glTranslatef((float) x + 0.5F, (float) y + 0.5f, (float) z + 0.5F);
|
|
|
|
RenderUtility.bind(TEXTURE);
|
2014-02-21 15:48:55 +01:00
|
|
|
MODEL.renderOnly("centerTop", "centerBase");
|
2014-02-19 03:51:22 +01:00
|
|
|
glPushMatrix();
|
2014-06-04 14:24:46 +02:00
|
|
|
glRotatef((float) Math.toDegrees((float) tile.mechanicalNode.renderAngle), 0, 1, 0);
|
2014-02-21 15:48:55 +01:00
|
|
|
MODEL.renderAllExcept("centerTop", "centerBase");
|
2014-02-19 03:51:22 +01:00
|
|
|
glPopMatrix();
|
|
|
|
glPopMatrix();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void renderInventoryItem(ItemStack itemStack)
|
|
|
|
{
|
|
|
|
glPushMatrix();
|
|
|
|
GL11.glScalef(0.5f, 0.5f, 0.5f);
|
2014-03-03 13:52:34 +01:00
|
|
|
glTranslatef(0.5F, 0.5f, 0.5f);
|
2014-02-19 03:51:22 +01:00
|
|
|
RenderUtility.bind(TEXTURE);
|
|
|
|
MODEL.renderAll();
|
|
|
|
glPopMatrix();
|
|
|
|
}
|
|
|
|
}
|