Increase diff stability

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2023-09-22 02:57:13 +10:00
parent 8a3c8cfcd4
commit e903417936
27 changed files with 162 additions and 170 deletions

View File

@@ -25,7 +25,10 @@
+ org.bukkit.Location location = getBukkitEntity().getLocation();
+ location.setPitch(player.getLocation().getPitch());
+ location.setYaw(player.getLocation().getYaw());
+
- if (entityendermite != null) {
- entityendermite.moveTo(entity.getX(), entity.getY(), entity.getZ(), entity.getYRot(), entity.getXRot());
- this.level().addFreshEntity(entityendermite);
+ PlayerTeleportEvent teleEvent = new PlayerTeleportEvent(player, player.getLocation(), location, PlayerTeleportEvent.TeleportCause.ENDER_PEARL);
+ Bukkit.getPluginManager().callEvent(teleEvent);
+
@@ -37,13 +40,6 @@
+ entityendermite.moveTo(entity.getX(), entity.getY(), entity.getZ(), entity.getYRot(), entity.getXRot());
+ this.level().addFreshEntity(entityendermite, CreatureSpawnEvent.SpawnReason.ENDER_PEARL);
+ }
+ }
- if (entityendermite != null) {
- entityendermite.moveTo(entity.getX(), entity.getY(), entity.getZ(), entity.getYRot(), entity.getXRot());
- this.level().addFreshEntity(entityendermite);
+ if (entity.isPassenger()) {
+ entity.stopRiding();
}
- }
@@ -51,15 +47,19 @@
- entityplayer.dismountTo(this.getX(), this.getY(), this.getZ());
- } else {
- entity.teleportTo(this.getX(), this.getY(), this.getZ());
- }
+ if (entity.isPassenger()) {
+ entity.stopRiding();
+ }
- entity.resetFallDistance();
- entity.hurt(this.damageSources().fall(), 5.0F);
+ entityplayer.connection.teleport(teleEvent.getTo());
+ entity.resetFallDistance();
+ CraftEventFactory.entityDamage = this;
+ entity.hurt(this.damageSources().fall(), 5.0F);
+ CraftEventFactory.entityDamage = null;
}
-
- entity.resetFallDistance();
- entity.hurt(this.damageSources().fall(), 5.0F);
+ }
+ // CraftBukkit end
}
} else if (entity != null) {