Enable lighting when rendering models. Everything looks a lot better!

This commit is contained in:
ganymedes01 2014-11-13 20:03:45 -02:00
parent 6c4c579e89
commit de813e808a
19 changed files with 36 additions and 155 deletions

View file

@ -47,7 +47,6 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
{ {
TEAlchemicCalcinator tileAltar = (TEAlchemicCalcinator) tileEntity; TEAlchemicCalcinator tileAltar = (TEAlchemicCalcinator) tileEntity;
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/AlchemicalCalcinator.png"); ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/AlchemicalCalcinator.png");
@ -57,7 +56,6 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPushMatrix(); GL11.glPushMatrix();
@ -129,8 +127,6 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
this.renderTankContents(d0, d1, d2, reagent.getColourRed(), reagent.getColourGreen(), reagent.getColourBlue(), 200 * reagentStack.amount / capacity); this.renderTankContents(d0, d1, d2, reagent.getColourRed(), reagent.getColourGreen(), reagent.getColourBlue(), 200 * reagentStack.amount / capacity);
} }
} }
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_LIGHTING);
} }
} }

View file

@ -19,8 +19,6 @@ public class RenderConduit extends TileEntitySpecialRenderer
if (tileEntity instanceof TEConduit) if (tileEntity instanceof TEConduit)
{ {
TEConduit tileConduit = (TEConduit) tileEntity; TEConduit tileConduit = (TEConduit) tileEntity;
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/Conduit.png"); ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/Conduit.png");
@ -30,8 +28,6 @@ public class RenderConduit extends TileEntitySpecialRenderer
this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileConduit.getInputDirection(), tileConduit.getOutputDirection()); this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileConduit.getInputDirection(), tileConduit.getOutputDirection());
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_LIGHTING);
} }
} }
} }

View file

@ -28,7 +28,6 @@ public class RenderCrystalBelljar extends TileEntitySpecialRenderer
if (tileEntity instanceof TEBellJar) if (tileEntity instanceof TEBellJar)
{ {
TEBellJar tileAltar = (TEBellJar) tileEntity; TEBellJar tileAltar = (TEBellJar) tileEntity;
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/CrystalBelljar.png"); ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/CrystalBelljar.png");
@ -38,8 +37,6 @@ public class RenderCrystalBelljar extends TileEntitySpecialRenderer
this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glEnable(GL11.GL_LIGHTING);
ReagentContainerInfo[] info = tileAltar.getContainerInfo(ForgeDirection.UNKNOWN); ReagentContainerInfo[] info = tileAltar.getContainerInfo(ForgeDirection.UNKNOWN);
if (info.length >= 1 && info[0] != null) if (info.length >= 1 && info[0] != null)
@ -52,8 +49,6 @@ public class RenderCrystalBelljar extends TileEntitySpecialRenderer
this.renderTankContents(d0, d1, d2, reagent.getColourRed(), reagent.getColourGreen(), reagent.getColourBlue(), 200 * reagentStack.amount / capacity); this.renderTankContents(d0, d1, d2, reagent.getColourRed(), reagent.getColourGreen(), reagent.getColourBlue(), 200 * reagentStack.amount / capacity);
} }
} }
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_LIGHTING);
} }
} }

View file

@ -39,7 +39,6 @@ public class RenderPedestal extends TileEntitySpecialRenderer
if (tileEntity instanceof TEPedestal) if (tileEntity instanceof TEPedestal)
{ {
TEPedestal tileAltar = (TEPedestal) tileEntity; TEPedestal tileAltar = (TEPedestal) tileEntity;
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/Pedestal.png"); ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/Pedestal.png");
@ -73,24 +72,16 @@ public class RenderPedestal extends TileEntitySpecialRenderer
} }
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
} }

View file

@ -39,7 +39,6 @@ public class RenderPlinth extends TileEntitySpecialRenderer
if (tileEntity instanceof TEPlinth) if (tileEntity instanceof TEPlinth)
{ {
TEPlinth tileAltar = (TEPlinth) tileEntity; TEPlinth tileAltar = (TEPlinth) tileEntity;
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/Plinth.png"); ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/Plinth.png");
@ -77,8 +76,6 @@ public class RenderPlinth extends TileEntitySpecialRenderer
} }
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_LIGHTING);
} }
} }

