2018-12-15 01:17:27 +00:00
|
|
|
From 0d412c9b25938e45fff9bb813e6f9edd9cae9c51 Mon Sep 17 00:00:00 2001
|
2018-06-09 13:21:40 +00:00
|
|
|
From: Shane Freeder <theboyetronic@gmail.com>
|
2018-06-13 21:29:49 +00:00
|
|
|
Date: Sat, 9 Jun 2018 14:08:39 +0200
|
2018-06-09 13:21:40 +00:00
|
|
|
Subject: [PATCH] Implement EntityTeleportEndGatewayEvent
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/TileEntityEndGateway.java b/src/main/java/net/minecraft/server/TileEntityEndGateway.java
|
2018-12-15 01:17:27 +00:00
|
|
|
index af71c7c48..8b52a25ec 100644
|
2018-06-09 13:21:40 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/TileEntityEndGateway.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/TileEntityEndGateway.java
|
2018-07-18 23:16:19 +00:00
|
|
|
@@ -138,8 +138,19 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick
|
2018-06-09 13:21:40 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
// 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) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.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(MCUtil.toLocation(world, this.getPosition()).getBlock()));
|
2018-06-13 21:29:49 +00:00
|
|
|
+ if (!event.callEvent()) {
|
2018-06-09 13:21:40 +00:00
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- entity.enderTeleportTo((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D);
|
|
|
|
+ entity.enderTeleportTo(event.getTo().getX(), event.getTo().getY(), event.getTo().getZ());
|
|
|
|
+ // Paper end - EntityTeleportEndGatewayEvent
|
|
|
|
}
|
|
|
|
|
2018-07-18 23:16:19 +00:00
|
|
|
this.f();
|
2018-06-09 13:21:40 +00:00
|
|
|
--
|
2018-12-15 01:17:27 +00:00
|
|
|
2.20.0
|
2018-06-09 13:21:40 +00:00
|
|
|
|