Fixed the Speed and Jump rituals so that they correctly update the player's motion

This commit is contained in:
WayofTime 2016-04-13 11:05:17 -04:00
parent 81e9452a21
commit c0b39039cc
6 changed files with 115 additions and 29 deletions

View file

@ -4,6 +4,7 @@ import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.network.SoulNetwork;
import WayofTime.bloodmagic.api.ritual.*;
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
import WayofTime.bloodmagic.util.Utils;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
@ -53,20 +54,18 @@ public class RitualJumping extends Ritual
double motionY = 1.5;
if (entity instanceof EntityPlayer && entity instanceof EntityPlayerMP)
entity.fallDistance = 0;
if (entity.isSneaking())
{
((EntityPlayerMP) entity).fallDistance = 0;
if (entity.isSneaking())
continue;
((EntityPlayerMP) entity).motionY = motionY;
totalEffects++;
} else
continue;
}
entity.motionY = motionY;
totalEffects++;
if (entity instanceof EntityPlayer)
{
entity.fallDistance = 0;
if (entity.isSneaking())
continue;
entity.motionY = motionY;
totalEffects++;
Utils.setPlayerSpeedFromServer((EntityPlayer) entity, entity.motionX, entity.motionY, entity.motionZ);
}
}
}

View file

@ -1,15 +1,21 @@
package WayofTime.bloodmagic.ritual;
import java.util.ArrayList;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.network.SoulNetwork;
import WayofTime.bloodmagic.api.ritual.*;
import WayofTime.bloodmagic.api.ritual.AreaDescriptor;
import WayofTime.bloodmagic.api.ritual.EnumRuneType;
import WayofTime.bloodmagic.api.ritual.IMasterRitualStone;
import WayofTime.bloodmagic.api.ritual.Ritual;
import WayofTime.bloodmagic.api.ritual.RitualComponent;
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import java.util.ArrayList;
import WayofTime.bloodmagic.util.Utils;
public class RitualSpeed extends Ritual
{
@ -78,6 +84,10 @@ public class RitualSpeed extends Ritual
break;
}
if (entity instanceof EntityPlayer)
{
Utils.setPlayerSpeedFromServer((EntityPlayer) entity, entity.motionX, entity.motionY, entity.motionZ);
}
}
}