Initial 1.11.2 update
This commit is contained in:
@@ -15,32 +15,37 @@ import net.minecraft.world.World;
|
||||
|
||||
public class Glide extends Spell {
|
||||
|
||||
public Glide() {
|
||||
public Glide(){
|
||||
super(Tier.ADVANCED, 5, Element.EARTH, "glide", SpellType.UTILITY, 0, EnumAction.NONE, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean cast(World world, EntityPlayer caster, EnumHand hand, int ticksInUse, SpellModifiers modifiers) {
|
||||
|
||||
public boolean cast(World world, EntityPlayer caster, EnumHand hand, int ticksInUse, SpellModifiers modifiers){
|
||||
|
||||
if(caster.motionY < -0.1 && !caster.isInWater()){
|
||||
caster.motionY = -0.1;
|
||||
if(Math.abs(caster.motionX) < 0.4 && Math.abs(caster.motionZ) < 0.4){
|
||||
caster.addVelocity(caster.getLookVec().xCoord/8, 0, caster.getLookVec().zCoord/8);
|
||||
//entityplayer.moveEntity(entityplayer.motionX*10, 0, entityplayer.motionZ*10);
|
||||
caster.addVelocity(caster.getLookVec().xCoord / 8, 0, caster.getLookVec().zCoord / 8);
|
||||
// entityplayer.moveEntity(entityplayer.motionX*10, 0, entityplayer.motionZ*10);
|
||||
}
|
||||
caster.fallDistance = 0.0f;
|
||||
}
|
||||
|
||||
|
||||
if(world.isRemote){
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, caster.posX - 0.25d + world.rand.nextDouble()/2, WizardryUtilities.getPlayerEyesPos(caster) - 1.5f + world.rand.nextDouble(), caster.posZ - 0.25d + world.rand.nextDouble()/2, 0, -0.1F, 0, 15, 1.0f, 1.0f, 1.0f);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.LEAF, world, caster.posX - 0.25d + world.rand.nextDouble()/2, WizardryUtilities.getPlayerEyesPos(caster) - 1.5f + world.rand.nextDouble(), caster.posZ - 0.25d + world.rand.nextDouble()/2, 0, -0.03, 0, 20);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world,
|
||||
caster.posX - 0.25d + world.rand.nextDouble() / 2,
|
||||
WizardryUtilities.getPlayerEyesPos(caster) - 1.5f + world.rand.nextDouble(),
|
||||
caster.posZ - 0.25d + world.rand.nextDouble() / 2, 0, -0.1F, 0, 15, 1.0f, 1.0f, 1.0f);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.LEAF, world,
|
||||
caster.posX - 0.25d + world.rand.nextDouble() / 2,
|
||||
WizardryUtilities.getPlayerEyesPos(caster) - 1.5f + world.rand.nextDouble(),
|
||||
caster.posZ - 0.25d + world.rand.nextDouble() / 2, 0, -0.03, 0, 20);
|
||||
}
|
||||
|
||||
|
||||
if(ticksInUse % 24 == 0){
|
||||
WizardryUtilities.playSoundAtPlayer(caster, SoundEvents.ITEM_ELYTRA_FLYING, 0.5F, 1.0f);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user