Lantern Model + Texture

This commit is contained in:
Kam committed 2025-02-12 02:34:05 -05:00
1 parent 79fc173e3b
commit 5d4088b9d1
15 files changed
+354 -148

No files matched your search

@@ -115,7 +115,7 @@ public class ClientProxy extends CommonProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileCouchWood.class, new BlockCouchWoodRenderer());
ClientRegistry.bindTileEntitySpecialRenderer(TileTable.class, new BlockTableRenderer());
ClientRegistry.bindTileEntitySpecialRenderer(TileCandle.class, new BlockCandleRenderer());
ClientRegistry.bindTileEntitySpecialRenderer(TileLamp.class, new BlockLampRenderer());
ClientRegistry.bindTileEntitySpecialRenderer(TileLamp.class, new BlockLanternRenderer());
ClientRegistry.bindTileEntitySpecialRenderer(TileStool.class, new BlockStoolRenderer());
ClientRegistry.bindTileEntitySpecialRenderer(TileBigSign.class, new BlockBigSignRenderer());
ClientRegistry.bindTileEntitySpecialRenderer(TileBarrel.class, new BlockBarrelRenderer());
@@ -0,0 +1,60 @@
package noppes.npcs.client.model.blocks.lantern;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelBox;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
public class LanternCeiling extends ModelBase {
public final ModelRenderer Light;
public final ModelRenderer Lantern;
public final ModelRenderer Chain;
private final ModelRenderer cube_r1;
private final ModelRenderer cube_r2;
public LanternCeiling() {
textureWidth = 64;
textureHeight = 32;
Light = new ModelRenderer(this);
Light.setRotationPoint(0.0F, 24.0F, 0.0F);
Light.cubeList.add(new ModelBox(Light, 28, 8, -3.0F, -9.0F, -3.0F, 6, 7, 6, 0.0F));
Lantern = new ModelRenderer(this);
Lantern.setRotationPoint(0.0F, 24.0F, 0.0F);
Lantern.cubeList.add(new ModelBox(Lantern, 28, 0, -3.0F, -2.0F, -3.0F, 6, 2, 6, 0.0F));
Lantern.cubeList.add(new ModelBox(Lantern, 28, 21, -2.0F, -11.0F, -2.0F, 4, 2, 4, 0.0F));
Lantern.cubeList.add(new ModelBox(Lantern, 46, 21, -5.0F, -11.0F, 0.0F, 3, 11, 0, 0.0F));
Lantern.mirror = true;
Lantern.cubeList.add(new ModelBox(Lantern, 46, 21, 2.0F, -11.0F, 0.0F, 3, 11, 0, 0.0F));
Lantern.mirror = false;
Chain = new ModelRenderer(this);
Chain.setRotationPoint(0.0F, 24.0F, 0.0F);
cube_r1 = new ModelRenderer(this);
cube_r1.setRotationPoint(0.0F, -18.0F, 0.0F);
Chain.addChild(cube_r1);
setRotationAngle(cube_r1, 0.0F, -0.7854F, 0.0F);
cube_r1.cubeList.add(new ModelBox(cube_r1, 0, -1, 0.0F, 2.0F, -1.5F, 0, 5, 3, 0.0F));
cube_r2 = new ModelRenderer(this);
cube_r2.setRotationPoint(0.0F, -18.0F, 0.0F);
Chain.addChild(cube_r2);
setRotationAngle(cube_r2, 0.0F, 0.7854F, 0.0F);
cube_r2.cubeList.add(new ModelBox(cube_r2, 6, -1, 0.0F, 2.0F, -1.5F, 0, 5, 3, 0.0F));
}
@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
Light.render(f5);
Lantern.render(f5);
Chain.render(f5);
}
public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {
modelRenderer.rotateAngleX = x;
modelRenderer.rotateAngleY = y;
modelRenderer.rotateAngleZ = z;
}
}
@@ -0,0 +1,42 @@
package noppes.npcs.client.model.blocks.lantern;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelBox;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
public class LanternFloor extends ModelBase {
public final ModelRenderer Light;
public final ModelRenderer Lantern;
public LanternFloor() {
textureWidth = 64;
textureHeight = 32;
Light = new ModelRenderer(this);
Light.setRotationPoint(0.0F, 24.0F, 0.0F);
Light.cubeList.add(new ModelBox(Light, 28, 8, -3.0F, -9.0F, -3.0F, 6, 7, 6, 0.0F));
Lantern = new ModelRenderer(this);
Lantern.setRotationPoint(0.0F, 24.0F, 0.0F);
Lantern.cubeList.add(new ModelBox(Lantern, 28, 0, -3.0F, -2.0F, -3.0F, 6, 2, 6, 0.0F));
Lantern.cubeList.add(new ModelBox(Lantern, 28, 21, -2.0F, -11.0F, -2.0F, 4, 2, 4, 0.0F));
Lantern.cubeList.add(new ModelBox(Lantern, 46, 21, -5.0F, -11.0F, 0.0F, 3, 11, 0, 0.0F));
Lantern.mirror = true;
Lantern.cubeList.add(new ModelBox(Lantern, 46, 21, 2.0F, -11.0F, 0.0F, 3, 11, 0, 0.0F));
Lantern.mirror = false;
Lantern.cubeList.add(new ModelBox(Lantern, 28, 27, -3.0F, -13.0F, 0.0F, 6, 2, 0, 0.0F));
}
@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
Light.render(f5);
Lantern.render(f5);
}
public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {
modelRenderer.rotateAngleX = x;
modelRenderer.rotateAngleY = y;
modelRenderer.rotateAngleZ = z;
}
}
@@ -0,0 +1,62 @@
package noppes.npcs.client.model.blocks.lantern;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelBox;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
public class LanternWall extends ModelBase {
public final ModelRenderer Light;
public final ModelRenderer Lantern;
public final ModelRenderer Holder;
private final ModelRenderer cube_r1;
private final ModelRenderer cube_r2;
public LanternWall() {
textureWidth = 64;
textureHeight = 32;
Light = new ModelRenderer(this);
Light.setRotationPoint(0.0F, 24.0F, 0.0F);
Light.cubeList.add(new ModelBox(Light, 28, 8, -3.0F, -12.0F, -1.0F, 6, 7, 6, 0.0F));
Lantern = new ModelRenderer(this);
Lantern.setRotationPoint(0.0F, 24.0F, 0.0F);
Lantern.cubeList.add(new ModelBox(Lantern, 28, 0, -3.0F, -5.0F, -1.0F, 6, 2, 6, 0.0F));
Lantern.cubeList.add(new ModelBox(Lantern, 28, 21, -2.0F, -14.0F, 0.0F, 4, 2, 4, 0.0F));
Lantern.cubeList.add(new ModelBox(Lantern, 46, 21, -5.0F, -14.0F, 2.0F, 3, 11, 0, 0.0F));
Lantern.mirror = true;
Lantern.cubeList.add(new ModelBox(Lantern, 46, 21, 2.0F, -14.0F, 2.0F, 3, 11, 0, 0.0F));
Lantern.mirror = false;
Lantern.cubeList.add(new ModelBox(Lantern, 28, 27, -3.0F, -16.0F, 2.0F, 6, 2, 0, 0.0F));
Holder = new ModelRenderer(this);
Holder.setRotationPoint(0.0F, 24.0F, 0.0F);
cube_r1 = new ModelRenderer(this);
cube_r1.setRotationPoint(0.0F, -14.5F, 4.5F);
Holder.addChild(cube_r1);
setRotationAngle(cube_r1, 0.0F, 3.1416F, 0.0F);
cube_r1.cubeList.add(new ModelBox(cube_r1, 12, 0, 0.0F, -1.5F, -2.5F, 0, 3, 5, 0.0F));
cube_r2 = new ModelRenderer(this);
cube_r2.setRotationPoint(0.0F, -14.0F, 6.5F);
Holder.addChild(cube_r2);
setRotationAngle(cube_r2, -1.5708F, 0.0F, 0.0F);
cube_r2.cubeList.add(new ModelBox(cube_r2, 12, 0, -2.0F, -1.5F, -2.0F, 4, 1, 4, 0.0F));
}
@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
Light.render(f5);
Lantern.render(f5);
Holder.render(f5);
}
public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {
modelRenderer.rotateAngleX = x;
modelRenderer.rotateAngleY = y;
modelRenderer.rotateAngleZ = z;
}
}
@@ -1,10 +1,10 @@
package noppes.npcs.client.model.blocks;
package noppes.npcs.client.model.blocks.legacy;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
public class ModelLampCeiling extends ModelBase {
public class ModelLegacyCeiling extends ModelBase {
ModelRenderer Base;
ModelRenderer Top1;
ModelRenderer Top2;
@@ -23,73 +23,73 @@ public class ModelLampCeiling extends ModelBase {
ModelRenderer Shape1;
ModelRenderer Shape2;
public ModelLampCeiling() {
public ModelLegacyCeiling() {
Base = new ModelRenderer(this, 0, 6);
Base.addBox(0F, 0F, 0F, 4, 7, 4);
Base.setRotationPoint(-2F, 17F, -2F);
Top1 = new ModelRenderer(this, 0, 0);
Top1.addBox(0F, 0F, 0F, 5, 1, 5);
Top1.setRotationPoint(-2.5F, 17F, -2.5F);
Top2 = new ModelRenderer(this, 0, 0);
Top2.addBox(0F, 0F, 0F, 4, 1, 4);
Top2.setRotationPoint(-2F, 16.5F, -2F);
Top3 = new ModelRenderer(this, 0, 0);
Top3.addBox(0F, 0F, 0F, 3, 1, 3);
Top3.setRotationPoint(-1.5F, 16F, -1.5F);
Chain8 = new ModelRenderer(this, 0, 0);
Chain8.addBox(0F, 0F, 0F, 1, 2, 1);
Chain8.setRotationPoint(-0.5F, 14F, -1.5F);
Chain1 = new ModelRenderer(this, 0, 0);
Chain1.addBox(0F, 0F, 0F, 1, 3, 1);
Chain1.setRotationPoint(0.5F, 8F, -0.5F);
Chain2 = new ModelRenderer(this, 0, 0);
Chain2.addBox(0F, 0F, 0F, 1, 3, 1);
Chain2.setRotationPoint(-1.5F, 8F, -0.5F);
Chain3 = new ModelRenderer(this, 0, 0);
Chain3.addBox(0F, 0F, 0F, 1, 3, 1);
Chain3.setRotationPoint(-0.5F, 10F, 0.5F);
Chain4 = new ModelRenderer(this, 0, 0);
Chain4.addBox(0F, 0F, 0F, 1, 3, 1);
Chain4.setRotationPoint(-0.5F, 10F, -1.5F);
Chain5 = new ModelRenderer(this, 0, 0);
Chain5.addBox(0F, 0F, 0F, 1, 3, 1);
Chain5.setRotationPoint(-1.5F, 12F, -0.5F);
Chain6 = new ModelRenderer(this, 0, 0);
Chain6.addBox(0F, 0F, 0F, 1, 3, 1);
Chain6.setRotationPoint(0.5F, 12F, -0.5F);
Chain7 = new ModelRenderer(this, 0, 0);
Chain7.addBox(0F, 0F, 0F, 1, 2, 1);
Chain7.setRotationPoint(-0.5F, 14F, 0.5F);
TippyTop1 = new ModelRenderer(this, 0, 0);
TippyTop1.addBox(0F, 0F, 0F, 4, 1, 4);
TippyTop1.setRotationPoint(-2.8F, 8F, 0F);
setRotation(TippyTop1, 0F, 0.7853982F, 0F);
TippyTop2 = new ModelRenderer(this, 0, 0);
TippyTop2.addBox(0F, 0F, 0F, 3, 1, 3);
TippyTop2.setRotationPoint(-2.1F, 8.5F, 0F);
setRotation(TippyTop2, 0F, 0.7853982F, 0F);
Shape3 = new ModelRenderer(this, 0, 0);
Shape3.addBox(0F, 0F, 0F, 1, 1, 1);
Shape3.setRotationPoint(-0.5F, 14F, -0.5F);
Shape1 = new ModelRenderer(this, 0, 0);
Shape1.addBox(0F, 0F, 0F, 1, 1, 1);
Shape1.setRotationPoint(-0.5F, 10F, -0.5F);
Shape2 = new ModelRenderer(this, 0, 0);
Shape2.addBox(0F, 0F, 0F, 1, 1, 1);
Shape2.setRotationPoint(-0.5F, 12F, -0.5F);
@@ -4,13 +4,13 @@
// Keep in mind that you still need to fill in some blanks
// - ZeuX
package noppes.npcs.client.model.blocks;
package noppes.npcs.client.model.blocks.legacy;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
public class ModelLamp extends ModelBase {
public class ModelLegacyLantern extends ModelBase {
ModelRenderer Base;
ModelRenderer Top1;
ModelRenderer Top2;
@@ -18,28 +18,28 @@ public class ModelLamp extends ModelBase {
ModelRenderer Handle;
ModelRenderer Shape1;
public ModelLamp() {
public ModelLegacyLantern() {
Base = new ModelRenderer(this, 0, 6);
Base.addBox(0F, 0F, 0F, 4, 7, 4);
Base.setRotationPoint(-2F, 16F, -2F);
Top1 = new ModelRenderer(this, 0, 0);
Top1.addBox(0F, 0F, 0F, 5, 1, 5);
Top1.setRotationPoint(-2.5F, 16F, -2.5F);
Top2 = new ModelRenderer(this, 0, 0);
Top2.addBox(0F, 0F, 0F, 4, 1, 4);
Top2.setRotationPoint(-2F, 15.5F, -2F);
Top3 = new ModelRenderer(this, 0, 0);
Top3.addBox(0F, 0F, 0F, 3, 1, 3);
Top3.setRotationPoint(-1.5F, 15F, -1.5F);
Handle = new ModelRenderer(this, 24, 0);
Handle.addBox(0F, 0F, 0F, 3, 0, 3);
Handle.setRotationPoint(0F, 15F, 0F);
setRotation(Handle, 0.296706F, 0.1745329F, 0F);
Shape1 = new ModelRenderer(this, 0, 17);
Shape1.addBox(-2F, 0F, -2F, 4, 1, 4);
Shape1.setRotationPoint(0F, 23F, 0F);
@@ -1,10 +1,10 @@
package noppes.npcs.client.model.blocks;
package noppes.npcs.client.model.blocks.legacy;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
public class ModelLampWall extends ModelBase {
public class ModelLegacyWall extends ModelBase {
ModelRenderer Base;
ModelRenderer Top1;
ModelRenderer Top2;
@@ -14,36 +14,36 @@ public class ModelLampWall extends ModelBase {
ModelRenderer Shape4;
ModelRenderer Shape5;
public ModelLampWall() {
public ModelLegacyWall() {
Base = new ModelRenderer(this, 0, 6);
Base.addBox(0F, 0F, 0F, 4, 7, 4);
Base.setRotationPoint(-2F, 14F, 1F);
Top1 = new ModelRenderer(this, 0, 0);
Top1.addBox(0F, 0F, 0F, 5, 1, 5);
Top1.setRotationPoint(-2.5F, 14F, 0.5F);
Top2 = new ModelRenderer(this, 0, 0);
Top2.addBox(0F, 0F, 0F, 4, 1, 4);
Top2.setRotationPoint(-2F, 13.5F, 1F);
Top3 = new ModelRenderer(this, 0, 0);
Top3.addBox(0F, 0F, 0F, 3, 1, 3);
Top3.setRotationPoint(-1.5F, 13F, 1.5F);
Shape2 = new ModelRenderer(this, 0, 0);
Shape2.addBox(0F, 0F, 0F, 1, 1, 3);
Shape2.setRotationPoint(-0.5F, 11F, 3.5F);
Shape3 = new ModelRenderer(this, 0, 0);
Shape3.addBox(0F, 0F, 0F, 3, 3, 1);
Shape3.setRotationPoint(0F, 9.5F, 6.5F);
setRotation(Shape3, 0F, 0F, 0.7853982F);
Shape4 = new ModelRenderer(this, 0, 0);
Shape4.addBox(0F, 0F, 0F, 1, 3, 1);
Shape4.setRotationPoint(-0.5F, 10.5F, 2.5F);
Shape5 = new ModelRenderer(this, 0, 0);
Shape5.addBox(0F, 0F, 0F, 4, 4, 1);
Shape5.setRotationPoint(0F, 8.7F, 7F);
@@ -1,91 +0,0 @@
package noppes.npcs.client.renderer.blocks;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.IBlockAccess;
import noppes.npcs.CustomItems;
import noppes.npcs.blocks.BlockLamp;
import noppes.npcs.blocks.tiles.TileLamp;
import noppes.npcs.client.model.blocks.ModelLamp;
import noppes.npcs.client.model.blocks.ModelLampCeiling;
import noppes.npcs.client.model.blocks.ModelLampWall;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
public class BlockLampRenderer extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler{
private final ModelLamp model = new ModelLamp();
private final ModelLampCeiling model2 = new ModelLampCeiling();
private final ModelLampWall model3 = new ModelLampWall();
private static final ResourceLocation resource1 = new ResourceLocation("customnpcs","textures/models/Lamp.png");
public BlockLampRenderer(){
((BlockLamp)CustomItems.lamp).renderId = RenderingRegistry.getNextAvailableRenderId();
((BlockLamp)CustomItems.lamp_unlit).renderId = ((BlockLamp)CustomItems.lamp).renderId;
RenderingRegistry.registerBlockHandler(this);
}
@Override
public void renderTileEntityAt(TileEntity var1, double var2, double var4,
double var6, float var8) {
TileLamp tile = (TileLamp) var1;
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPushMatrix();
GL11.glTranslatef((float)var2 + 0.5f, (float)var4 + 1.5f, (float)var6 + 0.5f);
//GL11.glScalef(0.95f, 0.95f, 0.95f);
GL11.glRotatef(180, 0, 0, 1);
GL11.glRotatef(45 * tile.rotation, 0, 1, 0);
GL11.glColor3f(1, 1, 1);
Minecraft.getMinecraft().getTextureManager().bindTexture(resource1);
if(tile.color == 0)
model.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
else if(tile.color == 1)
model2.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
else
model3.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
GL11.glPopMatrix();
}
@Override
public void renderInventoryBlock(Block block, int metadata, int modelId,
RenderBlocks renderer) {
GL11.glPushMatrix();
GL11.glTranslatef(0, 2.2f, 0);
GL11.glScalef(2f, 2f, 2f);
GL11.glRotatef(180, 0, 0, 1);
GL11.glRotatef(180, 0, 1, 0);
Minecraft.getMinecraft().getTextureManager().bindTexture(resource1);
GL11.glColor3f(1, 1, 1);
model.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
GL11.glPopMatrix();
}
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z,
Block block, int modelId, RenderBlocks renderer) {
return false;
}
@Override
public boolean shouldRender3DInInventory(int modelId) {
return true;
}
@Override
public int getRenderId() {
return CustomItems.lamp.getRenderType();
}
}
@@ -0,0 +1,131 @@
package noppes.npcs.client.renderer.blocks;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.IBlockAccess;
import noppes.npcs.CustomItems;
import noppes.npcs.blocks.BlockLantern;
import noppes.npcs.blocks.tiles.TileLamp;
import noppes.npcs.client.model.blocks.lantern.LanternCeiling;
import noppes.npcs.client.model.blocks.lantern.LanternFloor;
import noppes.npcs.client.model.blocks.lantern.LanternWall;
import noppes.npcs.client.model.blocks.legacy.ModelLegacyLantern;
import noppes.npcs.client.model.blocks.legacy.ModelLegacyCeiling;
import noppes.npcs.client.model.blocks.legacy.ModelLegacyWall;
import noppes.npcs.config.ConfigClient;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
public class BlockLanternRenderer extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler{
private final ModelLegacyLantern modelLegacyLantern = new ModelLegacyLantern();
private final ModelLegacyCeiling modelLegacyCeiling = new ModelLegacyCeiling();
private final ModelLegacyWall modelLegacyWall = new ModelLegacyWall();
private static final ResourceLocation legacyTexture = new ResourceLocation("customnpcs","textures/models/legacy/Lamp.png");
private final LanternFloor modelLantern = new LanternFloor();
private final LanternWall modelLanternWall = new LanternWall();
private final LanternCeiling modelLanternCeiling = new LanternCeiling();
private static final ResourceLocation texture = new ResourceLocation("customnpcs","textures/models/lantern.png");
public BlockLanternRenderer(){
((BlockLantern)CustomItems.lantern).renderId = RenderingRegistry.getNextAvailableRenderId();
((BlockLantern)CustomItems.lantern_unlit).renderId = ((BlockLantern)CustomItems.lantern).renderId;
RenderingRegistry.registerBlockHandler(this);
}
@Override
public void renderTileEntityAt(TileEntity var1, double var2, double var4,
double var6, float var8) {
TileLamp tile = (TileLamp) var1;
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPushMatrix();
GL11.glTranslatef((float)var2 + 0.5f, (float)var4 + 1.5f, (float)var6 + 0.5f);
GL11.glRotatef(180, 0, 0, 1);
GL11.glColor3f(1, 1, 1);
GL11.glEnable(GL11.GL_ALPHA_TEST);
if(ConfigClient.LegacyLantern){
GL11.glRotatef(45 * tile.rotation, 0, 1, 0);
Minecraft.getMinecraft().getTextureManager().bindTexture(legacyTexture);
if(tile.color == 0)
modelLegacyLantern.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
else if(tile.color == 1)
modelLegacyCeiling.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
else
modelLegacyWall.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
} else {
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
if(tile.color == 0){
GL11.glRotatef(45 * tile.rotation, 0, 1, 0);
modelLantern.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
}
else if(tile.color == 1){
GL11.glRotatef(90, 0, 1, 0);
modelLanternCeiling.Chain.render(0.0625F);
GL11.glRotatef(45 * tile.rotation, 0, 1, 0);
modelLanternCeiling.Lantern.render(0.0625F);
modelLanternCeiling.Light.render(0.0625F);
}
else {
GL11.glRotatef(45 * tile.rotation, 0, 1, 0);
GL11.glTranslatef(0, 0.3f, 0);
modelLanternWall.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
}
}
GL11.glDisable(GL11.GL_ALPHA_TEST);
GL11.glPopMatrix();
}
@Override
public void renderInventoryBlock(Block block, int metadata, int modelId,
RenderBlocks renderer) {
GL11.glPushMatrix();
GL11.glTranslatef(0, 2.2f, 0);
GL11.glScalef(2f, 2f, 2f);
GL11.glRotatef(180, 0, 0, 1);
GL11.glRotatef(180, 0, 1, 0);
if(ConfigClient.LegacyLantern){
Minecraft.getMinecraft().getTextureManager().bindTexture(legacyTexture);
GL11.glColor3f(1, 1, 1);
modelLegacyLantern.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
}
else {
GL11.glScalef(0.7f, 0.7f, 0.7f);
GL11.glTranslatef(0, 0.4f, 0);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
GL11.glColor3f(1, 1, 1);
modelLantern.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
}
GL11.glPopMatrix();
}
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z,
Block block, int modelId, RenderBlocks renderer) {
return false;
}
@Override
public boolean shouldRender3DInInventory(int modelId) {
return true;
}
@Override
public int getRenderId() {
return CustomItems.lantern.getRenderType();
}
}