mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-02 04:56:50 +01:00
a284e40c70
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 9b45fa2f #667: Allow setting BrewEvent results 8c776ddc SPIGOT-6762: ChatPaginator.wordWrap only transfers one modifier da372966 SPIGOT-4590, SPIGOT-6769: Clarify DamageCause documentation CraftBukkit Changes: cef1fda3 #947: Add missing spawn eggs for SpawnEggMeta eb9a0f34 #945: Allow setting BrewEvent results
47 lines
3 KiB
Diff
47 lines
3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
Date: Sun, 16 May 2021 09:39:46 -0700
|
|
Subject: [PATCH] Add back EntityPortalExitEvent
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
index 4f164f238177b5e2b18c76b7cc14596ec93409d1..e17bda0d13bae337cfad5ae31b118aa7a85499fc 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -3181,6 +3181,25 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
|
} else {
|
|
// CraftBukkit start
|
|
worldserver = shapedetectorshape.world;
|
|
+
|
|
+ // Paper start - Call EntityPortalExitEvent
|
|
+ CraftEntity bukkitEntity = this.getBukkitEntity();
|
|
+ Vec3 position = shapedetectorshape.pos;
|
|
+ float yaw = shapedetectorshape.yRot;
|
|
+ float pitch = bukkitEntity.getLocation().getPitch(); // Keep entity pitch as per moveTo line below
|
|
+ Vec3 velocity = shapedetectorshape.speed;
|
|
+ org.bukkit.event.entity.EntityPortalExitEvent event = new org.bukkit.event.entity.EntityPortalExitEvent(bukkitEntity,
|
|
+ bukkitEntity.getLocation(), new Location(worldserver.getWorld(), position.x, position.y, position.z, yaw, pitch),
|
|
+ bukkitEntity.getVelocity(), org.bukkit.craftbukkit.util.CraftVector.toBukkit(shapedetectorshape.speed));
|
|
+ if (event.callEvent() && event.getTo() != null && this.isAlive()) {
|
|
+ worldserver = ((CraftWorld) event.getTo().getWorld()).getHandle();
|
|
+ position = new Vec3(event.getTo().getX(), event.getTo().getY(), event.getTo().getZ());
|
|
+ yaw = event.getTo().getYaw();
|
|
+ pitch = event.getTo().getPitch();
|
|
+ velocity = org.bukkit.craftbukkit.util.CraftVector.toNMS(event.getAfter());
|
|
+ }
|
|
+ // Paper end
|
|
+
|
|
this.unRide();
|
|
// CraftBukkit end
|
|
|
|
@@ -3194,8 +3213,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
|
|
|
if (entity != null) {
|
|
entity.restoreFrom(this);
|
|
- entity.moveTo(shapedetectorshape.pos.x, shapedetectorshape.pos.y, shapedetectorshape.pos.z, shapedetectorshape.yRot, entity.getXRot());
|
|
- entity.setDeltaMovement(shapedetectorshape.speed);
|
|
+ entity.moveTo(position.x, position.y, position.z, yaw, pitch); // Paper - use EntityPortalExitEvent values
|
|
+ entity.setDeltaMovement(velocity); // Paper - use EntityPortalExitEvent values
|
|
worldserver.addDuringTeleport(entity);
|
|
if (worldserver.getTypeKey() == DimensionType.END_LOCATION) { // CraftBukkit
|
|
ServerLevel.makeObsidianPlatform(worldserver, this); // CraftBukkit
|