aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0126-PlayerTeleportEndGatewayEvent.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0126-PlayerTeleportEndGatewayEvent.patch')
-rw-r--r--patches/server/0126-PlayerTeleportEndGatewayEvent.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/patches/server/0126-PlayerTeleportEndGatewayEvent.patch b/patches/server/0126-PlayerTeleportEndGatewayEvent.patch
new file mode 100644
index 0000000000..b63f7764ee
--- /dev/null
+++ b/patches/server/0126-PlayerTeleportEndGatewayEvent.patch
@@ -0,0 +1,26 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Aikar <[email protected]>
+Date: Sat, 31 Dec 2016 21:44:50 -0500
+Subject: [PATCH] PlayerTeleportEndGatewayEvent
+
+Allows you to access the Gateway being used in a teleport event
+Fix the offset used for player teleportation
+
+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 45aca9747557a94ac3e60ee9f23c30abb2367bff..9690416c2ffa7d1b7607d21ae0a990dcbcbcddae 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
+@@ -202,11 +202,11 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
+ // CraftBukkit start - Fire PlayerTeleportEvent/EntityTeleportEvent
+ if (entity1 instanceof ServerPlayer) {
+ org.bukkit.craftbukkit.entity.CraftPlayer player = (CraftPlayer) entity1.getBukkitEntity();
+- org.bukkit.Location location = CraftLocation.toBukkit(blockposition1, world.getWorld()).add(0.5D, 0.5D, 0.5D);
++ org.bukkit.Location location = CraftLocation.toBukkit(blockposition1, world.getWorld()).add(0.5D, 0, 0.5D); // Paper - use the right Y offset
+ location.setPitch(player.getLocation().getPitch());
+ location.setYaw(player.getLocation().getYaw());
+
+- PlayerTeleportEvent teleEvent = new PlayerTeleportEvent(player, player.getLocation(), location, PlayerTeleportEvent.TeleportCause.END_GATEWAY);
++ PlayerTeleportEvent teleEvent = new com.destroystokyo.paper.event.player.PlayerTeleportEndGatewayEvent(player, player.getLocation(), location, new org.bukkit.craftbukkit.block.CraftEndGateway(worldserver.getWorld(), blockEntity)); // Paper
+ Bukkit.getPluginManager().callEvent(teleEvent);
+ if (teleEvent.isCancelled()) {
+ return;