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>
<groupId>com.wimbli.WorldBorder</groupId>
<artifactId>WorldBorder</artifactId>
<version>1.9.0</version>
<version>1.9.9 (beta)</version>
<name>WorldBorder</name>
<url>https://github.com/Brettflan/WorldBorder</url>
<issueManagement>

View File

@ -1,6 +1,9 @@
package com.wimbli.WorldBorder;
import java.util.concurrent.CompletableFuture;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.bukkit.Bukkit;
@ -9,12 +12,10 @@ import org.bukkit.entity.Player;
import org.bukkit.Server;
import org.bukkit.World;
import io.papermc.lib.PaperLib;
import com.wimbli.WorldBorder.Events.WorldBorderFillFinishedEvent;
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
@ -83,9 +84,8 @@ public class WorldFillTask implements Runnable
public boolean equals(Object other)
{
if (other == null || !(other instanceof UnloadDependency))
{
return false;
}
return this.neededX == ((UnloadDependency) other).neededX
&& this.neededZ == ((UnloadDependency) other).neededZ
&& this.forX == ((UnloadDependency) other).forX
@ -222,10 +222,8 @@ public class WorldFillTask implements Runnable
chunksToUnload.add(xz);
}
else
{
newPendingChunks.put(cf, pendingChunks.get(cf));
}
}
pendingChunks = newPendingChunks;
// 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)
{
if (worldData.doesChunkExist(dependency.forX, dependency.forZ))
{
chunksToUnload.add(new CoordXZ(dependency.neededX, dependency.neededZ));
}
else
{
newPreventUnload.add(dependency);
}
}
preventUnload = newPreventUnload;
// 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)
{
if (!chunkOnUnloadPreventionList(unload.x, unload.z))
{
world.unloadChunkRequest(unload.x, unload.z);
}
}
// 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
@ -278,9 +270,7 @@ public class WorldFillTask implements Runnable
{
// in case the task has been paused while we're repeating...
if (paused || pausedForMemory)
{
return;
}
long now = Config.Now();
@ -299,10 +289,8 @@ public class WorldFillTask implements Runnable
while (!border.insideBorder(CoordXZ.chunkToBlock(x) + 8, CoordXZ.chunkToBlock(z) + 8))
{
if (!moveToNext())
{
return;
}
}
insideBorder = true;
if (!forceLoad)
@ -314,9 +302,8 @@ public class WorldFillTask implements Runnable
rLoop++;
insideBorder = true;
if (!moveToNext())
{
return;
}
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
readyToGo = true;
@ -341,10 +328,8 @@ public class WorldFillTask implements Runnable
// move on to next chunk
if (!moveToNext())
{
return;
}
}
// ready for the next iteration to run
readyToGo = true;
}
@ -502,11 +487,9 @@ public class WorldFillTask implements Runnable
for (UnloadDependency entry: preventUnload)
{
if (entry.neededX == x && entry.neededZ == z)
{
return true;
}
}
}
return false;
}

View File

@ -1,7 +1,7 @@
name: WorldBorder
author: Brettflan
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
main: com.wimbli.WorldBorder.WorldBorder
softdepend: