summaryrefslogtreecommitdiff
path: root/src/main/java/darkknight/jewelrycraft/events
diff options
context:
space:
mode:
authorOnyxDarkKnight <sor1n.iliutza16@gmail.com>2015-05-05 22:07:10 +0100
committerOnyxDarkKnight <sor1n.iliutza16@gmail.com>2015-05-05 22:07:10 +0100
commit208b1f1e0d5faf601b53818b04f6699b2e6cb6bc (patch)
tree56c059b812f1917b582e65e7ef15faa70a429f0b /src/main/java/darkknight/jewelrycraft/events
parent80417b99e10a462fd72b8f8fcd3b226c862534e4 (diff)
- Working on a GUI showing what curses you get with a description on them
- Added a search bar in the Liquids Tab for easier searching - Fixed an issue with golden objects giving errors due to missing default texture - Improved the Infamy Mask to have less parts, thus causing less lag - Improved ingots and ore detection - Fixed certain ores when smelted outputting a different ingot - Necklaces and Rings now render as well - Updated the guide at the Guide item to have the proper link to the mod as well as mention the right people who helped with it - Added a list of the ores that work in the guide - Added a new tab to the guide regarding the ores and the ingots they create - Changed the stun effect caused by rings with feathers as modifiers to be a potion effect instead
Diffstat (limited to 'src/main/java/darkknight/jewelrycraft/events')
-rw-r--r--src/main/java/darkknight/jewelrycraft/events/EntityEventHandler.java87
-rw-r--r--src/main/java/darkknight/jewelrycraft/events/PlayerRenderHandler.java130
2 files changed, 146 insertions, 71 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/events/EntityEventHandler.java b/src/main/java/darkknight/jewelrycraft/events/EntityEventHandler.java
index 085cadd..0c4e9c6 100644
--- a/src/main/java/darkknight/jewelrycraft/events/EntityEventHandler.java
+++ b/src/main/java/darkknight/jewelrycraft/events/EntityEventHandler.java
@@ -10,6 +10,7 @@ import java.util.List;
import java.util.Random;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
+import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
@@ -29,7 +30,6 @@ import net.minecraftforge.event.entity.living.LivingDropsEvent;
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.event.world.WorldEvent;
-import org.lwjgl.opengl.GL11;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
@@ -44,7 +44,9 @@ import darkknight.jewelrycraft.item.ItemList;
import darkknight.jewelrycraft.network.PacketClearColorCache;
import darkknight.jewelrycraft.network.PacketRequestPlayerInfo;
import darkknight.jewelrycraft.network.PacketSendServerPlayersInfo;
+import darkknight.jewelrycraft.potions.PotionList;
import darkknight.jewelrycraft.util.BlockUtils;
+import darkknight.jewelrycraft.util.JewelryNBT;
import darkknight.jewelrycraft.util.JewelrycraftUtil;
import darkknight.jewelrycraft.util.PlayerUtils;
import darkknight.jewelrycraft.util.Variables;
@@ -55,6 +57,7 @@ import darkknight.jewelrycraft.util.Variables;
public class EntityEventHandler
{
int updateTime = 0;
+ boolean addedCurses = false;
/**
* @param event
@@ -89,31 +92,28 @@ public class EntityEventHandler
public void onEntityUpdate(LivingUpdateEvent event)
{
Entity entity = event.entity;
- if (entity.getEntityData().getBoolean("stunned") && entity.getEntityData().getInteger("stunTime") > 0){
- entity.motionX *= 0D;
- entity.motionZ *= 0D;
- entity.motionY *= 0D;
- entity.rotationPitch = entity.prevRotationPitch;
- entity.rotationYaw = entity.prevRotationYaw;
- entity.getEntityData().setInteger("stunTime", entity.getEntityData().getInteger("stunTime") - 1);
- if (entity.getEntityData().getInteger("stunTime") == 0) entity.getEntityData().setBoolean("stunned", false);
- entity.worldObj.spawnParticle("spell", entity.posX, entity.posY + entity.height, entity.posZ, 0.0D, 0.3D, 0.0D);
+ EntityLivingBase entityLiving = event.entityLiving;
+ if (entityLiving.isPotionActive(PotionList.stun)){
+ entityLiving.motionX *= 0D;
+ entityLiving.motionZ *= 0D;
+ entityLiving.motionY *= 0D;
+ entityLiving.isSwingInProgress = false;
+ entityLiving.moveForward = 0F;
+ entityLiving.moveStrafing = 0F;
+ entityLiving.setAIMoveSpeed(0F);
+ entityLiving.limbSwing = 0F;
+ entityLiving.limbSwingAmount = 0F;
+ entityLiving.swingProgressInt = 0;
+ entityLiving.rotationPitch = entity.prevRotationPitch;
+ entityLiving.rotationYaw = entity.prevRotationYaw;
+ entityLiving.worldObj.spawnParticle("spell", entityLiving.posX, entityLiving.posY + entityLiving.getEyeHeight(), entityLiving.posZ, 0.0D, 0.3D, 0.0D);
}
+ if (entityLiving.isPotionActive(PotionList.stun) && entityLiving.getActivePotionEffect(PotionList.stun).getDuration() == 0) entityLiving.removePotionEffect(PotionList.stun.id);
if (entity instanceof EntityPlayer){
EntityPlayer player = (EntityPlayer)entity;
NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID);
playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender);
if (updateTime > 0) updateTime--;
- if (playerInfo.getBoolean("stunned") && playerInfo.getInteger("stunTime") > 0){
- player.motionX *= 0D;
- player.motionZ *= 0D;
- player.motionY *= 0D;
- player.rotationPitch = entity.prevRotationPitch;
- player.rotationYaw = entity.prevRotationYaw;
- playerInfo.setInteger("stunTime", playerInfo.getInteger("stunTime") - 1);
- if (playerInfo.getInteger("stunTime") == 0) playerInfo.setBoolean("stunned", false);
- player.worldObj.spawnParticle("spell", entity.posX, entity.posY + 0.5F, entity.posZ, 0.0D, 0.3D, 0.0D);
- }
for(int i = 0; i < 18; i++)
if (playerInfo.hasKey("ext" + i)){
NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i);
@@ -134,6 +134,11 @@ public class EntityEventHandler
playerInfo.setBoolean("reselectCurses", false);
}
JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo());
+ if (addedCurses){
+ JewelrycraftMod.netWrapper.sendToAll(new PacketSendServerPlayersInfo());
+ // player.openGui(JewelrycraftMod.instance, 4, player.worldObj, 0, 0, 0);
+ addedCurses = false;
+ }
}
if (playerInfo.getBoolean("playerCursePointsChanged")) playerInfo.setBoolean("playerCursePointsChanged", false);
if (updateTime == 0){
@@ -164,15 +169,15 @@ public class EntityEventHandler
public void onEntityAttacked(LivingAttackEvent event)
{
Entity entity = event.entityLiving;
+ if (event.source.getEntity() != null && event.source.getEntity() instanceof EntityLivingBase && ((EntityLivingBase)event.source.getEntity()).isPotionActive(PotionList.stun)) event.setCanceled(true);
if (entity instanceof EntityPlayer && !(event.source.getEntity() instanceof EntityPlayer)){
EntityPlayer player = (EntityPlayer)entity;
NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID);
- if (event.source.getEntity() != null && event.source.getEntity().getEntityData().getBoolean("stunned")) event.setCanceled(true);
if (!player.worldObj.isRemote) for(int i = 0; i < 18; i++)
if (playerInfo.hasKey("ext" + i)){
NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i);
ItemStack item = ItemStack.loadItemStackFromNBT(nbt);
- if (((ItemBaseJewelry)item.getItem()).onPlayerAttackedCacellable(item, player, event.source, event.ammount)){
+ if (item != null && item.getItem() instanceof ItemBaseJewelry && ((ItemBaseJewelry)item.getItem()).onPlayerAttackedCacellable(item, player, event.source, event.ammount)){
event.setCanceled(true);
break;
}
@@ -181,7 +186,7 @@ public class EntityEventHandler
event.setCanceled(true);
break;
}
- ((ItemBaseJewelry)item.getItem()).onPlayerAttacked(item, player, event.source, event.ammount);
+ if (item != null && item.getItem() instanceof ItemBaseJewelry) ((ItemBaseJewelry)item.getItem()).onPlayerAttacked(item, player, event.source, event.ammount);
}
if (player.getHealth() != player.prevHealth){
if (playerInfo.getFloat("WhiteHeart") > 0){
@@ -230,7 +235,7 @@ public class EntityEventHandler
if (playerInfo.hasKey("ext" + i)){
NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i);
ItemStack item = ItemStack.loadItemStackFromNBT(nbt);
- if (((ItemBaseJewelry)item.getItem()).onEntityAttackedCacellable(item, player, entity, event.ammount)){
+ if (item != null && item.getItem() instanceof ItemBaseJewelry && ((ItemBaseJewelry)item.getItem()).onEntityAttackedCacellable(item, player, entity, event.ammount)){
event.setCanceled(true);
break;
}
@@ -239,7 +244,7 @@ public class EntityEventHandler
event.setCanceled(true);
break;
}
- ((ItemBaseJewelry)item.getItem()).onEntityAttacked(item, player, entity, event.ammount);
+ if (item != null && item.getItem() instanceof ItemBaseJewelry) ((ItemBaseJewelry)item.getItem()).onEntityAttacked(item, player, entity, event.ammount);
}
for(Curse curse: Curse.getCurseList())
if (playerInfo.getInteger(curse.getName()) > 0) curse.attackedByPlayerAction(entity.worldObj, player, entity);
@@ -264,7 +269,6 @@ public class EntityEventHandler
playerInfo.setBoolean("reselectCurses", false);
}
}
-
playerInfo.setFloat("BlueHeart", 0f);
playerInfo.setFloat("BlackHeart", 0f);
playerInfo.setFloat("WhiteHeart", 0f);
@@ -272,6 +276,14 @@ public class EntityEventHandler
if (playerInfo.getInteger(curse.getName()) > 0) curse.respawnAction(player.worldObj, player);
}
if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo());
+ if (!player.worldObj.isRemote){
+ JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo());
+ if (addedCurses){
+ JewelrycraftMod.netWrapper.sendToAll(new PacketSendServerPlayersInfo());
+// player.openGui(JewelrycraftMod.instance, 4, player.worldObj, 0, 0, 0);
+ addedCurses = false;
+ }
+ }
}
/**
@@ -286,17 +298,7 @@ public class EntityEventHandler
Curse cur = Curse.availableCurses.get(no);
playerInfo.setInteger(cur.getName(), 1);
Curse.availableCurses.remove(cur);
-
- }
- }
-
- public static void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseID, int grade)
- {
- Curse cur = Curse.getCurseList().get(curseID);
- if (Curse.availableCurses.size() > 0 && Curse.availableCurses.contains(cur)){
- playerInfo.setInteger(cur.getName(), grade);
- Curse.availableCurses.remove(cur);
-
+ addedCurses = true;
}
}
@@ -311,7 +313,7 @@ public class EntityEventHandler
entityitem.motionZ = 0;
entityitem.motionY = 0.11000000298023224D;
event.player.worldObj.spawnEntityInWorld(entityitem);
- MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentText("<" + event.player.getDisplayName() + "> This is MY item! MINE! I will NEVER give it to you! Mine! Mine! MINE!"));
+ MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentText("<" + event.player.getDisplayName() + "> This is MY item! MINE! I will NEVER give it to you! Mine! Mine! MINE!"));
event.setCanceled(true);
}
}
@@ -375,14 +377,13 @@ public class EntityEventHandler
}
if (entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo());
}
-
for(Curse curse: Curse.getCurseList())
if (playerInfo.getInteger(curse.getName()) > 0) curse.playerDeathAction(player.worldObj, player);
for(int i = 0; i < 18; i++)
if (playerInfo.hasKey("ext" + i)){
NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i);
ItemStack item = ItemStack.loadItemStackFromNBT(nbt);
- if (item != null) ((ItemBaseJewelry)item.getItem()).onPlayerDead(item, player, event.source);
+ if (item != null && item.getItem() instanceof ItemBaseJewelry) ((ItemBaseJewelry)item.getItem()).onPlayerDead(item, player, event.source);
}
}
if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo());
@@ -438,8 +439,7 @@ public class EntityEventHandler
@SubscribeEvent
@SideOnly (Side.CLIENT)
public void fogColors(EntityViewRenderEvent.FogColors event)
- {
- }
+ {}
/**
* @param event
@@ -455,6 +455,5 @@ public class EntityEventHandler
@SubscribeEvent
@SideOnly (Side.CLIENT)
public void renderFog(EntityViewRenderEvent.RenderFogEvent event)
- {
- }
+ {}
} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/events/PlayerRenderHandler.java b/src/main/java/darkknight/jewelrycraft/events/PlayerRenderHandler.java
index 575eae3..4d07cda 100644
--- a/src/main/java/darkknight/jewelrycraft/events/PlayerRenderHandler.java
+++ b/src/main/java/darkknight/jewelrycraft/events/PlayerRenderHandler.java
@@ -1,70 +1,98 @@
package darkknight.jewelrycraft.events;
+import java.nio.FloatBuffer;
import java.util.Iterator;
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockAir;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelRenderer;
-import net.minecraft.client.renderer.Tessellator;
-import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.ResourceLocation;
+import net.minecraft.util.Vec3;
import net.minecraftforge.client.event.RenderHandEvent;
import net.minecraftforge.client.event.RenderPlayerEvent;
+import org.lwjgl.BufferUtils;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import darkknight.jewelrycraft.api.Curse;
-import darkknight.jewelrycraft.curses.CurseList;
import darkknight.jewelrycraft.item.render.BraceletRender;
import darkknight.jewelrycraft.item.render.EarringsRender;
+import darkknight.jewelrycraft.item.render.NecklaceRender;
+import darkknight.jewelrycraft.item.render.RingRender;
import darkknight.jewelrycraft.util.JewelryNBT;
-import darkknight.jewelrycraft.util.Variables;
public class PlayerRenderHandler
{
EarringsRender earrings = new EarringsRender();
BraceletRender bracelet = new BraceletRender();
+ NecklaceRender necklace = new NecklaceRender();
+ RingRender ring = new RingRender();
public static NBTTagCompound playersInfo = new NBTTagCompound();
float size = 0.055F;
@SubscribeEvent
public void renderScreen(RenderPlayerEvent.Specials.Post event)
{
+ GL11.glPushMatrix();
ModelBiped main = event.renderer.modelBipedMain;
ModelRenderer rightArm = event.renderer.modelBipedMain.bipedRightArm;
ModelRenderer leftArm = event.renderer.modelBipedMain.bipedLeftArm;
ModelRenderer head = event.renderer.modelBipedMain.bipedHead;
+ ModelRenderer body = event.renderer.modelBipedMain.bipedBody;
Iterator<EntityPlayer> players = event.entityPlayer.worldObj.playerEntities.iterator();
if (playersInfo != null){
while (players.hasNext()){
int[] gemColor = {-1, -1, -1, -1};
int[] ingotColor = {-1, -1, -1, -1};
- int earringGem = -1;
- int earringIngot = -1;
+ int gem = -1;
+ int ingot = -1;
EntityPlayer player = players.next();
NBTTagCompound playerInfo = (NBTTagCompound)playersInfo.getTag(player.getDisplayName());
for(Curse curse: Curse.getCurseList())
if (playerInfo.getInteger(curse.getName()) > 0 && event.entityPlayer.getDisplayName().equals(player.getDisplayName()) && playerInfo.getInteger("cursePoints") > 0) curse.playerRender(player, event);
- if (playerInfo.hasKey("ext17") && event.entityPlayer.getDisplayName().equals(player.getDisplayName())){
- NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext17");
- ItemStack item = ItemStack.loadItemStackFromNBT(nbt);
- GL11.glPushMatrix();
- if (head.rotateAngleX == 0.0F && head.rotateAngleY == 0.0F && head.rotateAngleZ == 0.0F){
- if (head.rotationPointX != 0.0F || head.rotationPointY != 0.0F || head.rotationPointZ != 0.0F) GL11.glTranslatef(head.rotationPointX * size, head.rotationPointY * size, head.rotationPointZ * size);
- }else{
- GL11.glTranslatef(head.rotationPointX * size, head.rotationPointY * size, head.rotationPointZ * size);
- if (head.rotateAngleZ != 0.0F) GL11.glRotatef(head.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F);
- if (head.rotateAngleY != 0.0F) GL11.glRotatef(head.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F);
- if (head.rotateAngleX != 0.0F) GL11.glRotatef(head.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F);
- }
- GL11.glScalef(0.0625f, 0.0625f, 0.0625f);
- GL11.glTranslatef(0.0F, 1.0F, -2.0F);
- if (JewelryNBT.gem(item) != null) earringGem = JewelryNBT.gemColor(item);
- if (JewelryNBT.ingot(item) != null) earringIngot = JewelryNBT.ingotColor(item);
- earrings.doRender(event.entityPlayer, 0F, 0F, (float)earringIngot, (float)earringGem, 0F);
- GL11.glPopMatrix();
+ int no = 0;
+ ModelRenderer arm = rightArm;
+ if (player.inventory.getCurrentItem() != null && Block.getBlockFromItem(player.inventory.getCurrentItem().getItem()) instanceof BlockAir){
+ GL11.glDisable(GL11.GL_LIGHT1);
+ FloatBuffer colorBuffer = BufferUtils.createFloatBuffer(4);
+ Vec3 lightPos = Vec3.createVectorHelper(0.0D, 2.0D, 1.0D).normalize();
+ colorBuffer.clear();
+ colorBuffer.put((float)lightPos.xCoord).put((float)lightPos.yCoord).put((float)lightPos.zCoord).put(-1F);
+ colorBuffer.flip();
+ GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, colorBuffer);
+ colorBuffer.clear();
+ colorBuffer.put(0.03f).put(0.03f).put(0.03f).put(1.0F);
+ colorBuffer.flip();
+ GL11.glLight(GL11.GL_LIGHT0, GL11.GL_DIFFUSE, colorBuffer);
+ //GL11.glLight(GL11.GL_LIGHT0, GL11.GL_AMBIENT, setColorBuffer(0.0F, 0.0F, 0.0F, 1.0F)); GL11.glLight(GL11.GL_LIGHT0, GL11.GL_SPECULAR, setColorBuffer(var2, var2, var2, 1.0F));
}
+ for(int i = 0; i <= 9; i++)
+ if (playerInfo.hasKey("ext" + i) && event.entityPlayer.getDisplayName().equals(player.getDisplayName())){
+ gem = -1;
+ ingot = -1;
+ if (no > 4) arm = leftArm;
+ NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i);
+ ItemStack item = ItemStack.loadItemStackFromNBT(nbt);
+ GL11.glPushMatrix();
+ if (arm.rotateAngleX == 0.0F && arm.rotateAngleY == 0.0F && arm.rotateAngleZ == 0.0F){
+ if (arm.rotationPointX != 0.0F || arm.rotationPointY != 0.0F || arm.rotationPointZ != 0.0F) GL11.glTranslatef(arm.rotationPointX * size, arm.rotationPointY * size, arm.rotationPointZ * size);
+ }else{
+ GL11.glTranslatef(arm.rotationPointX * size, arm.rotationPointY * size, arm.rotationPointZ * size);
+ if (arm.rotateAngleZ != 0.0F) GL11.glRotatef(arm.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F);
+ if (arm.rotateAngleY != 0.0F) GL11.glRotatef(arm.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F);
+ if (arm.rotateAngleX != 0.0F) GL11.glRotatef(arm.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F);
+ }
+ if (JewelryNBT.ingot(item) != null) ingot = JewelryNBT.ingotColor(item);
+ if (JewelryNBT.gem(item) != null) gem = JewelryNBT.gemColor(item);
+ if (no <= 4) GL11.glTranslatef(0.64F + 0.05F * no, -1.15F, 0.07F);
+ else GL11.glTranslatef(0.59F + 0.05F * no, -1.15F, 0.07F);
+ GL11.glScalef(0.1f, 0.15f, 0.1f);
+ ring.doRender(event.entityPlayer, 0F, 0F, (float)ingot, (float)gem, 0F);
+ GL11.glPopMatrix();
+ no++;
+ }
for(int i = 10; i <= 13; i++)
if (playerInfo.hasKey("ext" + i) && event.entityPlayer.getDisplayName().equals(player.getDisplayName())){
NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i);
@@ -102,8 +130,57 @@ public class PlayerRenderHandler
bracelet.doRender(event.entityPlayer, (float)ingotColor[2], (float)gemColor[2], (float)ingotColor[3], (float)gemColor[3], 0F);
GL11.glPopMatrix();
}
+ no = 0;
+ for(int i = 14; i <= 16; i++)
+ if (playerInfo.hasKey("ext" + i) && event.entityPlayer.getDisplayName().equals(player.getDisplayName())){
+ gem = -1;
+ ingot = -1;
+ NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i);
+ ItemStack item = ItemStack.loadItemStackFromNBT(nbt);
+ GL11.glPushMatrix();
+ if (body.rotateAngleX == 0.0F && body.rotateAngleY == 0.0F && body.rotateAngleZ == 0.0F){
+ if (body.rotationPointX != 0.0F || body.rotationPointY != 0.0F || body.rotationPointZ != 0.0F) GL11.glTranslatef(body.rotationPointX * size, body.rotationPointY * size, body.rotationPointZ * size);
+ }else{
+ GL11.glTranslatef(body.rotationPointX * size, body.rotationPointY * size, body.rotationPointZ * size);
+ if (body.rotateAngleZ != 0.0F) GL11.glRotatef(body.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F);
+ if (body.rotateAngleY != 0.0F) GL11.glRotatef(body.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F);
+ if (body.rotateAngleX != 0.0F) GL11.glRotatef(body.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F);
+ }
+ GL11.glScalef(0.0625f, 0.0625f, 0.0625f);
+ if (JewelryNBT.gem(item) != null) gem = JewelryNBT.gemColor(item);
+ if (JewelryNBT.ingot(item) != null) ingot = JewelryNBT.ingotColor(item);
+ if (no > 0){
+ GL11.glRotatef(no == 1 ? 25f : -25f, 0F, 0f, 1f);
+ GL11.glRotatef(no == 1 ? -5f : -10f, 1F, 0f, 0f);
+ }
+ necklace.doRender(event.entityPlayer, 0F, 0F, (float)ingot, (float)gem, 0F);
+ GL11.glPopMatrix();
+ no++;
+ }
+ if (playerInfo.hasKey("ext17") && event.entityPlayer.getDisplayName().equals(player.getDisplayName())){
+ gem = -1;
+ ingot = -1;
+ NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext17");
+ ItemStack item = ItemStack.loadItemStackFromNBT(nbt);
+ GL11.glPushMatrix();
+ if (head.rotateAngleX == 0.0F && head.rotateAngleY == 0.0F && head.rotateAngleZ == 0.0F){
+ if (head.rotationPointX != 0.0F || head.rotationPointY != 0.0F || head.rotationPointZ != 0.0F) GL11.glTranslatef(head.rotationPointX * size, head.rotationPointY * size, head.rotationPointZ * size);
+ }else{
+ GL11.glTranslatef(head.rotationPointX * size, head.rotationPointY * size, head.rotationPointZ * size);
+ if (head.rotateAngleZ != 0.0F) GL11.glRotatef(head.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F);
+ if (head.rotateAngleY != 0.0F) GL11.glRotatef(head.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F);
+ if (head.rotateAngleX != 0.0F) GL11.glRotatef(head.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F);
+ }
+ GL11.glScalef(0.0625f, 0.0625f, 0.0625f);
+ GL11.glTranslatef(0.0F, 1.0F, -2.0F);
+ if (JewelryNBT.gem(item) != null) gem = JewelryNBT.gemColor(item);
+ if (JewelryNBT.ingot(item) != null) ingot = JewelryNBT.ingotColor(item);
+ earrings.doRender(event.entityPlayer, 0F, 0F, (float)ingot, (float)gem, 0F);
+ GL11.glPopMatrix();
+ }
}
}
+ GL11.glPopMatrix();
}
float rot = 0F;
@@ -116,8 +193,7 @@ public class PlayerRenderHandler
if (player != null){
NBTTagCompound playerInfo = (NBTTagCompound)playersInfo.getTag(player.getDisplayName());
for(Curse curse: Curse.getCurseList())
- if (curse != null && playerInfo != null && playerInfo.hasKey(curse.getName()) && playerInfo.getInteger(curse.getName()) > 0 && playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0)
- curse.playerHandRender(player, event);
+ if (curse != null && playerInfo != null && playerInfo.hasKey(curse.getName()) && playerInfo.getInteger(curse.getName()) > 0 && playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0) curse.playerHandRender(player, event);
}
}
}