2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Shane Freeder <theboyetronic@gmail.com>
|
|
|
|
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
|
2023-06-07 21:54:11 +02:00
|
|
|
index 9f685b4fe6d57d921e9e7a4d817e0913b863c0ad..11f9b40d0cfb77d69ecd2c7ef71dc409d1d79eba 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
2022-12-07 19:52:24 +01:00
|
|
|
@@ -225,9 +225,20 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
|
2021-06-11 14:02:28 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
// CraftBukkit end
|
|
|
|
+ // Paper start - EntityTeleportEndGatewayEvent - replicated from above
|
|
|
|
+ org.bukkit.craftbukkit.entity.CraftEntity bukkitEntity = entity.getBukkitEntity();
|
2023-05-12 13:10:08 +02:00
|
|
|
+ org.bukkit.Location location = new org.bukkit.Location(world.getWorld(), (double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 0.5D, (double) blockposition1.getZ() + 0.5D);
|
2021-06-11 14:02:28 +02:00
|
|
|
+ location.setPitch(bukkitEntity.getLocation().getPitch());
|
|
|
|
+ location.setYaw(bukkitEntity.getLocation().getYaw());
|
|
|
|
+
|
2021-10-02 19:21:49 +02:00
|
|
|
+ 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));
|
2021-06-11 14:02:28 +02:00
|
|
|
+ if (!event.callEvent()) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
|
|
|
|
entity1.setPortalCooldown();
|
2021-06-12 21:30:37 +02:00
|
|
|
- entity1.teleportToWithTicket((double) blockposition1.getX() + 0.5D, (double) blockposition1.getY(), (double) blockposition1.getZ() + 0.5D);
|
2021-06-11 14:02:28 +02:00
|
|
|
+ entity1.teleportToWithTicket(event.getTo().getX(), event.getTo().getY(), event.getTo().getZ()); // Paper
|
|
|
|
}
|
|
|
|
|
2021-06-12 21:30:37 +02:00
|
|
|
TheEndGatewayBlockEntity.triggerCooldown(world, pos, state, blockEntity);
|