Fix ItemKatana renderer and server crash

This commit is contained in:
John Yorke committed 2016-10-26 17:12:55 -03:00
1 parent be1e5a231f
commit af37583742
5 files changed
+24 -10

No files matched your search

@@ -14,6 +14,7 @@ import taintedmagic.common.TaintedMagic;
import taintedmagic.common.entities.EntityEldritchOrbAttack;
import taintedmagic.common.entities.EntityTaintBubble;
import taintedmagic.common.helper.Vector3;
import taintedmagic.common.items.tools.ItemKatana;
import taintedmagic.common.registry.ItemRegistry;
import thaumcraft.client.fx.ParticleEngine;
import thaumcraft.client.fx.particles.FXWisp;
@@ -57,8 +58,8 @@ public class ClientProxy extends CommonProxy
{
for (int j = 0; j < 5; j++)
{
xp = (Math.cos(i * Math.PI / 180F)) * 1;
zp = (Math.sin(i * Math.PI / 180F)) * 1;
xp = (Math.cos(i * Math.PI / 180F));
zp = (Math.sin(i * Math.PI / 180F));
float red = (0.05F + p.worldObj.rand.nextFloat() * 0.1F);
float blue = (0.1F + p.worldObj.rand.nextFloat() * 0.1F);
@@ -69,7 +70,7 @@ public class ClientProxy extends CommonProxy
ef.setGravity(0.0F);
ef.shrink = true;
ef.noClip = true;
Vector3 movement = getDistanceBetween(ef, p);
Vector3 movement = getDistanceVectorBetween(ef, p);
ef.addVelocity(movement.x * 2.5, 0, movement.z * 2.5);
ParticleEngine.instance.addEffect(w, ef);
@@ -77,12 +78,12 @@ public class ClientProxy extends CommonProxy
}
}
public static Vector3 getDistanceBetween (Entity e, Entity target)
public static Vector3 getDistanceVectorBetween (Entity e, Entity target)
{
Vector3 fromPosition = new Vector3(e.posX, e.posY, e.posZ);
Vector3 toPosition = new Vector3(target.posX, target.posY, target.posZ);
Vector3 var3 = fromPosition.sub(toPosition);
var3.normalize();
return var3;
Vector3 dist = fromPosition.sub(toPosition);
dist.normalize();
return dist;
}
}
@@ -3,6 +3,7 @@ package taintedmagic.common.items.tools;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -134,6 +135,7 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable
return 0;
}
@SideOnly (Side.CLIENT)
@SubscribeEvent
public void onPlayerRender (RenderPlayerEvent.Specials.Post event)
{
@@ -147,6 +149,15 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable
{
ItemStack s = p.inventory.getStackInSlot(i);
GL11.glPushMatrix();
int light = p.getBrightnessForRender(0);
int lightmapX = light % 65536;
int lightmapY = light / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
if (p.getHeldItem() == null || p.getHeldItem().getItem() != this)
{
GL11.glPushMatrix();
@@ -176,6 +187,8 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable
GL11.glPopMatrix();
GL11.glPopMatrix();
break;
}
}
@@ -5,6 +5,6 @@ public class LibStrings
// LibStrings
public static final String MODID = "TaintedMagic";
public static final String NAME = "Tainted Magic";
public static final String VERSION = "r7.0";
public static final String VERSION = "r7.1";
public static final String DEPENDENCIES = "required-after:Forge@[10.13.2.1291,);required-after:Thaumcraft@[4.2.3.5,);after:ThaumicTinkerer";
}