mirror of
https://github.com/PryPurity/WorldBorder.git
synced 2025-02-16 01:02:21 +01:00
Still debugging.
This commit is contained in:
parent
c1969b3f7a
commit
e7ee143e22
6
pom.xml
6
pom.xml
@ -43,12 +43,6 @@
|
||||
<version>2.5</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.papermc</groupId>
|
||||
<artifactId>paperlib</artifactId>
|
||||
<version>1.0.4</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.destroystokyo.paper</groupId>
|
||||
<artifactId>paper-api</artifactId>
|
||||
|
@ -285,12 +285,11 @@ public class BorderData {
|
||||
|
||||
if (X < DefiniteRectangleX && Z < DefiniteRectangleZ)
|
||||
return true; // Definitely inside
|
||||
else if (X >= radiusX || Z >= radiusZ)
|
||||
return false; // Definitely outside
|
||||
else if (X * X + Z * Z * radiusSquaredQuotient < radiusXSquared)
|
||||
return true; // After further calculation, inside
|
||||
else
|
||||
return false; // Apparently outside, then
|
||||
else // Apparently outside, then
|
||||
if (X >= radiusX || Z >= radiusZ)
|
||||
return false; // Definitely outside
|
||||
else
|
||||
return X * X + Z * Z * radiusSquaredQuotient < radiusXSquared; // After further calculation, inside
|
||||
}
|
||||
}
|
||||
|
||||
@ -408,7 +407,7 @@ public class BorderData {
|
||||
|
||||
// if Y is larger than the world can be and user can fly, return Y - Unless we are in the Nether, we might not want players on the roof
|
||||
if (flying && Y > limTop && !isNether)
|
||||
return (double) Y;
|
||||
return Y;
|
||||
|
||||
// make sure Y values are within the boundaries of the world.
|
||||
if (Y > limTop) {
|
||||
@ -433,13 +432,13 @@ public class BorderData {
|
||||
// Look below.
|
||||
if (y1 > limBot) {
|
||||
if (isSafeSpot(world, X, y1, Z, flying))
|
||||
return (double) y1;
|
||||
return y1;
|
||||
}
|
||||
|
||||
// Look above.
|
||||
if (y2 < limTop && y2 != y1) {
|
||||
if (isSafeSpot(world, X, y2, Z, flying))
|
||||
return (double) y2;
|
||||
return y2;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -161,7 +161,7 @@ public class WorldFillTask implements Runnable {
|
||||
Set<CoordXZ> chunksToUnload = new HashSet<>();
|
||||
for (CompletableFuture<Void> cf : pendingChunks.keySet()) {
|
||||
if (cf.isDone()) {
|
||||
++chunksProcessedLastTick;
|
||||
chunksProcessedLastTick++;
|
||||
// If cf.get() returned the chunk reliably, pendingChunks could
|
||||
// be a set and we wouldn't have to map CFs to coords ...
|
||||
CoordXZ xz = pendingChunks.get(cf);
|
||||
@ -224,6 +224,7 @@ public class WorldFillTask implements Runnable {
|
||||
|
||||
// if this iteration has been running for 45ms (almost 1 tick) or more, stop to take a breather
|
||||
if (now > loopStartTime + 45) {
|
||||
System.out.println("PAUSED FOR DEBUG");
|
||||
readyToGo = true;
|
||||
return;
|
||||
}
|
||||
@ -251,7 +252,7 @@ public class WorldFillTask implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
// pendingChunks.put(getPaperLibChunk(world, x, z, true), new CoordXZ(x, z));
|
||||
// pendingChunks.put(getPaperLibChunk(world, x, z, true), new CoordXZ(x, z));
|
||||
|
||||
// There need to be enough nearby chunks loaded to make the server populate a chunk with trees, snow, etc.
|
||||
// So, we keep the last few chunks loaded, and need to also temporarily load an extra inside chunk (neighbor closest to center of map)
|
||||
|
@ -50,7 +50,7 @@ public class CmdCommands extends WBCmd {
|
||||
// send page footer, if relevant; manual spacing to get right side lined up near edge is crude, but sufficient
|
||||
String footer = C_HEAD + " (Page " + page + "/" + pageCount + ") " + cmd(sender);
|
||||
if (page < pageCount)
|
||||
sender.sendMessage(footer + Integer.toString(page + 1) + C_DESC + " - view next page of commands.");
|
||||
sender.sendMessage(footer + (page + 1) + C_DESC + " - view next page of commands.");
|
||||
else if (page > 1)
|
||||
sender.sendMessage(footer + C_DESC + "- view first page of commands.");
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user