diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelBloodAltar.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelBloodAltar.java index a9e72f60..b8a1679f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelBloodAltar.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelBloodAltar.java @@ -1,22 +1,28 @@ package WayofTime.alchemicalWizardry.common.renderer.model; -import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; -import cpw.mods.fml.client.FMLClientHandler; import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.IModelCustom; + import org.lwjgl.opengl.GL11; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import cpw.mods.fml.client.FMLClientHandler; + public class ModelBloodAltar extends ModelBase { + private static final ResourceLocation altar_texture = new ResourceLocation("alchemicalwizardry:textures/models/altar.png"); + private IModelCustom modelBloodAltar; - private IModelCustom modelBloodLevel; //TODO public ModelBloodAltar() { modelBloodAltar = AdvancedModelLoader.loadModel(new ResourceLocation("alchemicalwizardry:models/bloodaltar-fixeUV.obj")); - modelBloodLevel = AdvancedModelLoader.loadModel(new ResourceLocation("alchemicalwizardry:models/bloodlevel.obj")); } public void renderBloodAltar() @@ -24,11 +30,6 @@ public class ModelBloodAltar extends ModelBase modelBloodAltar.renderAll(); } - public void renderBloodLevel() - { - modelBloodLevel.renderAll(); - } - public void renderBloodAltar(TEAltar altar, double x, double y, double z) { float scale = 0.1f; @@ -39,9 +40,7 @@ public class ModelBloodAltar extends ModelBase // Scale our object to about half-size in all directions (the OBJ file is a little large) GL11.glScalef(scale, scale, scale); // Bind the texture, so that OpenGL properly textures our block. - ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/altar.png"); - //FMLClientHandler.instance().getClient().renderEngine.bindTexture("/mods/alchemicalwizardry/textures/models/altar.png"); - FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(altar_texture); // Render the object, using modelTutBox.renderAll(); this.renderBloodAltar(); // Pop this matrix from the stack. @@ -50,21 +49,29 @@ public class ModelBloodAltar extends ModelBase public void renderBloodLevel(TEAltar altar, double x, double y, double z) { - float scale = 0.1f; - // Push a blank matrix onto the stack GL11.glPushMatrix(); float level = altar.getFluidAmount(); - // Move the object into the correct position on the block (because the OBJ's origin is the center of the object) - GL11.glTranslatef((float) x + 0.5f, (float) y + 0.6499f + 0.12f * (level / altar.getCapacity()), (float) z + 0.5f); - // Scale our object to about half-size in all directions (the OBJ file is a little large) - GL11.glScalef(scale, scale, scale); - // Bind the texture, so that OpenGL properly textures our block. - ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/blood.png"); - //FMLClientHandler.instance().getClient().renderEngine.bindTexture("/mods/alchemicalwizardry/textures/models/altar.png"); - FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); - // Render the object, using modelTutBox.renderAll(); - this.renderBloodLevel(); - // Pop this matrix from the stack. + GL11.glTranslatef((float) x , (float) y + 0.6499f + 0.12f * (level / altar.getCapacity()), (float) z); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(TextureMap.locationBlocksTexture); + renderBloodLevel(AlchemicalWizardry.lifeEssenceFluid.getStillIcon()); GL11.glPopMatrix(); } -} + + public void renderBloodLevel(IIcon icon) + { + Tessellator tessellator = Tessellator.instance; + + double minU = (double) icon.getInterpolatedU(0); + double maxU = (double) icon.getInterpolatedU(16); + double minV = (double) icon.getInterpolatedV(0); + double maxV = (double) icon.getInterpolatedV(16); + + tessellator.startDrawingQuads(); + tessellator.setNormal(0, 1, 0); + tessellator.addVertexWithUV(1, 0, 1, maxU, maxV); + tessellator.addVertexWithUV(1, 0, 0, maxU, minV); + tessellator.addVertexWithUV(0, 0, 0, minU, minV); + tessellator.addVertexWithUV(0, 0, 1, minU, maxV); + tessellator.draw(); + } +} \ No newline at end of file diff --git a/src/main/resources/assets/alchemicalwizardry/models/bloodlevel.obj b/src/main/resources/assets/alchemicalwizardry/models/bloodlevel.obj deleted file mode 100644 index f301ee48..00000000 --- a/src/main/resources/assets/alchemicalwizardry/models/bloodlevel.obj +++ /dev/null @@ -1,64 +0,0 @@ -# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware -# File Created: 07.08.2013 20:12:01 - -mtllib bloodlevel.mtl - -# -# object headusOBJexport001 -# - -v -1.2846 0.0000 2.0630 -v -1.2890 0.0000 -2.0628 -v -2.0627 0.0000 -1.2993 -v -2.0628 0.0000 1.2848 -v 1.2845 0.0000 2.0630 -v -1.7911 0.0000 3.2857 -v 1.7911 0.0000 3.2857 -v 2.0628 0.0000 1.2848 -v 3.2856 0.0000 1.7912 -v 2.0628 0.0000 -1.2845 -v 3.2856 0.0000 -1.7910 -v 1.2846 0.0000 -2.0627 -v 1.7911 0.0000 -3.2855 -v -1.7907 0.0000 -3.2857 -v -3.2854 0.0000 -1.8107 -v -3.2856 0.0000 1.7912 -# 16 vertices - -vn 0.0000 1.0000 -0.0000 -# 1 vertex normals - -vt 0.3045 0.1861 0.0000 -vt 0.3038 0.8139 0.0000 -vt 0.1861 0.6977 0.0000 -vt 0.1861 0.3045 0.0000 -vt 0.6955 0.1861 0.0000 -vt 0.2274 -0.0000 0.0000 -vt 0.7726 -0.0000 0.0000 -vt 0.8139 0.3045 0.0000 -vt 1.0000 0.2274 0.0000 -vt 0.8139 0.6955 0.0000 -vt 1.0000 0.7725 0.0000 -vt 0.6955 0.8139 0.0000 -vt 0.7726 1.0000 0.0000 -vt 0.2275 1.0000 0.0000 -vt 0.0000 0.7755 0.0000 -vt 0.0000 0.2274 0.0000 -# 16 texture coords - -g headusOBJexport001 -usemtl Material__46 -s 1 -f 1/1/1 2/2/1 3/3/1 4/4/1 -f 5/5/1 1/1/1 6/6/1 7/7/1 -f 8/8/1 5/5/1 7/7/1 9/9/1 -f 10/10/1 8/8/1 9/9/1 11/11/1 -f 12/12/1 10/10/1 11/11/1 13/13/1 -f 2/2/1 12/12/1 13/13/1 14/14/1 -f 3/3/1 2/2/1 14/14/1 15/15/1 -f 4/4/1 3/3/1 15/15/1 16/16/1 -f 1/1/1 4/4/1 16/16/1 6/6/1 -f 12/12/1 5/5/1 8/8/1 10/10/1 -f 5/5/1 12/12/1 2/2/1 1/1/1 -# 11 polygons - diff --git a/src/main/resources/assets/alchemicalwizardry/textures/blocks/lifeEssenceFlowing.png b/src/main/resources/assets/alchemicalwizardry/textures/blocks/lifeEssenceFlowing.png index 05cfdd4e..12241ce0 100644 Binary files a/src/main/resources/assets/alchemicalwizardry/textures/blocks/lifeEssenceFlowing.png and b/src/main/resources/assets/alchemicalwizardry/textures/blocks/lifeEssenceFlowing.png differ diff --git a/src/main/resources/assets/alchemicalwizardry/textures/blocks/lifeEssenceFlowing.png.mcmeta b/src/main/resources/assets/alchemicalwizardry/textures/blocks/lifeEssenceFlowing.png.mcmeta new file mode 100644 index 00000000..8e55e43b --- /dev/null +++ b/src/main/resources/assets/alchemicalwizardry/textures/blocks/lifeEssenceFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 3 + } +} diff --git a/src/main/resources/assets/alchemicalwizardry/textures/blocks/lifeEssenceStill.png b/src/main/resources/assets/alchemicalwizardry/textures/blocks/lifeEssenceStill.png index 270c26a0..a2ceeae8 100644 Binary files a/src/main/resources/assets/alchemicalwizardry/textures/blocks/lifeEssenceStill.png and b/src/main/resources/assets/alchemicalwizardry/textures/blocks/lifeEssenceStill.png differ diff --git a/src/main/resources/assets/alchemicalwizardry/textures/blocks/lifeEssenceStill.png.mcmeta b/src/main/resources/assets/alchemicalwizardry/textures/blocks/lifeEssenceStill.png.mcmeta new file mode 100644 index 00000000..7ceb3639 --- /dev/null +++ b/src/main/resources/assets/alchemicalwizardry/textures/blocks/lifeEssenceStill.png.mcmeta @@ -0,0 +1,45 @@ +{ + "animation": { + "frametime": 2, + "frames": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 18, + 17, + 16, + 15, + 14, + 13, + 12, + 11, + 10, + 9, + 8, + 7, + 6, + 5, + 4, + 3, + 2, + 1 + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/alchemicalwizardry/textures/models/blood.png b/src/main/resources/assets/alchemicalwizardry/textures/models/blood.png deleted file mode 100644 index 05cfdd4e..00000000 Binary files a/src/main/resources/assets/alchemicalwizardry/textures/models/blood.png and /dev/null differ