View file

@ -19,7 +19,6 @@ public class RenderSpellEffectBlock extends TileEntitySpecialRenderer
if (tileEntity instanceof TESpellEffectBlock) if (tileEntity instanceof TESpellEffectBlock)
{ {
TESpellEffectBlock tileSpellBlock = (TESpellEffectBlock) tileEntity; TESpellEffectBlock tileSpellBlock = (TESpellEffectBlock) tileEntity;
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/BlockSpellEffect.png"); ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/BlockSpellEffect.png");
@ -33,8 +32,6 @@ public class RenderSpellEffectBlock extends TileEntitySpecialRenderer
this.modelSpellEffectBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileSpellBlock.getInputDirection(), tileSpellBlock.getOutputDirection()); this.modelSpellEffectBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileSpellBlock.getInputDirection(), tileSpellBlock.getOutputDirection());
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_LIGHTING);
} }
} }
} }

View file

@ -19,7 +19,6 @@ public class RenderSpellEnhancementBlock extends TileEntitySpecialRenderer
if (tileEntity instanceof TESpellEnhancementBlock) if (tileEntity instanceof TESpellEnhancementBlock)
{ {
TESpellEnhancementBlock tileSpellBlock = (TESpellEnhancementBlock) tileEntity; TESpellEnhancementBlock tileSpellBlock = (TESpellEnhancementBlock) tileEntity;
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/BlockSpellEnhancementPower1.png"); ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/BlockSpellEnhancementPower1.png");
@ -33,8 +32,6 @@ public class RenderSpellEnhancementBlock extends TileEntitySpecialRenderer
this.modelSpellEnhancementBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileSpellBlock.getInputDirection(), tileSpellBlock.getOutputDirection()); this.modelSpellEnhancementBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileSpellBlock.getInputDirection(), tileSpellBlock.getOutputDirection());
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_LIGHTING);
} }
} }
} }

View file

@ -19,7 +19,6 @@ public class RenderSpellModifierBlock extends TileEntitySpecialRenderer
if (tileEntity instanceof TESpellModifierBlock) if (tileEntity instanceof TESpellModifierBlock)
{ {
TESpellModifierBlock tileSpellBlock = (TESpellModifierBlock) tileEntity; TESpellModifierBlock tileSpellBlock = (TESpellModifierBlock) tileEntity;
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/BlockSpellModifier.png"); ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/BlockSpellModifier.png");
@ -33,8 +32,6 @@ public class RenderSpellModifierBlock extends TileEntitySpecialRenderer
this.modelSpellModifierBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileSpellBlock.getInputDirection(), tileSpellBlock.getOutputDirection()); this.modelSpellModifierBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileSpellBlock.getInputDirection(), tileSpellBlock.getOutputDirection());
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_LIGHTING);
} }
} }
} }

View file

@ -19,7 +19,6 @@ public class RenderSpellParadigmBlock extends TileEntitySpecialRenderer
if (tileEntity instanceof TESpellParadigmBlock) if (tileEntity instanceof TESpellParadigmBlock)
{ {
TESpellParadigmBlock tileSpellBlock = (TESpellParadigmBlock) tileEntity; TESpellParadigmBlock tileSpellBlock = (TESpellParadigmBlock) tileEntity;
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/BlockSpellParadigm.png"); ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/BlockSpellParadigm.png");
@ -33,8 +32,6 @@ public class RenderSpellParadigmBlock extends TileEntitySpecialRenderer
this.modelSpellParadigmBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileSpellBlock.getInputDirection(), tileSpellBlock.getOutputDirection()); this.modelSpellParadigmBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileSpellBlock.getInputDirection(), tileSpellBlock.getOutputDirection());
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_LIGHTING);
} }
} }
} }

View file

