mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-28 23:48:50 +00:00
Loads and loads of render work. I can see the light at the end of the tunnel
- Finished CTM - BasicBlock item rendering - Balloon item rendering - Plastic Fence item rendering - Started work on Portable Tank fluid item rendering - Fixed Obsidian TNT and Bin rendering
This commit is contained in:
1 parent
98c57960d1
commit
730ee4e450
41 files changed
+759
-386
No files matched your search
@@ -1,25 +1,23 @@
|
||||
package mekanism.client.render.entity;
|
||||
|
||||
import mekanism.client.model.ModelObsidianTNT;
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.entity.EntityObsidianTNT;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.BlockRendererDispatcher;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderObsidianTNTPrimed extends Render<EntityObsidianTNT>
|
||||
{
|
||||
private ModelObsidianTNT model = new ModelObsidianTNT();
|
||||
|
||||
public RenderObsidianTNTPrimed(RenderManager renderManager)
|
||||
{
|
||||
super(renderManager);
|
||||
@@ -27,36 +25,27 @@ public class RenderObsidianTNTPrimed extends Render<EntityObsidianTNT>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRender(EntityObsidianTNT entityobsidiantnt, double x, double y, double z, float f, float f1)
|
||||
public void doRender(EntityObsidianTNT entityobsidiantnt, double x, double y, double z, float entityYaw, float partialTicks)
|
||||
{
|
||||
BlockRendererDispatcher renderer = Minecraft.getMinecraft().getBlockRendererDispatcher();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)x, (float)y+1.2F, (float)z);
|
||||
GL11.glScalef(0.8F, 0.8F, 0.8F);
|
||||
GL11.glRotatef(180, 1, 0, 0);
|
||||
GL11.glTranslatef((float)x, (float)y+0.5F, (float)z);
|
||||
|
||||
if((entityobsidiantnt.fuse - f1) + 1.0F < 10F)
|
||||
{
|
||||
float scale = 1.0F - ((entityobsidiantnt.fuse - f1) + 1.0F) / 10F;
|
||||
if(entityobsidiantnt.fuse - partialTicks + 1.0F < 10.0F)
|
||||
{
|
||||
float f = 1.0F - (entityobsidiantnt.fuse - partialTicks + 1.0F) / 10.0F;
|
||||
f = MathHelper.clamp_float(f, 0.0F, 1.0F);
|
||||
f = f * f;
|
||||
f = f * f;
|
||||
float f1 = 1.0F + f * 0.3F;
|
||||
GlStateManager.scale(f1, f1, f1);
|
||||
}
|
||||
|
||||
if(scale < 0.0F)
|
||||
{
|
||||
scale = 0.0F;
|
||||
}
|
||||
|
||||
if(scale > 1.0F)
|
||||
{
|
||||
scale = 1.0F;
|
||||
}
|
||||
|
||||
scale *= scale;
|
||||
scale *= scale;
|
||||
float renderScale = 1.0F + scale * 0.3F;
|
||||
GL11.glScalef(renderScale, renderScale, renderScale);
|
||||
}
|
||||
|
||||
float f3 = (1.0F - ((entityobsidiantnt.fuse - f1) + 1.0F) / 100F) * 0.8F;
|
||||
bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "ObsidianTNT.png"));
|
||||
model.render(0.0625F);
|
||||
float f3 = (1.0F - ((entityobsidiantnt.fuse - partialTicks) + 1.0F) / 100F) * 0.8F;
|
||||
bindEntityTexture(entityobsidiantnt);
|
||||
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
|
||||
renderer.renderBlockBrightness(MekanismBlocks.ObsidianTNT.getDefaultState(), entityobsidiantnt.getBrightness(partialTicks));
|
||||
GlStateManager.translate(0.0F, 0.0F, 1.0F);
|
||||
|
||||
if(entityobsidiantnt.fuse / 5 % 2 == 0)
|
||||
{
|
||||
@@ -65,7 +54,11 @@ public class RenderObsidianTNTPrimed extends Render<EntityObsidianTNT>
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, f3);
|
||||
model.render(0.0625F);
|
||||
GlStateManager.doPolygonOffset(-3.0F, -3.0F);
|
||||
GlStateManager.enablePolygonOffset();
|
||||
renderer.renderBlockBrightness(MekanismBlocks.ObsidianTNT.getDefaultState(), 1.0F);
|
||||
GlStateManager.doPolygonOffset(0.0F, 0.0F);
|
||||
GlStateManager.disablePolygonOffset();
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
Reference in new issue
Block a user