From 94473dbc557191b597bf68c2db65f05b397c2edf Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Fri, 14 May 2021 05:43:41 -0700 Subject: [PATCH] Call PortalCreateEvent when players enter the end (#5618) --- ...CreateEvent-players-and-end-platform.patch | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Spigot-Server-Patches/call-PortalCreateEvent-players-and-end-platform.patch diff --git a/Spigot-Server-Patches/call-PortalCreateEvent-players-and-end-platform.patch b/Spigot-Server-Patches/call-PortalCreateEvent-players-and-end-platform.patch new file mode 100644 index 0000000000..f152b79cea --- /dev/null +++ b/Spigot-Server-Patches/call-PortalCreateEvent-players-and-end-platform.patch @@ -0,0 +1,45 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic +Date: Wed, 12 May 2021 03:21:22 -0700 +Subject: [PATCH] call PortalCreateEvent players and end platform + + +diff --git a/src/main/java/net/minecraft/core/BlockPosition.java b/src/main/java/net/minecraft/core/BlockPosition.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/core/BlockPosition.java ++++ b/src/main/java/net/minecraft/core/BlockPosition.java +@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition { + return this.d(this.getX() + enumdirection.getAdjacentX() * i, this.getY() + enumdirection.getAdjacentY() * i, this.getZ() + enumdirection.getAdjacentZ() * i); + } + ++ public BlockPosition.MutableBlockPosition withOffset(int x, int y, int z) { return e(x, y, z); } // Paper - OBFHELPER + public BlockPosition.MutableBlockPosition e(int i, int j, int k) { + return this.d(this.getX() + i, this.getY() + j, this.getZ() + k); + } +diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java +@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + private void a(WorldServer worldserver, BlockPosition blockposition) { + BlockPosition.MutableBlockPosition blockposition_mutableblockposition = blockposition.i(); + ++ org.bukkit.craftbukkit.util.BlockStateListPopulator blockList = new org.bukkit.craftbukkit.util.BlockStateListPopulator(worldserver); // Paper + for (int i = -2; i <= 2; ++i) { + for (int j = -2; j <= 2; ++j) { + for (int k = -1; k < 3; ++k) { + IBlockData iblockdata = k == -1 ? Blocks.OBSIDIAN.getBlockData() : Blocks.AIR.getBlockData(); + +- worldserver.setTypeUpdate(blockposition_mutableblockposition.g(blockposition).e(j, k, i), iblockdata); ++ blockList.setTypeAndData(blockposition_mutableblockposition.setValues(blockposition).withOffset(j, k, i), iblockdata, 3); // Paper + } + } + } ++ // Paper start ++ if (new org.bukkit.event.world.PortalCreateEvent((List< org.bukkit.block.BlockState>) (List) blockList.getList(), worldserver.getWorld(), this.getBukkitEntity(), org.bukkit.event.world.PortalCreateEvent.CreateReason.END_PLATFORM).callEvent()) { ++ blockList.updateList(); ++ } ++ // Paper end + + } +