@ -53,7 +53,7 @@ public class RenderWritingTable extends TileEntitySpecialRenderer
for (int i = 1; i <= 6; i++) for (int i = 1; i <= 6; i++)
{ {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glEnable(GL11.GL_LIGHTING);
if (tileAltar.getStackInSlot(i) != null) if (tileAltar.getStackInSlot(i) != null)
{ {
float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(i)); float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(i));
@ -79,9 +79,6 @@ public class RenderWritingTable extends TileEntitySpecialRenderer
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_LIGHTING);
} }
} }

View file

@ -39,7 +39,6 @@ public class TEAltarRenderer extends TileEntitySpecialRenderer
if (tileEntity instanceof TEAltar) if (tileEntity instanceof TEAltar)
{ {
TEAltar tileAltar = (TEAltar) tileEntity; TEAltar tileAltar = (TEAltar) tileEntity;
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glPushMatrix(); GL11.glPushMatrix();
if (tileAltar.getStackInSlot(0) != null) if (tileAltar.getStackInSlot(0) != null)
@ -64,8 +63,6 @@ public class TEAltarRenderer extends TileEntitySpecialRenderer
} }
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_LIGHTING);
} }
} }

View file

@ -1,28 +1,22 @@
package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; package WayofTime.alchemicalWizardry.common.renderer.block.itemRender;
import WayofTime.alchemicalWizardry.ModBlocks;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelAlchemicalCalcinator;
import cpw.mods.fml.client.FMLClientHandler;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelAlchemicalCalcinator;
import cpw.mods.fml.client.FMLClientHandler;
public class TEAlchemicalCalcinatorItemRenderer implements IItemRenderer public class TEAlchemicalCalcinatorItemRenderer implements IItemRenderer
{ {
private ModelAlchemicalCalcinator modelConduit = new ModelAlchemicalCalcinator(); private ModelAlchemicalCalcinator modelConduit = new ModelAlchemicalCalcinator();
private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
{ {
Tessellator tessellator = Tessellator.instance;
Block block = ModBlocks.blockAlchemicCalcinator;
GL11.glEnable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F); GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F);
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/AlchemicalCalcinator.png"); ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/AlchemicalCalcinator.png");
@ -32,9 +26,6 @@ public class TEAlchemicalCalcinatorItemRenderer implements IItemRenderer
this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_BLEND);
} }

View file

@ -55,8 +55,6 @@ public class TEAltarItemRenderer implements IItemRenderer
private void renderBloodAltar(RenderBlocks render, ItemStack item, float x, float y, float z, float scale) private void renderBloodAltar(RenderBlocks render, ItemStack item, float x, float y, float z, float scale)
{ {
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef(x, y, z); GL11.glTranslatef(x, y, z);
GL11.glScalef(scale, scale, scale); GL11.glScalef(scale, scale, scale);
@ -65,8 +63,5 @@ public class TEAltarItemRenderer implements IItemRenderer
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
modelBloodAltar.renderBloodAltar(); modelBloodAltar.renderBloodAltar();
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_LIGHTING);
} }
} }

View file

