mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 03:52:45 +01:00
Put forceChunkLoad back to its original value.
By: Travis Watkins <amaranth@ubuntu.com>
This commit is contained in:
parent
7383d52df7
commit
bf9001a3d3
1 changed files with 8 additions and 2 deletions
|
@ -24,7 +24,10 @@ public class PortalTravelAgent implements TravelAgent {
|
||||||
|
|
||||||
public Location findOrCreate(Location location) {
|
public Location findOrCreate(Location location) {
|
||||||
WorldServer worldServer = ((CraftWorld) location.getWorld()).getHandle();
|
WorldServer worldServer = ((CraftWorld) location.getWorld()).getHandle();
|
||||||
|
boolean wasEnabled = worldServer.chunkProviderServer.forceChunkLoad;
|
||||||
|
if (!wasEnabled) {
|
||||||
worldServer.chunkProviderServer.forceChunkLoad = true;
|
worldServer.chunkProviderServer.forceChunkLoad = true;
|
||||||
|
}
|
||||||
// Attempt to find a Portal.
|
// Attempt to find a Portal.
|
||||||
Location resultLocation = this.findPortal(location);
|
Location resultLocation = this.findPortal(location);
|
||||||
// If a Portal cannot be found we will attempt to create one.
|
// If a Portal cannot be found we will attempt to create one.
|
||||||
|
@ -38,7 +41,10 @@ public class PortalTravelAgent implements TravelAgent {
|
||||||
resultLocation = location;
|
resultLocation = location;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!wasEnabled) {
|
||||||
worldServer.chunkProviderServer.forceChunkLoad = false;
|
worldServer.chunkProviderServer.forceChunkLoad = false;
|
||||||
|
}
|
||||||
// Return our resulting portal location.
|
// Return our resulting portal location.
|
||||||
return resultLocation;
|
return resultLocation;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue