From 2f0ed920d403af4e64fa1d00a50c748154e2ea55 Mon Sep 17 00:00:00 2001 From: WayofTime Date: Sat, 1 Nov 2014 10:21:03 -0400 Subject: [PATCH] Fixing Leap ritual. --- .../AlchemicalWizardry.java | 2 +- .../common/rituals/RitualEffectLeap.java | 56 ++++++++++++++----- 2 files changed, 44 insertions(+), 14 deletions(-) diff --git a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java index 6720ccfa..dfded2c6 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java @@ -65,7 +65,7 @@ import WayofTime.alchemicalWizardry.common.items.thaumcraft.ItemSanguineArmour; import WayofTime.alchemicalWizardry.common.potion.*; import WayofTime.alchemicalWizardry.common.renderer.AlchemyCircleRenderer; import WayofTime.alchemicalWizardry.common.rituals.*; -import WayofTime.alchemicalWizardry.common.spell.simple.* +import WayofTime.alchemicalWizardry.common.spell.simple.*; import WayofTime.alchemicalWizardry.common.summoning.SummoningHelperAW; import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorRegistry; import WayofTime.alchemicalWizardry.common.tileEntity.*; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLeap.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLeap.java index 95712054..baa711cd 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLeap.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLeap.java @@ -79,24 +79,54 @@ public class RitualEffectLeap extends RitualEffect livingEntity.motionY = motionY; livingEntity.fallDistance = 0; - switch (direction) + if(livingEntity instanceof EntityPlayer) { - case 1: - SpellHelper.setPlayerSpeedFromServer((EntityPlayer) livingEntity, 0, motionY, -speed); - break; + switch (direction) + { + case 1: + SpellHelper.setPlayerSpeedFromServer((EntityPlayer) livingEntity, 0, motionY, -speed); + break; - case 2: - SpellHelper.setPlayerSpeedFromServer((EntityPlayer) livingEntity, speed, motionY, 0); - break; + case 2: + SpellHelper.setPlayerSpeedFromServer((EntityPlayer) livingEntity, speed, motionY, 0); + break; - case 3: - SpellHelper.setPlayerSpeedFromServer((EntityPlayer) livingEntity, 0, motionY, speed); - break; + case 3: + SpellHelper.setPlayerSpeedFromServer((EntityPlayer) livingEntity, 0, motionY, speed); + break; - case 4: - SpellHelper.setPlayerSpeedFromServer((EntityPlayer) livingEntity, -speed, motionY, 0); - break; + case 4: + SpellHelper.setPlayerSpeedFromServer((EntityPlayer) livingEntity, -speed, motionY, 0); + break; + } + }else + { + livingEntity.motionY = motionY; + + switch (direction) + { + case 1: + livingEntity.motionX = 0.0; + livingEntity.motionZ = -speed; + break; + + case 2: + livingEntity.motionX = speed; + livingEntity.motionZ = 0.0; + break; + + case 3: + livingEntity.motionX = 0.0; + livingEntity.motionZ = -speed; + break; + + case 4: + livingEntity.motionX = -speed; + livingEntity.motionZ = 0.0; + break; + } } + flag++; } else