From bf9001a3d3b37c3cfe55e0393b3defc78d4fec19 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sun, 5 Aug 2012 20:03:12 -0500 Subject: [PATCH] Put forceChunkLoad back to its original value. By: Travis Watkins --- .../java/org/bukkit/craftbukkit/PortalTravelAgent.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/PortalTravelAgent.java b/paper-server/src/main/java/org/bukkit/craftbukkit/PortalTravelAgent.java index f1d2cd3ac9..47a3c78735 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/PortalTravelAgent.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/PortalTravelAgent.java @@ -24,7 +24,10 @@ public class PortalTravelAgent implements TravelAgent { public Location findOrCreate(Location location) { WorldServer worldServer = ((CraftWorld) location.getWorld()).getHandle(); - worldServer.chunkProviderServer.forceChunkLoad = true; + boolean wasEnabled = worldServer.chunkProviderServer.forceChunkLoad; + if (!wasEnabled) { + worldServer.chunkProviderServer.forceChunkLoad = true; + } // Attempt to find a Portal. Location resultLocation = this.findPortal(location); // If a Portal cannot be found we will attempt to create one. @@ -38,7 +41,10 @@ public class PortalTravelAgent implements TravelAgent { resultLocation = location; } } - worldServer.chunkProviderServer.forceChunkLoad = false; + + if (!wasEnabled) { + worldServer.chunkProviderServer.forceChunkLoad = false; + } // Return our resulting portal location. return resultLocation; }