mirror of
https://github.com/GTNewHorizons/Tainted-Magic.git
synced 2026-11-21 04:22:21 +00:00
Cleanup & reformat
This commit is contained in:
1 parent
f479b19255
commit
38e0cefaa2
76 files changed
+2371
-2766
No files matched your search
@@ -23,41 +23,36 @@ import taintedmagic.common.entities.EntityHomingShard;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
import thaumcraft.client.renderers.entity.RenderEldritchOrb;
|
||||
|
||||
public class ClientProxy extends CommonProxy
|
||||
{
|
||||
public class ClientProxy extends CommonProxy {
|
||||
|
||||
@Override
|
||||
public void preInit (FMLPreInitializationEvent event)
|
||||
{
|
||||
public void preInit (final FMLPreInitializationEvent event) {
|
||||
super.preInit(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init (FMLInitializationEvent event)
|
||||
{
|
||||
public void init (final FMLInitializationEvent event) {
|
||||
super.init(event);
|
||||
registerRenderers();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit (FMLPostInitializationEvent event)
|
||||
{
|
||||
public void postInit (final FMLPostInitializationEvent event) {
|
||||
super.postInit(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerHandlers ()
|
||||
{
|
||||
public void registerHandlers () {
|
||||
super.registerHandlers();
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(new HUDHandler());
|
||||
|
||||
|
||||
FMLCommonHandler.instance().bus().register(new ClientHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new ClientHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerRenderers ()
|
||||
{
|
||||
public void registerRenderers () {
|
||||
// Entities
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityDarkMatter.class, new RenderEldritchOrb());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityHomingShard.class, new RenderEntityHomingShard());
|
||||
@@ -68,14 +63,12 @@ public class ClientProxy extends CommonProxy
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityPlayer getClientPlayer ()
|
||||
{
|
||||
public EntityPlayer getClientPlayer () {
|
||||
return Minecraft.getMinecraft().thePlayer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public World getClientWorld ()
|
||||
{
|
||||
public World getClientWorld () {
|
||||
return FMLClientHandler.instance().getClient().theWorld;
|
||||
}
|
||||
}
|
||||
@@ -15,29 +15,28 @@ import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
import taintedmagic.api.IRenderInventoryItem;
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public class ClientHandler
|
||||
{
|
||||
public class ClientHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void tickEnd (TickEvent event)
|
||||
{
|
||||
if (event.phase == TickEvent.Phase.END) HUDHandler.updateTicks();
|
||||
public void tickEnd (final TickEvent event) {
|
||||
if (event.phase == TickEvent.Phase.END) {
|
||||
HUDHandler.updateTicks();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Render items implementing IRenderInventoryItem
|
||||
*/
|
||||
@SubscribeEvent
|
||||
public void onPlayerRender (RenderPlayerEvent.Specials.Post event)
|
||||
{
|
||||
EntityPlayer player = event.entityPlayer;
|
||||
if (player.getActivePotionEffect(Potion.invisibility) != null) return;
|
||||
public void onPlayerRender (final RenderPlayerEvent.Specials.Post event) {
|
||||
final EntityPlayer player = event.entityPlayer;
|
||||
if (player.getActivePotionEffect(Potion.invisibility) != null)
|
||||
return;
|
||||
|
||||
ItemStack[] inv = player.inventory.mainInventory;
|
||||
List<Item> rendering = new ArrayList<Item>();
|
||||
for (ItemStack stack : inv)
|
||||
{
|
||||
if (stack != null && stack.getItem() instanceof IRenderInventoryItem && !rendering.contains(stack.getItem()))
|
||||
{
|
||||
final ItemStack[] inv = player.inventory.mainInventory;
|
||||
final List<Item> rendering = new ArrayList<>();
|
||||
for (final ItemStack stack : inv) {
|
||||
if (stack != null && stack.getItem() instanceof IRenderInventoryItem && !rendering.contains(stack.getItem())) {
|
||||
((IRenderInventoryItem) stack.getItem()).render(player, stack, event.partialRenderTick);
|
||||
rendering.add(stack.getItem());
|
||||
}
|
||||
|
||||
@@ -18,14 +18,12 @@ import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
|
||||
import taintedmagic.api.IHeldItemHUD;
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
|
||||
public final class HUDHandler
|
||||
{
|
||||
public final class HUDHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void renderGameOverlayEvent (RenderGameOverlayEvent.Post event)
|
||||
{
|
||||
if (event.type == ElementType.ALL)
|
||||
{
|
||||
public void renderGameOverlayEvent (final RenderGameOverlayEvent.Post event) {
|
||||
if (event.type == ElementType.ALL) {
|
||||
renderHeldItemHUD(event.partialTicks);
|
||||
renderString();
|
||||
}
|
||||
@@ -36,78 +34,91 @@ public final class HUDHandler
|
||||
private static ItemStack last = null;
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
private void renderHeldItemHUD (float partialTicks)
|
||||
{
|
||||
EntityPlayer player = TaintedMagic.proxy.getClientPlayer();
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
||||
private void renderHeldItemHUD (final float partialTicks) {
|
||||
final EntityPlayer player = TaintedMagic.proxy.getClientPlayer();
|
||||
final Minecraft mc = Minecraft.getMinecraft();
|
||||
final ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
||||
|
||||
if (stack != null && stack.getItem() instanceof IHeldItemHUD) last = stack.copy();
|
||||
if (stack != null && stack.getItem() instanceof IHeldItemHUD) {
|
||||
last = stack.copy();
|
||||
}
|
||||
stack = player.getCurrentEquippedItem();
|
||||
|
||||
boolean b = false;
|
||||
if (stack != null && stack.getItem() instanceof IHeldItemHUD) b = true;
|
||||
else 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 + partialTicks);
|
||||
else ticksEquipped = Math.max(0F, ticksEquipped - partialTicks);
|
||||
final float time = 30.0F;
|
||||
if (b) {
|
||||
ticksEquipped = Math.min(time, ticksEquipped + partialTicks);
|
||||
}
|
||||
else {
|
||||
ticksEquipped = Math.max(0F, ticksEquipped - partialTicks);
|
||||
}
|
||||
|
||||
float fract = ticksEquipped / time;
|
||||
final float fract = ticksEquipped / time;
|
||||
|
||||
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);
|
||||
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 currentText;
|
||||
private static int time, ticks;
|
||||
private static boolean gay;
|
||||
private static int time;
|
||||
private static int ticks;
|
||||
private static boolean isRainbow;
|
||||
|
||||
/**
|
||||
* Displays text above the health bar for a specified duration.
|
||||
*
|
||||
*
|
||||
* @param text The string to display.
|
||||
* @param duration The duration to display it for (in ticks).
|
||||
* @param rainbow Setting this to true makes things absolutely fabulous.
|
||||
* @param duration The duration to display for (in ticks).
|
||||
* @param rainbow Display the string in rainbow.
|
||||
*/
|
||||
public static void displayString (String text, int duration, boolean rainbow)
|
||||
{
|
||||
public static void displayString (final String text, final int duration, final boolean rainbow) {
|
||||
currentText = text;
|
||||
ticks = time = duration;
|
||||
gay = rainbow;
|
||||
isRainbow = rainbow;
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public static void updateTicks ()
|
||||
{
|
||||
if (ticks > 0) ticks--;
|
||||
public static void updateTicks () {
|
||||
if (ticks > 0) {
|
||||
ticks--;
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
private void renderString ()
|
||||
{
|
||||
if (ticks > 0 && !MathHelper.stringNullOrLengthZero(currentText))
|
||||
{
|
||||
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(currentText)) {
|
||||
final Minecraft mc = Minecraft.getMinecraft();
|
||||
final ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
||||
final int x = res.getScaledWidth();
|
||||
final int y = res.getScaledHeight();
|
||||
final FontRenderer font = mc.fontRenderer;
|
||||
|
||||
int startX = (x - font.getStringWidth(currentText)) / 2;
|
||||
int startY = y - 72;
|
||||
final int startX = (x - font.getStringWidth(currentText)) / 2;
|
||||
final int startY = y - 72;
|
||||
|
||||
int opacity = ticks > ((float) time * 0.25F) ? 255 : (int) (255F * ((float) ticks / ((float) time * 0.25F)));
|
||||
if (opacity < 5) opacity = 0;
|
||||
int opacity = ticks > time * 0.25F ? 255 : (int) (255F * (ticks / (time * 0.25F)));
|
||||
if (opacity < 5) {
|
||||
opacity = 0;
|
||||
}
|
||||
|
||||
int rgb = Color.HSBtoRGB( ((float) (time - ticks) / (float) time), 1.0F, 1.0F);
|
||||
final int rgb = Color.HSBtoRGB((float) (time - ticks) / (float) time, 1.0F, 1.0F);
|
||||
|
||||
if (opacity > 0)
|
||||
{
|
||||
if (opacity > 0) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
font.drawStringWithShadow(currentText, startX, startY, (gay ? rgb : 0xFFFFFF) + (opacity << 24));
|
||||
font.drawStringWithShadow(currentText, startX, startY, (isRainbow ? rgb : 0xFFFFFF) + (opacity << 24));
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@@ -6,44 +6,31 @@ import net.minecraft.client.model.ModelRenderer;
|
||||
/**
|
||||
* Katana model - created by <wiiv> using Tabula 4.1.1
|
||||
*/
|
||||
public class ModelKatana extends ModelBase
|
||||
{
|
||||
public class ModelKatana extends ModelBase {
|
||||
public ModelRenderer blade;
|
||||
public ModelRenderer grip1;
|
||||
public ModelRenderer grip2;
|
||||
|
||||
public ModelKatana ()
|
||||
{
|
||||
this.textureWidth = 32;
|
||||
this.textureHeight = 64;
|
||||
public ModelKatana () {
|
||||
textureWidth = 32;
|
||||
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);
|
||||
grip2 = new ModelRenderer(this, 22, 0);
|
||||
grip2.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
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);
|
||||
blade = new ModelRenderer(this, 0, 0);
|
||||
blade.setRotationPoint(0.0F, -40.0F, 0.0F);
|
||||
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);
|
||||
grip1 = new ModelRenderer(this, 0, 52);
|
||||
grip1.setRotationPoint(0.0F, -40.0F, 0.0F);
|
||||
grip1.addBox(-2.5F, 0.0F, -3.5F, 5, 1, 7, 0.0F);
|
||||
grip1.addChild(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;
|
||||
public void render (final float size) {
|
||||
blade.render(size);
|
||||
grip1.render(size);
|
||||
}
|
||||
}
|
||||
@@ -6,30 +6,26 @@ import net.minecraft.client.model.ModelRenderer;
|
||||
/**
|
||||
* Saya model - created by <wiiv> using Tabula 4.1.1
|
||||
*/
|
||||
public class ModelSaya extends ModelBase
|
||||
{
|
||||
public class ModelSaya extends ModelBase {
|
||||
public ModelRenderer saya;
|
||||
|
||||
public ModelSaya ()
|
||||
{
|
||||
this.textureWidth = 32;
|
||||
this.textureHeight = 64;
|
||||
public ModelSaya () {
|
||||
textureWidth = 32;
|
||||
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);
|
||||
saya = new ModelRenderer(this, 10, 0);
|
||||
saya.setRotationPoint(0.0F, -40.0F, 0.0F);
|
||||
saya.addBox(-1.0F, 0.5F, -2.0F, 2, 48, 4, 0.0F);
|
||||
}
|
||||
|
||||
public void render (float size)
|
||||
{
|
||||
this.saya.render(size);
|
||||
public void render (final float size) {
|
||||
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)
|
||||
{
|
||||
public void setRotation (final ModelRenderer m, final float x, final float y, final float z) {
|
||||
m.rotateAngleX = x;
|
||||
m.rotateAngleY = y;
|
||||
m.rotateAngleZ = z;
|
||||
|
||||
@@ -10,44 +10,43 @@ import taintedmagic.common.entities.EntityDiffusion;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.lib.UtilsFX;
|
||||
|
||||
public class RenderEntityDiffusion extends Render
|
||||
{
|
||||
public class RenderEntityDiffusion extends Render {
|
||||
|
||||
@Override
|
||||
public void doRender (Entity entity, double x, double y, double z, float f, float partialTicks)
|
||||
{
|
||||
public void doRender (final Entity entity, final double x, final double y, final double z, final float f,
|
||||
final float partialTicks) {
|
||||
render((EntityDiffusion) entity, x, y, z, f, partialTicks);
|
||||
}
|
||||
|
||||
public void render (EntityDiffusion entity, double x, double y, double z, float f, float partialTicks)
|
||||
{
|
||||
Tessellator t = Tessellator.instance;
|
||||
public void render (final EntityDiffusion entity, final double x, final double y, final double z, final float f,
|
||||
final float partialTicks) {
|
||||
final Tessellator t = Tessellator.instance;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glTranslated(x, y, z);
|
||||
|
||||
float color = 0.1F;
|
||||
float alpha = (20.0F - (float) entity.ticksExisted) / 40.0F;
|
||||
final float color = 0.1F;
|
||||
final float alpha = (20.0F - entity.ticksExisted) / 40.0F;
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
UtilsFX.bindTexture(ParticleEngine.particleTexture);
|
||||
|
||||
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;
|
||||
final float f2 = entity.ticksExisted % 13 / 16.0F;
|
||||
final float f3 = f2 + 0.0625F;
|
||||
final float f4 = 0.1875F;
|
||||
final float f5 = f4 + 0.0625F;
|
||||
final float f6 = 1.0F;
|
||||
final float f7 = 0.5F;
|
||||
|
||||
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);
|
||||
GL11.glRotatef(180.0F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
|
||||
|
||||
float s = 0.5F;
|
||||
final float s = 0.5F;
|
||||
GL11.glScalef(s, s, s);
|
||||
|
||||
t.startDrawingQuads();
|
||||
@@ -55,10 +54,10 @@ public class RenderEntityDiffusion extends Render
|
||||
t.setNormal(0.0F, 1.0F, 0.0F);
|
||||
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);
|
||||
t.addVertexWithUV(f6 - f7, 1.0F - f8, 0.0D, f3, f4);
|
||||
t.addVertexWithUV(0.0F - f7, 1.0F - f8, 0.0D, f2, f4);
|
||||
t.addVertexWithUV(0.0F - f7, 0.0F - f7, 0.0D, f2, f5);
|
||||
t.addVertexWithUV(f6 - f7, 0.0F - f7, 0.0D, f3, f5);
|
||||
t.addVertexWithUV(f6 - f7, 1.0F - f7, 0.0D, f3, f4);
|
||||
t.addVertexWithUV(0.0F - f7, 1.0F - f7, 0.0D, f2, f4);
|
||||
|
||||
t.draw();
|
||||
|
||||
@@ -68,8 +67,7 @@ public class RenderEntityDiffusion extends Render
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture (Entity entity)
|
||||
{
|
||||
protected ResourceLocation getEntityTexture (final Entity entity) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -15,23 +15,21 @@ import thaumcraft.client.lib.UtilsFX;
|
||||
/**
|
||||
* 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 class RenderEntityHomingShard extends Render {
|
||||
|
||||
public RenderEntityHomingShard () {
|
||||
shadowSize = 0.0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRender (Entity entity, double x, double y, double z, float f, float partialTicks)
|
||||
{
|
||||
public void doRender (final Entity entity, final double x, final double y, final double z, final float f,
|
||||
final float partialTicks) {
|
||||
render((EntityHomingShard) entity, x, y, z, f, partialTicks);
|
||||
}
|
||||
|
||||
public void render (EntityHomingShard entity, double x, double y, double z, float f, float partialTicks)
|
||||
{
|
||||
Tessellator t = Tessellator.instance;
|
||||
public void render (final EntityHomingShard entity, final double x, final double y, final double z, final float f,
|
||||
final float partialTicks) {
|
||||
final Tessellator t = Tessellator.instance;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
@@ -42,19 +40,18 @@ public class RenderEntityHomingShard extends Render
|
||||
|
||||
UtilsFX.bindTexture(ParticleEngine.particleTexture);
|
||||
|
||||
float f2 = (8 + entity.ticksExisted % 8) / 16.0F;
|
||||
float f3 = f2 + 0.0625F;
|
||||
float f4 = 0.25F;
|
||||
float f5 = f4 + 0.0625F;
|
||||
final float f2 = (8 + entity.ticksExisted % 8) / 16.0F;
|
||||
final float f3 = f2 + 0.0625F;
|
||||
final float f4 = 0.25F;
|
||||
final float f5 = f4 + 0.0625F;
|
||||
|
||||
float f6 = 1.0F;
|
||||
float f7 = 0.5F;
|
||||
float f8 = 0.5F;
|
||||
final float f6 = 1.0F;
|
||||
final float f7 = 0.5F;
|
||||
|
||||
float red = 0.405F;
|
||||
float green = 0.075F;
|
||||
float blue = 0.525F;
|
||||
float alpha = 1.0F;
|
||||
final float red = 0.405F;
|
||||
final float green = 0.075F;
|
||||
final float blue = 0.525F;
|
||||
final float alpha = 1.0F;
|
||||
|
||||
GL11.glColor4f(red, green, blue, alpha);
|
||||
|
||||
@@ -62,8 +59,8 @@ public class RenderEntityHomingShard extends Render
|
||||
|
||||
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.glRotatef(180.0F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-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());
|
||||
|
||||
@@ -73,10 +70,10 @@ public class RenderEntityHomingShard extends Render
|
||||
t.setNormal(0.0F, 1.0F, 0.0F);
|
||||
t.setBrightness(240);
|
||||
|
||||
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);
|
||||
t.addVertexWithUV(-f7, -f7, 0.0D, f2, f5);
|
||||
t.addVertexWithUV(f6 - f7, -f7, 0.0D, f3, f5);
|
||||
t.addVertexWithUV(f6 - f7, 1.0F - f7, 0.0D, f3, f4);
|
||||
t.addVertexWithUV(-f7, 1.0F - f7, 0.0D, f2, f4);
|
||||
|
||||
t.draw();
|
||||
|
||||
@@ -90,8 +87,7 @@ public class RenderEntityHomingShard extends Render
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture (Entity entity)
|
||||
{
|
||||
protected ResourceLocation getEntityTexture (final Entity entity) {
|
||||
return TextureMap.locationBlocksTexture;
|
||||
}
|
||||
}
|
||||
@@ -15,48 +15,41 @@ import taintedmagic.common.items.tools.ItemKatana;
|
||||
import thaumcraft.client.lib.UtilsFX;
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public class RenderItemKatana implements IItemRenderer
|
||||
{
|
||||
public class RenderItemKatana implements IItemRenderer {
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType (ItemStack stack, ItemRenderType type)
|
||||
{
|
||||
public boolean handleRenderType (final ItemStack stack, final ItemRenderType type) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper (ItemRenderType type, ItemStack stack, ItemRendererHelper helper)
|
||||
{
|
||||
public boolean shouldUseRenderHelper (final ItemRenderType type, final ItemStack stack, final ItemRendererHelper helper) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem (ItemRenderType type, ItemStack stack, Object... data)
|
||||
{
|
||||
EntityPlayer player = TaintedMagic.proxy.getClientPlayer();
|
||||
public void renderItem (final ItemRenderType type, final ItemStack stack, final Object... data) {
|
||||
final EntityPlayer player = TaintedMagic.proxy.getClientPlayer();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glScalef(1.4F, 1.4F, 1.4F);
|
||||
|
||||
if ( (player.getHeldItem() == null || player.getHeldItem() != stack) && type != ItemRenderType.EQUIPPED)
|
||||
{
|
||||
if ( (player.getHeldItem() == null || player.getHeldItem() != stack) && type != ItemRenderType.EQUIPPED) {
|
||||
GL11.glPushMatrix();
|
||||
if (type == 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 (type == ItemRenderType.INVENTORY)
|
||||
{
|
||||
else if (type == ItemRenderType.INVENTORY) {
|
||||
GL11.glScalef(0.4F, 0.4F, 0.4F);
|
||||
GL11.glRotatef(-65, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(-50, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glTranslatef(1F, 1F, 0.0F);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
GL11.glTranslatef(0.0F, -0.7F, 0.0F);
|
||||
}
|
||||
|
||||
@@ -68,17 +61,14 @@ public class RenderItemKatana implements IItemRenderer
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
if (type == 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 (type == ItemRenderType.EQUIPPED_FIRST_PERSON)
|
||||
{
|
||||
if (player.isUsingItem())
|
||||
{
|
||||
else if (type == ItemRenderType.EQUIPPED_FIRST_PERSON) {
|
||||
if (player.isUsingItem()) {
|
||||
GL11.glTranslatef(5.0F, 1.0F, -0.2F);
|
||||
GL11.glRotatef(155.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-20.0F, 1.0F, 0.0F, 0.0F);
|
||||
@@ -89,15 +79,13 @@ 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 (type == ItemRenderType.INVENTORY)
|
||||
{
|
||||
else if (type == ItemRenderType.INVENTORY) {
|
||||
GL11.glScalef(0.4F, 0.4F, 0.4F);
|
||||
GL11.glRotatef(-65, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(-50, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glTranslatef(1F, 1F, 0.0F);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
GL11.glRotatef(60, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(-40, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(70, 0.0F, 1.0F, 0.0F);
|
||||
@@ -109,27 +97,24 @@ public class RenderItemKatana implements IItemRenderer
|
||||
ItemKatana.KATANA.render(0.0625F);
|
||||
|
||||
// Runes
|
||||
if (ItemKatana.hasAnyInscription(stack))
|
||||
{
|
||||
if (ItemKatana.hasAnyInscription(stack)) {
|
||||
GL11.glPushMatrix();
|
||||
int j = 200;
|
||||
int k = j % 65536;
|
||||
int l = j / 65536;
|
||||
final int j = 200;
|
||||
final int k = j % 65536;
|
||||
final int l = j / 65536;
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, k / 1.0F, l / 1.0F);
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
|
||||
GL11.glRotated(90.0D, 0.0D, 1.0D, 0.0D);
|
||||
for (int a = 0; a < 14; a++)
|
||||
{
|
||||
int rune = (a * 3) % 16;
|
||||
for (int a = 0; a < 14; a++) {
|
||||
final int rune = a * 3 % 16;
|
||||
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;
|
||||
for (int a = 0; a < 14; a++) {
|
||||
final int rune = (a + 1 * 3) % 16;
|
||||
drawRune(-1.65D + a * 0.14D, 0D, -0.03D, rune, player);
|
||||
}
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
@@ -149,27 +134,26 @@ public class RenderItemKatana implements IItemRenderer
|
||||
/**
|
||||
* TC method to draw runes on runed staves
|
||||
*/
|
||||
public static void drawRune (double x, double y, double z, int rune, EntityPlayer player)
|
||||
{
|
||||
public static void drawRune (final double x, final double y, final double z, final int rune, final EntityPlayer player) {
|
||||
GL11.glPushMatrix();
|
||||
|
||||
UtilsFX.bindTexture("textures/misc/script.png");
|
||||
|
||||
float r = MathHelper.sin( (player.ticksExisted + rune * 5) / 5.0F) * 0.1F + 0.88F;
|
||||
float g = MathHelper.sin( (player.ticksExisted + rune * 5) / 7.0F) * 0.1F + 0.63F;
|
||||
float alpha = MathHelper.sin( (player.ticksExisted + rune * 5) / 10.0F) * 0.3F;
|
||||
final float r = MathHelper.sin( (player.ticksExisted + rune * 5) / 5.0F) * 0.1F + 0.88F;
|
||||
final float g = MathHelper.sin( (player.ticksExisted + rune * 5) / 7.0F) * 0.1F + 0.63F;
|
||||
final float alpha = MathHelper.sin( (player.ticksExisted + rune * 5) / 10.0F) * 0.3F;
|
||||
|
||||
GL11.glColor4f(r, g, 0.2F, alpha + 0.6F);
|
||||
|
||||
GL11.glRotated(90.0D, 0.0D, 0.0D, 1.0D);
|
||||
GL11.glTranslated(x, y, z);
|
||||
|
||||
Tessellator t = Tessellator.instance;
|
||||
final Tessellator t = Tessellator.instance;
|
||||
|
||||
float f = 0.0625F * rune;
|
||||
float f1 = f + 0.0625F;
|
||||
float f2 = 0.0F;
|
||||
float f3 = 1.0F;
|
||||
final float f = 0.0625F * rune;
|
||||
final float f1 = f + 0.0625F;
|
||||
final float f2 = 0.0F;
|
||||
final float f3 = 1.0F;
|
||||
|
||||
t.startDrawingQuads();
|
||||
|
||||
|
||||
Reference in new issue
Block a user