Release 1.9.9 (beta)

This commit is contained in:
Brettflan 2019-04-30 21:00:33 -05:00
parent 8258963fd7
commit 179d1cfda3
3 changed files with 9 additions and 26 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.wimbli.WorldBorder</groupId> <groupId>com.wimbli.WorldBorder</groupId>
<artifactId>WorldBorder</artifactId> <artifactId>WorldBorder</artifactId>
<version>1.9.0</version> <version>1.9.9 (beta)</version>
<name>WorldBorder</name> <name>WorldBorder</name>
<url>https://github.com/Brettflan/WorldBorder</url> <url>https://github.com/Brettflan/WorldBorder</url>
<issueManagement> <issueManagement>

View File

@ -1,6 +1,9 @@
package com.wimbli.WorldBorder; package com.wimbli.WorldBorder;
import java.util.concurrent.CompletableFuture;
import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Map;
import java.util.Set; import java.util.Set;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@ -9,12 +12,10 @@ import org.bukkit.entity.Player;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.World; import org.bukkit.World;
import io.papermc.lib.PaperLib;
import com.wimbli.WorldBorder.Events.WorldBorderFillFinishedEvent; import com.wimbli.WorldBorder.Events.WorldBorderFillFinishedEvent;
import com.wimbli.WorldBorder.Events.WorldBorderFillStartEvent; import com.wimbli.WorldBorder.Events.WorldBorderFillStartEvent;
import io.papermc.lib.PaperLib;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
public class WorldFillTask implements Runnable public class WorldFillTask implements Runnable
@ -83,9 +84,8 @@ public class WorldFillTask implements Runnable
public boolean equals(Object other) public boolean equals(Object other)
{ {
if (other == null || !(other instanceof UnloadDependency)) if (other == null || !(other instanceof UnloadDependency))
{
return false; return false;
}
return this.neededX == ((UnloadDependency) other).neededX return this.neededX == ((UnloadDependency) other).neededX
&& this.neededZ == ((UnloadDependency) other).neededZ && this.neededZ == ((UnloadDependency) other).neededZ
&& this.forX == ((UnloadDependency) other).forX && this.forX == ((UnloadDependency) other).forX
@ -222,10 +222,8 @@ public class WorldFillTask implements Runnable
chunksToUnload.add(xz); chunksToUnload.add(xz);
} }
else else
{
newPendingChunks.put(cf, pendingChunks.get(cf)); newPendingChunks.put(cf, pendingChunks.get(cf));
} }
}
pendingChunks = newPendingChunks; pendingChunks = newPendingChunks;
// Next, check which chunks had been loaded because a to-be-generated // Next, check which chunks had been loaded because a to-be-generated
@ -234,14 +232,10 @@ public class WorldFillTask implements Runnable
for (UnloadDependency dependency: preventUnload) for (UnloadDependency dependency: preventUnload)
{ {
if (worldData.doesChunkExist(dependency.forX, dependency.forZ)) if (worldData.doesChunkExist(dependency.forX, dependency.forZ))
{
chunksToUnload.add(new CoordXZ(dependency.neededX, dependency.neededZ)); chunksToUnload.add(new CoordXZ(dependency.neededX, dependency.neededZ));
}
else else
{
newPreventUnload.add(dependency); newPreventUnload.add(dependency);
} }
}
preventUnload = newPreventUnload; preventUnload = newPreventUnload;
// Unload all chunks that aren't needed anymore. NB a chunk could have // Unload all chunks that aren't needed anymore. NB a chunk could have
@ -253,10 +247,8 @@ public class WorldFillTask implements Runnable
for (CoordXZ unload: chunksToUnload) for (CoordXZ unload: chunksToUnload)
{ {
if (!chunkOnUnloadPreventionList(unload.x, unload.z)) if (!chunkOnUnloadPreventionList(unload.x, unload.z))
{
world.unloadChunkRequest(unload.x, unload.z); world.unloadChunkRequest(unload.x, unload.z);
} }
}
// Put some damper on chunksPerRun. We don't want the queue to be too // Put some damper on chunksPerRun. We don't want the queue to be too
// full; only fill it to a bit more than what we can // full; only fill it to a bit more than what we can
@ -278,9 +270,7 @@ public class WorldFillTask implements Runnable
{ {
// in case the task has been paused while we're repeating... // in case the task has been paused while we're repeating...
if (paused || pausedForMemory) if (paused || pausedForMemory)
{
return; return;
}
long now = Config.Now(); long now = Config.Now();
@ -299,10 +289,8 @@ public class WorldFillTask implements Runnable
while (!border.insideBorder(CoordXZ.chunkToBlock(x) + 8, CoordXZ.chunkToBlock(z) + 8)) while (!border.insideBorder(CoordXZ.chunkToBlock(x) + 8, CoordXZ.chunkToBlock(z) + 8))
{ {
if (!moveToNext()) if (!moveToNext())
{
return; return;
} }
}
insideBorder = true; insideBorder = true;
if (!forceLoad) if (!forceLoad)
@ -314,9 +302,8 @@ public class WorldFillTask implements Runnable
rLoop++; rLoop++;
insideBorder = true; insideBorder = true;
if (!moveToNext()) if (!moveToNext())
{
return; return;
}
if (rLoop > 255) if (rLoop > 255)
{ // only skim through max 256 chunks (~8 region files) at a time here, to allow process to take a break if needed { // only skim through max 256 chunks (~8 region files) at a time here, to allow process to take a break if needed
readyToGo = true; readyToGo = true;
@ -341,10 +328,8 @@ public class WorldFillTask implements Runnable
// move on to next chunk // move on to next chunk
if (!moveToNext()) if (!moveToNext())
{
return; return;
} }
}
// ready for the next iteration to run // ready for the next iteration to run
readyToGo = true; readyToGo = true;
} }
@ -502,11 +487,9 @@ public class WorldFillTask implements Runnable
for (UnloadDependency entry: preventUnload) for (UnloadDependency entry: preventUnload)
{ {
if (entry.neededX == x && entry.neededZ == z) if (entry.neededX == x && entry.neededZ == z)
{
return true; return true;
} }
} }
}
return false; return false;
} }

View File

@ -1,7 +1,7 @@
name: WorldBorder name: WorldBorder
author: Brettflan author: Brettflan
description: Efficient, feature-rich plugin for limiting the size of your worlds. description: Efficient, feature-rich plugin for limiting the size of your worlds.
version: 1.9.0 version: 1.9.9 (beta)
api-version: 1.13 api-version: 1.13
main: com.wimbli.WorldBorder.WorldBorder main: com.wimbli.WorldBorder.WorldBorder
softdepend: softdepend: