Fixed the Trick Shot upgrade

This commit is contained in:
WayofTime 2016-05-22 12:09:36 -04:00
parent cebf71c329
commit aa3bef31c5
2 changed files with 21 additions and 7 deletions

View file

@ -1,3 +1,9 @@
------------------------------------------------------
Version 2.0.0-39
------------------------------------------------------
- Updated to 1.9.4!
- Fixed the Trick Shot upgrade
------------------------------------------------------ ------------------------------------------------------
Version 2.0.0-38 Version 2.0.0-38
------------------------------------------------------ ------------------------------------------------------

View file

@ -733,6 +733,11 @@ public class EventHandler
ItemStack stack = event.getBow(); ItemStack stack = event.getBow();
EntityPlayer player = event.getEntityPlayer(); EntityPlayer player = event.getEntityPlayer();
if (world.isRemote)
{
return;
}
if (LivingArmour.hasFullSet(player)) if (LivingArmour.hasFullSet(player))
{ {
ItemStack chestStack = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST); ItemStack chestStack = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST);
@ -761,10 +766,13 @@ public class EventHandler
int numberExtra = ((LivingArmourUpgradeArrowShot) upgrade).getExtraArrows(); int numberExtra = ((LivingArmourUpgradeArrowShot) upgrade).getExtraArrows();
for (int n = 0; n < numberExtra; n++) for (int n = 0; n < numberExtra; n++)
{ {
ItemArrow itemarrow = (ItemArrow) Items.ARROW; ItemStack arrowStack = new ItemStack(Items.ARROW);
EntityArrow entityarrow = itemarrow.createArrow(world, new ItemStack(Items.ARROW), player); ItemArrow itemarrow = (ItemArrow) ((ItemArrow) (stack.getItem() instanceof ItemArrow ? arrowStack.getItem() : Items.ARROW));
EntityArrow entityarrow = itemarrow.createArrow(world, arrowStack, player);
entityarrow.setAim(player, player.rotationPitch, player.rotationYaw, 0.0F, f * 3.0F, 1.0F);
float velocityModifier = 0.6f * f;
double velocityModifier = 0.6 * f;
entityarrow.motionX += (random.nextDouble() - 0.5) * velocityModifier; entityarrow.motionX += (random.nextDouble() - 0.5) * velocityModifier;
entityarrow.motionY += (random.nextDouble() - 0.5) * velocityModifier; entityarrow.motionY += (random.nextDouble() - 0.5) * velocityModifier;
entityarrow.motionZ += (random.nextDouble() - 0.5) * velocityModifier; entityarrow.motionZ += (random.nextDouble() - 0.5) * velocityModifier;
@ -793,12 +801,12 @@ public class EventHandler
entityarrow.setFire(100); entityarrow.setFire(100);
} }
entityarrow.pickupStatus = EntityArrow.PickupStatus.CREATIVE_ONLY; if (true)
if (!world.isRemote)
{ {
world.spawnEntityInWorld(entityarrow); entityarrow.pickupStatus = EntityArrow.PickupStatus.CREATIVE_ONLY;
} }
world.spawnEntityInWorld(entityarrow);
} }
} }
} }