From d691bec84f88360e78f6d102c7eb3a3d030ec865 Mon Sep 17 00:00:00 2001 From: Zach Brown <1254957+zachbr@users.noreply.github.com> Date: Fri, 3 Aug 2018 03:26:10 -0500 Subject: [PATCH] Use correct update flag and blockdata for portals Fixes GH-1286 --- ...l-PortalCreateEvent-for-exit-portals.patch | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/Spigot-Server-Patches/Call-PortalCreateEvent-for-exit-portals.patch b/Spigot-Server-Patches/Call-PortalCreateEvent-for-exit-portals.patch index 1b64618e75..b1a4c90382 100644 --- a/Spigot-Server-Patches/Call-PortalCreateEvent-for-exit-portals.patch +++ b/Spigot-Server-Patches/Call-PortalCreateEvent-for-exit-portals.patch @@ -8,15 +8,6 @@ diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/mai index 402d8d7d6..ba8d15431 100644 --- a/src/main/java/net/minecraft/server/PortalTravelAgent.java +++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java -@@ -0,0 +0,0 @@ import org.bukkit.util.Vector; - - public class PortalTravelAgent { - -- private static final BlockPortal a = (BlockPortal) Blocks.NETHER_PORTAL; -+ private static final BlockPortal a = (BlockPortal) Blocks.NETHER_PORTAL; private static final BlockPortal PORTAL_BLOCK = a; // Paper - OBFHELPER - public final WorldServer world; // Paper - private -> public - private final Random c; - private final Long2ObjectMap d = new Long2ObjectOpenHashMap(4096); @@ -0,0 +0,0 @@ public class PortalTravelAgent { byte b0 = 1; byte b1 = 0; @@ -43,7 +34,7 @@ index 402d8d7d6..ba8d15431 100644 + // Paper start + org.bukkit.event.world.PortalCreateEvent event = new org.bukkit.event.world.PortalCreateEvent(bukkitBlocks, this.world.getWorld(), org.bukkit.event.world.PortalCreateEvent.CreateReason.OBC_DESTINATION); -+ if(event.callEvent()){ ++ if (event.callEvent()) { + nmsBlocks.forEach(this.world::setTypeUpdate); + } + // Paper end @@ -96,16 +87,16 @@ index 402d8d7d6..ba8d15431 100644 + + // Paper start + BlockPosition pos = new BlockPosition(blockposition_mutableblockposition.getX(), blockposition_mutableblockposition.getY(), blockposition_mutableblockposition.getZ()); -+ nmsBlocks.putIfAbsent(pos, PORTAL_BLOCK.getBlockData()); ++ nmsBlocks.putIfAbsent(pos, iblockdata); + bukkitBlocks.add(this.world.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ())); -+ // paper end ++ // Paper end } } + // Paper start + org.bukkit.event.world.PortalCreateEvent event = new org.bukkit.event.world.PortalCreateEvent(bukkitBlocks, this.world.getWorld(), org.bukkit.event.world.PortalCreateEvent.CreateReason.OBC_DESTINATION); -+ if(event.callEvent()){ -+ nmsBlocks.forEach((pos, data) -> this.world.setTypeAndData(pos, data, 2)); ++ if (event.callEvent()) { ++ nmsBlocks.forEach((pos, data) -> this.world.setTypeAndData(pos, data, 18)); // keep flag in sync with removed call above + } + // Paper end +