mirror of
https://github.com/GTNewHorizons/Tainted-Magic.git
synced 2026-11-26 14:53:07 +00:00
Cleanup
This commit is contained in:
1 parent
cbb61ebcbe
commit
82de9e1aa0
74 files changed
+3485
-3415
No files matched your search
@@ -35,18 +35,18 @@ public class ClientHandler
|
||||
@SubscribeEvent
|
||||
public void onPlayerRender (RenderPlayerEvent.Specials.Post event)
|
||||
{
|
||||
EntityPlayer p = event.entityPlayer;
|
||||
if (p.getActivePotionEffect(Potion.invisibility) != null) return;
|
||||
|
||||
ItemStack[] inv = p.inventory.mainInventory;
|
||||
EntityPlayer player = event.entityPlayer;
|
||||
if (player.getActivePotionEffect(Potion.invisibility) != null) return;
|
||||
|
||||
ItemStack[] inv = player.inventory.mainInventory;
|
||||
List<Item> rendering = new ArrayList<Item>();
|
||||
for (int i = 0; i < 36; i++)
|
||||
{
|
||||
ItemStack s = inv[i];
|
||||
if (s != null && s.getItem() instanceof IRenderInventoryItem && !rendering.contains(s.getItem()))
|
||||
ItemStack stack = inv[i];
|
||||
if (stack != null && stack.getItem() instanceof IRenderInventoryItem && !rendering.contains(stack.getItem()))
|
||||
{
|
||||
((IRenderInventoryItem) s.getItem()).render(p, s, event.partialRenderTick);
|
||||
rendering.add(s.getItem());
|
||||
((IRenderInventoryItem) stack.getItem()).render(player, stack, event.partialRenderTick);
|
||||
rendering.add(stack.getItem());
|
||||
}
|
||||
if (i == 36) rendering.clear();
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
|
||||
@@ -22,91 +21,94 @@ import taintedmagic.common.TaintedMagic;
|
||||
@SideOnly (Side.CLIENT)
|
||||
public class HUDHandler
|
||||
{
|
||||
@SubscribeEvent
|
||||
public void renderGameOverlayEvent (RenderGameOverlayEvent.Post event)
|
||||
{
|
||||
if (event.type == ElementType.ALL)
|
||||
{
|
||||
renderHeldItemHUD(event.partialTicks);
|
||||
renderString();
|
||||
}
|
||||
}
|
||||
@SubscribeEvent
|
||||
public void renderGameOverlayEvent (RenderGameOverlayEvent.Post event)
|
||||
{
|
||||
if (event.type == ElementType.ALL)
|
||||
{
|
||||
renderHeldItemHUD(event.partialTicks);
|
||||
renderString();
|
||||
}
|
||||
}
|
||||
|
||||
private static float ticksEquipped = 0.0F;
|
||||
private static ItemStack s = null;
|
||||
private static ItemStack last = null;
|
||||
private static float ticksEquipped = 0.0F;
|
||||
private static ItemStack stack = null;
|
||||
private static ItemStack last = null;
|
||||
|
||||
private void renderHeldItemHUD (float pt)
|
||||
{
|
||||
EntityPlayer p = TaintedMagic.proxy.getClientPlayer();
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
||||
private void renderHeldItemHUD (float partialTicks)
|
||||
{
|
||||
EntityPlayer player = TaintedMagic.proxy.getClientPlayer();
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
||||
|
||||
if (s != null && s.getItem() instanceof IHeldItemHUD) last = s.copy();
|
||||
s = p.getCurrentEquippedItem();
|
||||
if (stack != null && stack.getItem() instanceof IHeldItemHUD) last = stack.copy();
|
||||
stack = player.getCurrentEquippedItem();
|
||||
|
||||
boolean b = false;
|
||||
if (s != null && s.getItem() instanceof IHeldItemHUD) b = true;
|
||||
else b = false;
|
||||
boolean b = false;
|
||||
if (stack != null && stack.getItem() instanceof IHeldItemHUD) b = true;
|
||||
else b = false;
|
||||
|
||||
float time = 30.0F;
|
||||
if (b) ticksEquipped = Math.min(time, ticksEquipped + pt);
|
||||
else ticksEquipped = Math.max(0F, ticksEquipped - pt);
|
||||
float time = 30.0F;
|
||||
if (b) ticksEquipped = Math.min(time, ticksEquipped + partialTicks);
|
||||
else ticksEquipped = Math.max(0F, ticksEquipped - partialTicks);
|
||||
|
||||
float fract = ticksEquipped / time;
|
||||
float fract = ticksEquipped / time;
|
||||
|
||||
if (b) ((IHeldItemHUD) s.getItem()).renderHUD(res, p, s, pt, fract);
|
||||
else if (!b && ticksEquipped != 0) ((IHeldItemHUD) last.getItem()).renderHUD(res, p, last, pt, fract);
|
||||
}
|
||||
if (b) ((IHeldItemHUD) stack.getItem()).renderHUD(res, player, stack, partialTicks, fract);
|
||||
else if (!b && ticksEquipped != 0) ((IHeldItemHUD) last.getItem()).renderHUD(res, player, last, partialTicks, fract);
|
||||
}
|
||||
|
||||
private static String currentStr;
|
||||
private static int start;
|
||||
private static int ticks;
|
||||
private static boolean gay;
|
||||
private static String currentStr;
|
||||
private static int start;
|
||||
private static int ticks;
|
||||
private static boolean gay;
|
||||
|
||||
public static void displayStringRainbow (String str, int display)
|
||||
{
|
||||
}
|
||||
/**
|
||||
* Displays text above the health bar for a specified duration.
|
||||
*
|
||||
* @param str The string to display.
|
||||
* @param duration The duration to display it for (in ticks).
|
||||
* @param rainbow Setting this to true makes things absolutely fabulous.
|
||||
*/
|
||||
public static void displayString (String str, int duration, boolean rainbow)
|
||||
{
|
||||
currentStr = str;
|
||||
ticks = start = duration;
|
||||
gay = rainbow;
|
||||
}
|
||||
|
||||
public static void displayString (String str, int duration, boolean rainbow)
|
||||
{
|
||||
currentStr = str;
|
||||
ticks = start = duration;
|
||||
gay = rainbow;
|
||||
}
|
||||
public static void updateTicks ()
|
||||
{
|
||||
if (ticks > 0) ticks--;
|
||||
}
|
||||
|
||||
public static void updateTicks ()
|
||||
{
|
||||
if (ticks > 0) ticks--;
|
||||
}
|
||||
private void renderString ()
|
||||
{
|
||||
if (ticks > 0 && !MathHelper.stringNullOrLengthZero(currentStr))
|
||||
{
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
||||
int x = res.getScaledWidth();
|
||||
int y = res.getScaledHeight();
|
||||
FontRenderer font = mc.fontRenderer;
|
||||
|
||||
private void renderString ()
|
||||
{
|
||||
if (ticks > 0 && !MathHelper.stringNullOrLengthZero(currentStr))
|
||||
{
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
||||
int x = res.getScaledWidth();
|
||||
int y = res.getScaledHeight();
|
||||
FontRenderer font = mc.fontRenderer;
|
||||
int startX = (x - font.getStringWidth(currentStr)) / 2;
|
||||
int startY = y - 72;
|
||||
|
||||
int startX = (x - font.getStringWidth(currentStr)) / 2;
|
||||
int startY = y - 72;
|
||||
int opacity = ticks > ((float) start * 0.25F) ? 255 : (int) (255F * ((float) ticks / ((float) start * 0.25F)));
|
||||
if (opacity < 5) opacity = 0;
|
||||
|
||||
int opacity = ticks > ((float) start * 0.25F) ? 255 : (int) (255F * ((float) ticks / ((float) start * 0.25F)));
|
||||
if (opacity < 5) opacity = 0;
|
||||
int rgb = Color.HSBtoRGB( ((float) (start - ticks) / (float) start), 1.0F, 1.0F);
|
||||
|
||||
int rgb = Color.HSBtoRGB( ((float) (start - ticks) / (float) start), 1.0F, 1.0F);
|
||||
|
||||
if (opacity > 0)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
font.drawStringWithShadow(currentStr, startX, startY, (gay ? rgb : 0xFFFFFF) + (opacity << 24));
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (opacity > 0)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
font.drawStringWithShadow(currentStr, startX, startY, (gay ? rgb : 0xFFFFFF) + (opacity << 24));
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,46 +4,46 @@ import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
|
||||
/**
|
||||
* katana - wiiv Created using Tabula 4.1.1
|
||||
* Katana model - created by <wiiv> using Tabula 4.1.1
|
||||
*/
|
||||
public class ModelKatana extends ModelBase
|
||||
{
|
||||
public ModelRenderer blade;
|
||||
public ModelRenderer grip1;
|
||||
public ModelRenderer grip2;
|
||||
public ModelRenderer blade;
|
||||
public ModelRenderer grip1;
|
||||
public ModelRenderer grip2;
|
||||
|
||||
public ModelKatana ()
|
||||
{
|
||||
this.textureWidth = 32;
|
||||
this.textureHeight = 64;
|
||||
|
||||
this.grip2 = new ModelRenderer(this, 22, 0);
|
||||
this.grip2.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
this.grip2.addBox(-1.0F, -12.0F, -1.5F, 2, 12, 3, 0.0F);
|
||||
|
||||
this.blade = new ModelRenderer(this, 0, 0);
|
||||
this.blade.setRotationPoint(0.0F, -40.0F, 0.0F);
|
||||
this.blade.addBox(-0.5F, 0.0F, -2.0F, 1, 48, 4, -0.75F);
|
||||
|
||||
this.grip1 = new ModelRenderer(this, 0, 52);
|
||||
this.grip1.setRotationPoint(0.0F, -40.0F, 0.0F);
|
||||
this.grip1.addBox(-2.5F, 0.0F, -3.5F, 5, 1, 7, 0.0F);
|
||||
this.grip1.addChild(this.grip2);
|
||||
}
|
||||
public ModelKatana ()
|
||||
{
|
||||
this.textureWidth = 32;
|
||||
this.textureHeight = 64;
|
||||
|
||||
public void render (float size)
|
||||
{
|
||||
this.blade.render(size);
|
||||
this.grip1.render(size);
|
||||
}
|
||||
this.grip2 = new ModelRenderer(this, 22, 0);
|
||||
this.grip2.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
this.grip2.addBox(-1.0F, -12.0F, -1.5F, 2, 12, 3, 0.0F);
|
||||
|
||||
/**
|
||||
* This is a helper function from Tabula to set the rotation of model parts
|
||||
*/
|
||||
private void setRotation (ModelRenderer m, float x, float y, float z)
|
||||
{
|
||||
m.rotateAngleX = x;
|
||||
m.rotateAngleY = y;
|
||||
m.rotateAngleZ = z;
|
||||
}
|
||||
this.blade = new ModelRenderer(this, 0, 0);
|
||||
this.blade.setRotationPoint(0.0F, -40.0F, 0.0F);
|
||||
this.blade.addBox(-0.5F, 0.0F, -2.0F, 1, 48, 4, -0.75F);
|
||||
|
||||
this.grip1 = new ModelRenderer(this, 0, 52);
|
||||
this.grip1.setRotationPoint(0.0F, -40.0F, 0.0F);
|
||||
this.grip1.addBox(-2.5F, 0.0F, -3.5F, 5, 1, 7, 0.0F);
|
||||
this.grip1.addChild(this.grip2);
|
||||
}
|
||||
|
||||
public void render (float size)
|
||||
{
|
||||
this.blade.render(size);
|
||||
this.grip1.render(size);
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a helper function from Tabula to set the rotation of model parts
|
||||
*/
|
||||
private void setRotation (ModelRenderer m, float x, float y, float z)
|
||||
{
|
||||
m.rotateAngleX = x;
|
||||
m.rotateAngleY = y;
|
||||
m.rotateAngleZ = z;
|
||||
}
|
||||
}
|
||||
@@ -4,34 +4,34 @@ import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
|
||||
/**
|
||||
* katana - wiiv Created using Tabula 4.1.1
|
||||
* Saya model - created by <wiiv> using Tabula 4.1.1
|
||||
*/
|
||||
public class ModelSaya extends ModelBase
|
||||
{
|
||||
public ModelRenderer saya;
|
||||
public ModelRenderer saya;
|
||||
|
||||
public ModelSaya ()
|
||||
{
|
||||
this.textureWidth = 32;
|
||||
this.textureHeight = 64;
|
||||
|
||||
this.saya = new ModelRenderer(this, 10, 0);
|
||||
this.saya.setRotationPoint(0.0F, -40.0F, 0.0F);
|
||||
this.saya.addBox(-1.0F, 0.5F, -2.0F, 2, 48, 4, 0.0F);
|
||||
}
|
||||
public ModelSaya ()
|
||||
{
|
||||
this.textureWidth = 32;
|
||||
this.textureHeight = 64;
|
||||
|
||||
public void render (float size)
|
||||
{
|
||||
this.saya.render(size);
|
||||
}
|
||||
this.saya = new ModelRenderer(this, 10, 0);
|
||||
this.saya.setRotationPoint(0.0F, -40.0F, 0.0F);
|
||||
this.saya.addBox(-1.0F, 0.5F, -2.0F, 2, 48, 4, 0.0F);
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a helper function from Tabula to set the rotation of model parts
|
||||
*/
|
||||
public void setRotation (ModelRenderer m, float x, float y, float z)
|
||||
{
|
||||
m.rotateAngleX = x;
|
||||
m.rotateAngleY = y;
|
||||
m.rotateAngleZ = z;
|
||||
}
|
||||
public void render (float size)
|
||||
{
|
||||
this.saya.render(size);
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a helper function from Tabula to set the rotation of model parts
|
||||
*/
|
||||
public void setRotation (ModelRenderer m, float x, float y, float z)
|
||||
{
|
||||
m.rotateAngleX = x;
|
||||
m.rotateAngleY = y;
|
||||
m.rotateAngleZ = z;
|
||||
}
|
||||
}
|
||||
@@ -12,64 +12,64 @@ import thaumcraft.client.lib.UtilsFX;
|
||||
|
||||
public class RenderEntityDiffusion extends Render
|
||||
{
|
||||
public void render (EntityDiffusion e, double x, double y, double z, float f, float pT)
|
||||
{
|
||||
Tessellator t = Tessellator.instance;
|
||||
@Override
|
||||
public void doRender (Entity entity, double x, double y, double z, float f, float partialTicks)
|
||||
{
|
||||
render((EntityDiffusion) entity, x, y, z, f, partialTicks);
|
||||
}
|
||||
|
||||
GL11.glPushMatrix();
|
||||
public void render (EntityDiffusion entity, double x, double y, double z, float f, float partialTicks)
|
||||
{
|
||||
Tessellator t = Tessellator.instance;
|
||||
|
||||
GL11.glTranslated(x, y, z);
|
||||
GL11.glPushMatrix();
|
||||
|
||||
float color = 0.1F;
|
||||
float alpha = (20.0F - (float) e.ticksExisted) / 40.0F;
|
||||
GL11.glTranslated(x, y, z);
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
float color = 0.1F;
|
||||
float alpha = (20.0F - (float) entity.ticksExisted) / 40.0F;
|
||||
|
||||
UtilsFX.bindTexture(ParticleEngine.particleTexture);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
float f2 = e.ticksExisted % 13 / 16.0F;
|
||||
float f3 = f2 + 0.0624375F;
|
||||
float f4 = 0.1875F;
|
||||
float f5 = f4 + 0.0624375F;
|
||||
float f6 = 1.0F;
|
||||
float f7 = 0.5F;
|
||||
float f8 = 0.5F;
|
||||
UtilsFX.bindTexture(ParticleEngine.particleTexture);
|
||||
|
||||
GL11.glColor4f(color, color, color, alpha);
|
||||
float f2 = entity.ticksExisted % 13 / 16.0F;
|
||||
float f3 = f2 + 0.0624375F;
|
||||
float f4 = 0.1875F;
|
||||
float f5 = f4 + 0.0624375F;
|
||||
float f6 = 1.0F;
|
||||
float f7 = 0.5F;
|
||||
float f8 = 0.5F;
|
||||
|
||||
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.glColor4f(color, color, color, alpha);
|
||||
|
||||
float s = 0.5F;
|
||||
GL11.glScalef(s, s, s);
|
||||
GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
|
||||
|
||||
t.startDrawingQuads();
|
||||
float s = 0.5F;
|
||||
GL11.glScalef(s, s, s);
|
||||
|
||||
t.setNormal(0.0F, 1.0F, 0.0F);
|
||||
t.setColorRGBA_F(color, color, color, alpha);
|
||||
t.startDrawingQuads();
|
||||
|
||||
t.addVertexWithUV(0.0F - f7, 0.0F - f8, 0.0D, f2, f5);
|
||||
t.addVertexWithUV(f6 - f7, 0.0F - f8, 0.0D, f3, f5);
|
||||
t.addVertexWithUV(f6 - f7, 1.0F - f8, 0.0D, f3, f4);
|
||||
t.addVertexWithUV(0.0F - f7, 1.0F - f8, 0.0D, f2, f4);
|
||||
t.setNormal(0.0F, 1.0F, 0.0F);
|
||||
t.setColorRGBA_F(color, color, color, alpha);
|
||||
|
||||
t.draw();
|
||||
t.addVertexWithUV(0.0F - f7, 0.0F - f8, 0.0D, f2, f5);
|
||||
t.addVertexWithUV(f6 - f7, 0.0F - f8, 0.0D, f3, f5);
|
||||
t.addVertexWithUV(f6 - f7, 1.0F - f8, 0.0D, f3, f4);
|
||||
t.addVertexWithUV(0.0F - f7, 1.0F - f8, 0.0D, f2, f4);
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
t.draw();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
|
||||
@Override
|
||||
public void doRender (Entity e, double x, double y, double z, float f, float pT)
|
||||
{
|
||||
render((EntityDiffusion) e, x, y, z, f, pT);
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture (Entity e)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture (Entity entity)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -13,83 +13,85 @@ import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.lib.UtilsFX;
|
||||
|
||||
/**
|
||||
* this class is based off of RenderHomingShard.class created by <Azanor> as
|
||||
* part of Thaumcraft 5
|
||||
* This class is based off of RenderHomingShard.class created by <Azanor> as part of Thaumcraft 5.
|
||||
*/
|
||||
public class RenderEntityHomingShard extends Render
|
||||
{
|
||||
public RenderEntityHomingShard ()
|
||||
{
|
||||
super();
|
||||
this.shadowSize = 0.0F;
|
||||
}
|
||||
public RenderEntityHomingShard ()
|
||||
{
|
||||
super();
|
||||
this.shadowSize = 0.0F;
|
||||
}
|
||||
|
||||
public void renderEntityAt (EntityHomingShard e, double x, double y, double z, float f, float pT)
|
||||
{
|
||||
Tessellator t = Tessellator.instance;
|
||||
@Override
|
||||
public void doRender (Entity entity, double x, double y, double z, float f, float partialTicks)
|
||||
{
|
||||
render((EntityHomingShard) entity, x, y, z, f, partialTicks);
|
||||
}
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glDepthMask(false);
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
public void render (EntityHomingShard entity, double x, double y, double z, float f, float partialTicks)
|
||||
{
|
||||
Tessellator t = Tessellator.instance;
|
||||
|
||||
UtilsFX.bindTexture(ParticleEngine.particleTexture);
|
||||
GL11.glPushMatrix();
|
||||
|
||||
float f2 = (8 + e.ticksExisted % 8) / 16.0F;
|
||||
float f3 = f2 + 0.0625F;
|
||||
float f4 = 0.25F;
|
||||
float f5 = f4 + 0.0625F;
|
||||
GL11.glDepthMask(false);
|
||||
|
||||
float f6 = 1.0F;
|
||||
float f7 = 0.5F;
|
||||
float f8 = 0.5F;
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
float red = 0.405F;
|
||||
float green = 0.075F;
|
||||
float blue = 0.525F;
|
||||
float alpha = 1.0F;
|
||||
UtilsFX.bindTexture(ParticleEngine.particleTexture);
|
||||
|
||||
GL11.glColor4f(red, green, blue, alpha);
|
||||
float f2 = (8 + entity.ticksExisted % 8) / 16.0F;
|
||||
float f3 = f2 + 0.0625F;
|
||||
float f4 = 0.25F;
|
||||
float f5 = f4 + 0.0625F;
|
||||
|
||||
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());
|
||||
float f6 = 1.0F;
|
||||
float f7 = 0.5F;
|
||||
float f8 = 0.5F;
|
||||
|
||||
t.startDrawingQuads();
|
||||
float red = 0.405F;
|
||||
float green = 0.075F;
|
||||
float blue = 0.525F;
|
||||
float alpha = 1.0F;
|
||||
|
||||
t.setColorRGBA_F(red, green, blue, alpha);
|
||||
t.setNormal(0.0F, 1.0F, 0.0F);
|
||||
t.setBrightness(240);
|
||||
GL11.glColor4f(red, green, blue, alpha);
|
||||
|
||||
t.addVertexWithUV(-f7, -f8, 0.0D, f2, f5);
|
||||
t.addVertexWithUV(f6 - f7, -f8, 0.0D, f3, f5);
|
||||
t.addVertexWithUV(f6 - f7, 1.0F - f8, 0.0D, f3, f4);
|
||||
t.addVertexWithUV(-f7, 1.0F - f8, 0.0D, f2, f4);
|
||||
GL11.glPushMatrix();
|
||||
|
||||
t.draw();
|
||||
GL11.glTranslated(x, y, z);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
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 * entity.getStrength(), 0.4F + 0.1F * entity.getStrength(),
|
||||
0.4F + 0.1F * entity.getStrength());
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glDepthMask(true);
|
||||
t.startDrawingQuads();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
t.setColorRGBA_F(red, green, blue, alpha);
|
||||
t.setNormal(0.0F, 1.0F, 0.0F);
|
||||
t.setBrightness(240);
|
||||
|
||||
public void doRender (Entity e, double x, double y, double z, float f, float pT)
|
||||
{
|
||||
renderEntityAt((EntityHomingShard) e, x, y, z, f, pT);
|
||||
}
|
||||
t.addVertexWithUV(-f7, -f8, 0.0D, f2, f5);
|
||||
t.addVertexWithUV(f6 - f7, -f8, 0.0D, f3, f5);
|
||||
t.addVertexWithUV(f6 - f7, 1.0F - f8, 0.0D, f3, f4);
|
||||
t.addVertexWithUV(-f7, 1.0F - f8, 0.0D, f2, f4);
|
||||
|
||||
protected ResourceLocation getEntityTexture (Entity e)
|
||||
{
|
||||
return TextureMap.locationBlocksTexture;
|
||||
}
|
||||
t.draw();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glDepthMask(true);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture (Entity entity)
|
||||
{
|
||||
return TextureMap.locationBlocksTexture;
|
||||
}
|
||||
}
|
||||
@@ -18,37 +18,37 @@ import thaumcraft.client.lib.UtilsFX;
|
||||
public class RenderItemKatana implements IItemRenderer
|
||||
{
|
||||
@Override
|
||||
public boolean handleRenderType (ItemStack s, ItemRenderType t)
|
||||
public boolean handleRenderType (ItemStack stack, ItemRenderType type)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper (ItemRenderType t, ItemStack s, ItemRendererHelper h)
|
||||
public boolean shouldUseRenderHelper (ItemRenderType type, ItemStack stack, ItemRendererHelper helper)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem (ItemRenderType t, ItemStack s, Object... data)
|
||||
public void renderItem (ItemRenderType type, ItemStack stack, Object... data)
|
||||
{
|
||||
EntityPlayer p = TaintedMagic.proxy.getClientPlayer();
|
||||
EntityPlayer player = TaintedMagic.proxy.getClientPlayer();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glScalef(1.4F, 1.4F, 1.4F);
|
||||
|
||||
if ( (p.getHeldItem() == null || p.getHeldItem() != s) && t != ItemRenderType.EQUIPPED)
|
||||
if ( (player.getHeldItem() == null || player.getHeldItem() != stack) && type != ItemRenderType.EQUIPPED)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
if (t == ItemRenderType.ENTITY)
|
||||
if (type == ItemRenderType.ENTITY)
|
||||
{
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
GL11.glTranslatef(0F, 0.5F, 0F);
|
||||
GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F);
|
||||
}
|
||||
else if (t == ItemRenderType.INVENTORY)
|
||||
else if (type == ItemRenderType.INVENTORY)
|
||||
{
|
||||
GL11.glScalef(0.4F, 0.4F, 0.4F);
|
||||
GL11.glRotatef(-65, 1.0F, 0.0F, 0.0F);
|
||||
@@ -60,24 +60,24 @@ public class RenderItemKatana implements IItemRenderer
|
||||
GL11.glTranslatef(0.0F, -0.7F, 0.0F);
|
||||
}
|
||||
|
||||
UtilsFX.bindTexture(ItemKatana.getTexture(s));
|
||||
ItemKatana.saya.render(0.0625F);
|
||||
UtilsFX.bindTexture(ItemKatana.getTexture(stack));
|
||||
ItemKatana.SAYA.render(0.0625F);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
if (t == ItemRenderType.ENTITY)
|
||||
if (type == ItemRenderType.ENTITY)
|
||||
{
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
GL11.glTranslatef(0F, 0.5F, 0F);
|
||||
GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
else if (t == ItemRenderType.EQUIPPED_FIRST_PERSON)
|
||||
else if (type == ItemRenderType.EQUIPPED_FIRST_PERSON)
|
||||
{
|
||||
if (p.isUsingItem())
|
||||
if (player.isUsingItem())
|
||||
{
|
||||
GL11.glTranslatef(5.0F, 1.0F, -0.2F);
|
||||
GL11.glRotatef(155.0F, 0.0F, 1.0F, 0.0F);
|
||||
@@ -89,7 +89,7 @@ public class RenderItemKatana implements IItemRenderer
|
||||
GL11.glRotatef(-10F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-10F, 0.0F, 0.0F, 1.0F);
|
||||
}
|
||||
else if (t == ItemRenderType.INVENTORY)
|
||||
else if (type == ItemRenderType.INVENTORY)
|
||||
{
|
||||
GL11.glScalef(0.4F, 0.4F, 0.4F);
|
||||
GL11.glRotatef(-65, 1.0F, 0.0F, 0.0F);
|
||||
@@ -104,12 +104,12 @@ public class RenderItemKatana implements IItemRenderer
|
||||
GL11.glTranslatef(0.0F, 2F, 0.65F);
|
||||
}
|
||||
|
||||
UtilsFX.bindTexture(ItemKatana.getTexture(s));
|
||||
UtilsFX.bindTexture(ItemKatana.getTexture(stack));
|
||||
|
||||
ItemKatana.katana.render(0.0625F);
|
||||
ItemKatana.KATANA.render(0.0625F);
|
||||
|
||||
// Runes
|
||||
if (ItemKatana.hasAnyInscription(s))
|
||||
if (ItemKatana.hasAnyInscription(stack))
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
int j = 200;
|
||||
@@ -124,13 +124,13 @@ public class RenderItemKatana implements IItemRenderer
|
||||
for (int a = 0; a < 14; a++)
|
||||
{
|
||||
int rune = (a * 3) % 16;
|
||||
drawRune(-1.65D + a * 0.14D, 0D, -0.03D, rune, p);
|
||||
drawRune(-1.65D + a * 0.14D, 0D, -0.03D, rune, player);
|
||||
}
|
||||
GL11.glRotated(180.0D, 0.0D, 1.0D, 0.0D);
|
||||
for (int a = 0; a < 14; a++)
|
||||
{
|
||||
int rune = (a + 1 * 3) % 16;
|
||||
drawRune(-1.65D + a * 0.14D, 0D, -0.03D, rune, p);
|
||||
drawRune(-1.65D + a * 0.14D, 0D, -0.03D, rune, player);
|
||||
}
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
|
||||
Reference in new issue
Block a user