Cleanup and texture improvments

This commit is contained in:
John Yorke committed 2017-07-22 00:31:39 -03:00
1 parent cc77874e71
commit 11221eac84
28 files changed
+211 -118

No files matched your search

@@ -1,6 +1,7 @@
package taintedmagic.client;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient;
@@ -18,6 +19,7 @@ import taintedmagic.common.entities.EntityGlowpet;
import taintedmagic.common.entities.EntityHomingShard;
import taintedmagic.common.entities.EntityTaintBubble;
import taintedmagic.common.helper.TaintedMagicHelper;
import taintedmagic.common.items.tools.ItemKatana;
import taintedmagic.common.registry.ItemRegistry;
import thaumcraft.client.fx.ParticleEngine;
import thaumcraft.client.fx.particles.FXWisp;
@@ -48,6 +50,12 @@ public class ClientProxy extends CommonProxy
return Minecraft.getMinecraft().thePlayer;
}
@Override
public WorldClient getClientWorld ()
{
return Minecraft.getMinecraft().theWorld;
}
@Override
public void registerClientHandlers ()
{
@@ -21,8 +21,8 @@ public class RenderEntityDiffusion extends Render
GL11.glTranslated(x, y, z);
float c = 0.1F;
float a = ( (20.0F - (float) e.ticksExisted) / 40.0F);
float color = 0.1F;
float alpha = (20.0F - (float) e.ticksExisted) / 40.0F;
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
@@ -37,7 +37,7 @@ public class RenderEntityDiffusion extends Render
float f7 = 0.5F;
float f8 = 0.5F;
GL11.glColor4f(c, c, c, a);
GL11.glColor4f(color, color, color, alpha);
GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
@@ -48,7 +48,7 @@ public class RenderEntityDiffusion extends Render
t.startDrawingQuads();
t.setNormal(0.0F, 1.0F, 0.0F);
t.setColorRGBA_F(c, c, c, a);
t.setColorRGBA_F(color, color, color, alpha);
t.addVertexWithUV(0.0F - f7, 0.0F - f8, 0.0D, f2, f5);
t.addVertexWithUV(f6 - f7, 0.0F - f8, 0.0D, f3, f5);
@@ -7,6 +7,7 @@ import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import taintedmagic.common.entities.EntityGlowpet;
import thaumcraft.client.fx.ParticleEngine;
@@ -24,9 +25,11 @@ public class RenderEntityGlowpet extends Render
Tessellator t = Tessellator.instance;
GL11.glPushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
bindTexture(ParticleEngine.particleTexture);
@@ -39,17 +42,26 @@ public class RenderEntityGlowpet extends Render
float f7 = 0.5F;
float f8 = 0.5F;
GL11.glColor4f(1.0F, 0.75F, 0.45F, 1.0F);
float red = 1.0F;
float green = 0.75F;
float blue = 0.5F;
float alpha = 1.0F;
GL11.glColor4f(red, green, blue, alpha);
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
GL11.glScalef(0.4F, 0.4F, 0.4F);
float s = 0.4F;
GL11.glScalef(s, s, s);
t.startDrawingQuads();
t.setColorRGBA_F(1.0F, 0.75F, 0.45F, 1.0F);
t.setColorRGBA_F(red, green, blue, alpha);
t.setNormal(0.0F, 1.0F, 0.0F);
t.setBrightness(240);
@@ -62,12 +74,10 @@ public class RenderEntityGlowpet extends Render
GL11.glPopMatrix();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glBlendFunc(770, 771);
GL11.glDisable(3042);
GL11.glDisable(32826);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glDepthMask(true);
GL11.glPopMatrix();
}
@@ -9,6 +9,7 @@ import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import taintedmagic.common.entities.EntityHomingShard;
import thaumcraft.client.fx.ParticleEngine;
@@ -30,9 +31,11 @@ public class RenderEntityHomingShard extends Render
Tessellator t = Tessellator.instance;
GL11.glPushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
bindTexture(ParticleEngine.particleTexture);
@@ -45,17 +48,24 @@ public class RenderEntityHomingShard extends Render
float f7 = 0.5F;
float f8 = 0.5F;
GL11.glColor4f(0.405F, 0.075F, 0.525F, 1.0F);
float red = 0.405F;
float green = 0.075F;
float blue = 0.525F;
float alpha = 1.0F;
GL11.glColor4f(red, green, blue, alpha);
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
GL11.glScalef(0.4F + 0.1F * e.getStrength(), 0.4F + 0.1F * e.getStrength(), 0.4F + 0.1F * e.getStrength());
t.startDrawingQuads();
t.setColorRGBA_F(0.405F, 0.075F, 0.525F, 1.0F);
t.setColorRGBA_F(red, green, blue, alpha);
t.setNormal(0.0F, 1.0F, 0.0F);
t.setBrightness(240);
@@ -68,12 +78,10 @@ public class RenderEntityHomingShard extends Render
GL11.glPopMatrix();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glBlendFunc(770, 771);
GL11.glDisable(3042);
GL11.glDisable(32826);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glDepthMask(true);
GL11.glPopMatrix();
}
@@ -21,28 +21,24 @@ public class RenderEntityTaintBubble extends Render
this.shadowSize = 0.0F;
}
@Override
public void doRender (Entity e, double x, double y, double z, float f, float pt)
public void renderEntityAt (EntityTaintBubble e, double x, double y, double z, float f, float pt)
{
Tessellator t = Tessellator.instance;
EntityTaintBubble bubble = (EntityTaintBubble) e;
float r = 0.8F + e.worldObj.rand.nextFloat() * 0.2F;
float g = e.worldObj.rand.nextFloat() * 0.4F;
float b = 1.0F - e.worldObj.rand.nextFloat() * 0.2F;
float a = (50.0F - (float) e.ticksExisted) / 50.0F;
float alpha = (50.0F - (float) e.ticksExisted) / 50.0F;
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
GL11.glEnable(GL11.GL_BLEND);
GL11.glTranslated(x, y, z);
GL11.glEnable(GL11.GL_BLEND);
GL11.glDepthMask(false);
GL11.glColor4f(r, g, b, a);
GL11.glColor4f(e.red, e.green, e.blue, alpha);
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
int p = 7 + bubble.ticksExisted % 8;
int p = 7 + e.ticksExisted % 8;
float f2 = p / 16.0F;
float f3 = f2 + 0.0624375F;
float f4 = 0.25F;
@@ -52,7 +48,7 @@ public class RenderEntityTaintBubble extends Render
float f7 = 0.5F;
float f8 = 0.5F;
float s = 0.3F;
float s = 0.35F;
GL11.glScalef(s, s, s);
@@ -63,7 +59,7 @@ public class RenderEntityTaintBubble extends Render
t.setBrightness(240);
t.setNormal(0.0F, 1.0F, 0.0F);
t.setColorRGBA_F(r, g, b, a);
t.setColorRGBA_F(e.red, e.green, e.blue, alpha);
t.addVertexWithUV(-f7, -f8, 0.0D, f2, f5);
t.addVertexWithUV(f6 - f7, -f8, 0.0D, f3, f5);
@@ -74,6 +70,7 @@ public class RenderEntityTaintBubble extends Render
GL11.glDepthMask(true);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}
@@ -82,4 +79,10 @@ public class RenderEntityTaintBubble extends Render
{
return null;
}
@Override
public void doRender (Entity e, double x, double y, double z, float f, float pT)
{
renderEntityAt((EntityTaintBubble) e, x, y, z, f, pT);
}
}