2020-05-06 09:48:49 +00:00
|
|
|
From 0000000000000000000000000000000000000000 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
|
|
|
|
|
|
|
|
|
2021-03-16 07:19:45 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java
|
|
|
|
index 8f2db48201925f4a5dac5dfc19bb2b96438959e1..1d90cb32560a9102ebe43dfa9806b407d0ee1bd1 100644
|
|
|
|
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java
|
|
|
|
@@ -193,9 +193,20 @@ 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;
|
|
|
|
+ }
|
2020-08-25 02:22:08 +00:00
|
|
|
+ // Paper end
|
2018-06-09 13:21:40 +00:00
|
|
|
|
2020-08-25 02:22:08 +00:00
|
|
|
entity1.resetPortalCooldown();
|
2020-06-25 14:09:55 +00:00
|
|
|
- entity1.enderTeleportAndLoad((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D);
|
2020-08-25 02:22:08 +00:00
|
|
|
+ entity1.enderTeleportAndLoad(event.getTo().getX(), event.getTo().getY(), event.getTo().getZ()); // Paper
|
2018-06-09 13:21:40 +00:00
|
|
|
}
|
|
|
|
|
2019-05-27 23:01:45 +00:00
|
|
|
this.h();
|