Fix Entity Teleportation and cancel velocity if teleported

Uses correct setPositionRotation for Entity teleporting instead of setLocation
as this is how Vanilla teleports entities.

Cancel any pending motion when teleported.
This commit is contained in:
Aikar
2020-08-25 20:45:36 -04:00
parent 74de6853f4
commit aebf9e869b
6 changed files with 144 additions and 109 deletions

View File

@@ -1,8 +1,10 @@
--- a/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java
+++ b/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java
@@ -80,7 +80,9 @@
@@ -79,8 +79,11 @@
}
DragonFireball dragonFireball = new DragonFireball(world, this.dragon, vec34.normalize());
+ dragonFireball.preserveMotion = true; // Paper - Fix Entity Teleportation and cancel velocity if teleported
dragonFireball.moveTo(o, p, q, 0.0F, 0.0F);
+ if (new com.destroystokyo.paper.event.entity.EnderDragonShootFireballEvent((org.bukkit.entity.EnderDragon) dragon.getBukkitEntity(), (org.bukkit.entity.DragonFireball) dragonFireball.getBukkitEntity()).callEvent()) // Paper - EnderDragon Events
world.addFreshEntity(dragonFireball);