@ -1,20 +1,21 @@
package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; package WayofTime.alchemicalWizardry.common.renderer.block.itemRender;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelCrystalBelljar; import WayofTime.alchemicalWizardry.common.renderer.model.ModelCrystalBelljar;
import WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar; import WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar;
import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.client.FMLClientHandler;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
public class TEBellJarItemRenderer implements IItemRenderer public class TEBellJarItemRenderer implements IItemRenderer
{ {
@ -25,12 +26,6 @@ public class TEBellJarItemRenderer implements IItemRenderer
private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
{ {
GL11.glDepthMask(false);
Tessellator tessellator = Tessellator.instance;
GL11.glEnable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F); GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(mainResource); FMLClientHandler.instance().getClient().renderEngine.bindTexture(mainResource);
@ -39,9 +34,6 @@ public class TEBellJarItemRenderer implements IItemRenderer
this.modelConduit.renderSpecialItem((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, 0); this.modelConduit.renderSpecialItem((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, 0);
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDepthMask(true);
ReagentContainerInfo[] info = TEBellJar.getContainerInfoFromItem(item); ReagentContainerInfo[] info = TEBellJar.getContainerInfoFromItem(item);
if (info.length >= 1 && info[0] != null) if (info.length >= 1 && info[0] != null)
@ -54,9 +46,7 @@ public class TEBellJarItemRenderer implements IItemRenderer
this.renderTankContents(translateX, translateY, translateZ, reagent.getColourRed(), reagent.getColourGreen(), reagent.getColourBlue(), 200 * reagentStack.amount / capacity); this.renderTankContents(translateX, translateY, translateZ, reagent.getColourRed(), reagent.getColourGreen(), reagent.getColourBlue(), 200 * reagentStack.amount / capacity);
} }
} }
GL11.glDepthMask(false);
GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
@ -72,13 +62,11 @@ public class TEBellJarItemRenderer implements IItemRenderer
GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_BLEND);
GL11.glDepthMask(true);
} }
private void renderTankContents(double x, double y, double z, int colourRed, int colourGreen, int colourBlue, int colourIntensity) private void renderTankContents(double x, double y, double z, int colourRed, int colourGreen, int colourBlue, int colourIntensity)
{ {
GL11.glPushMatrix(); GL11.glPushMatrix();
float f1 = 1.0f;
Tessellator tessellator = Tessellator.instance; Tessellator tessellator = Tessellator.instance;
FMLClientHandler.instance().getClient().renderEngine.bindTexture(resourceLocation); FMLClientHandler.instance().getClient().renderEngine.bindTexture(resourceLocation);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F);
@ -86,8 +74,6 @@ public class TEBellJarItemRenderer implements IItemRenderer
GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_TEXTURE_2D);
float f2 = 0;
float f3 = -f2 * 0.2F - (float) MathHelper.floor_float(-f2 * 0.1F);
GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

View file

@ -1,28 +1,23 @@
package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; package WayofTime.alchemicalWizardry.common.renderer.block.itemRender;
import WayofTime.alchemicalWizardry.ModBlocks;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelConduit;
import cpw.mods.fml.client.FMLClientHandler;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelConduit;
import cpw.mods.fml.client.FMLClientHandler;
public class TEConduitItemRenderer implements IItemRenderer public class TEConduitItemRenderer implements IItemRenderer
{ {
private ModelConduit modelConduit = new ModelConduit(); private ModelConduit modelConduit = new ModelConduit();
private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
{ {
Tessellator tessellator = Tessellator.instance;
Block block = ModBlocks.blockConduit;
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F); GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F);
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/Conduit.png"); ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/Conduit.png");
@ -32,8 +27,6 @@ public class TEConduitItemRenderer implements IItemRenderer
this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.DOWN, ForgeDirection.UP); this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.DOWN, ForgeDirection.UP);
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_LIGHTING);
} }

View file

@ -1,28 +1,23 @@
package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; package WayofTime.alchemicalWizardry.common.renderer.block.itemRender;
import WayofTime.alchemicalWizardry.ModBlocks;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellEffectBlock;
import cpw.mods.fml.client.FMLClientHandler;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellEffectBlock;
import cpw.mods.fml.client.FMLClientHandler;
public class TESpellEffectBlockItemRenderer implements IItemRenderer public class TESpellEffectBlockItemRenderer implements IItemRenderer
{ {
private ModelSpellEffectBlock modelSpellBlock = new ModelSpellEffectBlock(); private ModelSpellEffectBlock modelSpellBlock = new ModelSpellEffectBlock();
private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
{ {
Tessellator tessellator = Tessellator.instance;
Block block = ModBlocks.blockSpellEffect;
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F); GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F);
ResourceLocation test = new ResourceLocation(this.getResourceLocationForMeta(item.getItemDamage())); ResourceLocation test = new ResourceLocation(this.getResourceLocationForMeta(item.getItemDamage()));
@ -33,8 +28,6 @@ public class TESpellEffectBlockItemRenderer implements IItemRenderer
this.modelSpellBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.DOWN, ForgeDirection.UP); this.modelSpellBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.DOWN, ForgeDirection.UP);
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_LIGHTING);
} }

View file

