aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0203-Implement-EntityTeleportEndGatewayEvent.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0203-Implement-EntityTeleportEndGatewayEvent.patch')
-rw-r--r--patches/server/0203-Implement-EntityTeleportEndGatewayEvent.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/patches/server/0203-Implement-EntityTeleportEndGatewayEvent.patch b/patches/server/0203-Implement-EntityTeleportEndGatewayEvent.patch
new file mode 100644
index 0000000000..b1a4699bbc
--- /dev/null
+++ b/patches/server/0203-Implement-EntityTeleportEndGatewayEvent.patch
@@ -0,0 +1,32 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Shane Freeder <[email protected]>
+Date: Sat, 9 Jun 2018 14:08:39 +0200
+Subject: [PATCH] Implement EntityTeleportEndGatewayEvent
+
+
+diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
+index 8a65d379a67630967d07d97fdc528838453763a9..befd35b0edf4a76b119f711f8536369a02abc1ba 100644
+--- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
++++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
+@@ -224,9 +224,20 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
+
+ }
+ // CraftBukkit end
++ // Paper start - EntityTeleportEndGatewayEvent - replicated from above
++ org.bukkit.craftbukkit.entity.CraftEntity bukkitEntity = entity.getBukkitEntity();
++ org.bukkit.Location location = new Location(world.getWorld(), (double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 0.5D, (double) blockposition1.getZ() + 0.5D);
++ location.setPitch(bukkitEntity.getLocation().getPitch());
++ location.setYaw(bukkitEntity.getLocation().getYaw());
++
++ com.destroystokyo.paper.event.entity.EntityTeleportEndGatewayEvent event = new com.destroystokyo.paper.event.entity.EntityTeleportEndGatewayEvent(bukkitEntity, bukkitEntity.getLocation(), location, new org.bukkit.craftbukkit.block.CraftEndGateway(world.getWorld(), blockEntity));
++ if (!event.callEvent()) {
++ return;
++ }
++ // Paper end
+
+ entity1.setPortalCooldown();
+- entity1.teleportToWithTicket((double) blockposition1.getX() + 0.5D, (double) blockposition1.getY(), (double) blockposition1.getZ() + 0.5D);
++ entity1.teleportToWithTicket(event.getTo().getX(), event.getTo().getY(), event.getTo().getZ()); // Paper
+ }
+
+ TheEndGatewayBlockEntity.triggerCooldown(world, pos, state, blockEntity);