Use the player's head position to control the vertical movement when rainbooming. Fixes #9

This commit is contained in:
Sollace 2019-04-06 21:07:54 +02:00
parent 2f97a7ae69
commit a7d582f7cf

View file

@ -227,7 +227,7 @@ class PlayerGravityDelegate implements IUpdatable, IGravity, InbtSerialisable, I
entity.motionX += - forward * MathHelper.sin(entity.rotationYaw * 0.017453292F); entity.motionX += - forward * MathHelper.sin(entity.rotationYaw * 0.017453292F);
entity.motionZ += forward * MathHelper.cos(entity.rotationYaw * 0.017453292F); entity.motionZ += forward * MathHelper.cos(entity.rotationYaw * 0.017453292F);
entity.motionY += 0.3; entity.motionY += forward * MathHelper.sin(entity.rotationPitch * 0.017453292F);
if (!isRainbooming || entity.world.rand.nextInt(5) == 0) { if (!isRainbooming || entity.world.rand.nextInt(5) == 0) {
entity.playSound(SoundEvents.ENTITY_LIGHTNING_THUNDER, 1, 1); entity.playSound(SoundEvents.ENTITY_LIGHTNING_THUNDER, 1, 1);