@ -1,28 +1,23 @@
package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; package WayofTime.alchemicalWizardry.common.renderer.block.itemRender;
import WayofTime.alchemicalWizardry.ModBlocks;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellEnhancementBlock;
import cpw.mods.fml.client.FMLClientHandler;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellEnhancementBlock;
import cpw.mods.fml.client.FMLClientHandler;
public class TESpellEnhancementBlockItemRenderer implements IItemRenderer public class TESpellEnhancementBlockItemRenderer implements IItemRenderer
{ {
private ModelSpellEnhancementBlock modelSpellBlock = new ModelSpellEnhancementBlock(); private ModelSpellEnhancementBlock modelSpellBlock = new ModelSpellEnhancementBlock();
private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
{ {
Tessellator tessellator = Tessellator.instance;
Block block = ModBlocks.blockSpellEffect;
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F); GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F);
ResourceLocation test = new ResourceLocation(this.getResourceLocationForMeta(item.getItemDamage())); ResourceLocation test = new ResourceLocation(this.getResourceLocationForMeta(item.getItemDamage()));
@ -31,11 +26,8 @@ public class TESpellEnhancementBlockItemRenderer implements IItemRenderer
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
this.modelSpellBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.DOWN, ForgeDirection.UP); this.modelSpellBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.DOWN, ForgeDirection.UP);
//Tell it to stop rendering for both the PushMatrix's
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_LIGHTING);
} }

View file

@ -1,33 +1,23 @@
package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; package WayofTime.alchemicalWizardry.common.renderer.block.itemRender;
import WayofTime.alchemicalWizardry.ModBlocks;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellModifierBlock;
import cpw.mods.fml.client.FMLClientHandler;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellModifierBlock;
import cpw.mods.fml.client.FMLClientHandler;
public class TESpellModifierBlockItemRenderer implements IItemRenderer public class TESpellModifierBlockItemRenderer implements IItemRenderer
{ {
private ModelSpellModifierBlock modelSpellBlock = new ModelSpellModifierBlock(); private ModelSpellModifierBlock modelSpellBlock = new ModelSpellModifierBlock();
private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
{ {
Tessellator tessellator = Tessellator.instance;
Block block = ModBlocks.blockSpellEffect;
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
/**
* Render the ghost item inside of the Altar, slowly spinning
*/
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F); GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F);
ResourceLocation test = new ResourceLocation(this.getResourceLocationForMeta(item.getItemDamage())); ResourceLocation test = new ResourceLocation(this.getResourceLocationForMeta(item.getItemDamage()));
@ -36,11 +26,8 @@ public class TESpellModifierBlockItemRenderer implements IItemRenderer
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
this.modelSpellBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.DOWN, ForgeDirection.UP); this.modelSpellBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.DOWN, ForgeDirection.UP);
//Tell it to stop rendering for both the PushMatrix's
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_LIGHTING);
} }

View file

@ -1,45 +1,32 @@
package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; package WayofTime.alchemicalWizardry.common.renderer.block.itemRender;
import WayofTime.alchemicalWizardry.ModBlocks;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellParadigmBlock;
import cpw.mods.fml.client.FMLClientHandler;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellParadigmBlock;
import cpw.mods.fml.client.FMLClientHandler;
public class TESpellParadigmBlockItemRenderer implements IItemRenderer public class TESpellParadigmBlockItemRenderer implements IItemRenderer
{ {
private ModelSpellParadigmBlock modelSpellBlock = new ModelSpellParadigmBlock(); private ModelSpellParadigmBlock modelSpellBlock = new ModelSpellParadigmBlock();
private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
{ {
Tessellator tessellator = Tessellator.instance;
Block block = ModBlocks.blockSpellEffect;
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
/**
* Render the ghost item inside of the Altar, slowly spinning
*/
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F); GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F);
ResourceLocation test = new ResourceLocation(this.getResourceLocationForMeta(item.getItemDamage())); ResourceLocation test = new ResourceLocation(this.getResourceLocationForMeta(item.getItemDamage()));
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
//A reference to your Model file. Again, very important.
this.modelSpellBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.DOWN, ForgeDirection.UP); this.modelSpellBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.DOWN, ForgeDirection.UP);
//Tell it to stop rendering for both the PushMatrix's
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_LIGHTING);
} }