From f07b7cca04572a2ab1aa8e2210e0fc47e676eef6 Mon Sep 17 00:00:00 2001 From: Roger Schoellgen Date: Fri, 21 Jun 2013 19:56:20 -0700 Subject: [PATCH] when used in the air, it will make the player go in the direction of the current motion --- common/MysticWorld/Items/ItemOrbAir.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/MysticWorld/Items/ItemOrbAir.java b/common/MysticWorld/Items/ItemOrbAir.java index c23f185..1461680 100644 --- a/common/MysticWorld/Items/ItemOrbAir.java +++ b/common/MysticWorld/Items/ItemOrbAir.java @@ -14,7 +14,7 @@ public class ItemOrbAir extends Item { { super(par1); this.setMaxStackSize(1); - this.setMaxDamage(300); + this.setMaxDamage(500); this.setCreativeTab(MysticWorld.MysticWorldTab); } @@ -22,10 +22,12 @@ public class ItemOrbAir extends Item { { world.playSoundEffect(entityPlayer.posX, entityPlayer.posY, entityPlayer.posZ, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); + double f3 = MathHelper.sqrt_double(entityPlayer.motionX * entityPlayer.motionX + entityPlayer.motionZ * entityPlayer.motionZ); + if (entityPlayer.onGround) entityPlayer.addVelocity(0, 2.5, 0); else - entityPlayer.addVelocity(0, 0.5, 0); + entityPlayer.addVelocity(entityPlayer.motionX * (double)2 * 0.6000000238418579D / (double)f3, 0.5, entityPlayer.motionZ * (double)2 * 0.6000000238418579D / (double)f3); if (!world.isRemote) {