mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-04 14:44:43 +02:00
Compare commits
6 Commits
7.5.0
...
fix/IOOBE-
Author | SHA1 | Date | |
---|---|---|---|
9127e472b8 | |||
a0a3d8828a | |||
8741bfcf88 | |||
6a6c113e5b | |||
3f573b4d46 | |||
2f6db9c3db |
@ -134,7 +134,7 @@ public class BlockEventListener117 implements Listener {
|
|||||||
public void onBlockFertilize(BlockFertilizeEvent event) {
|
public void onBlockFertilize(BlockFertilizeEvent event) {
|
||||||
Block block = event.getBlock();
|
Block block = event.getBlock();
|
||||||
List<org.bukkit.block.BlockState> blocks = event.getBlocks();
|
List<org.bukkit.block.BlockState> blocks = event.getBlocks();
|
||||||
Location location = BukkitUtil.adapt(blocks.get(0).getLocation());
|
Location location = BukkitUtil.adapt(block.getLocation());
|
||||||
|
|
||||||
PlotArea area = location.getPlotArea();
|
PlotArea area = location.getPlotArea();
|
||||||
if (area == null) {
|
if (area == null) {
|
||||||
|
@ -44,6 +44,7 @@ import java.util.List;
|
|||||||
import java.util.Queue;
|
import java.util.Queue;
|
||||||
import java.util.concurrent.LinkedBlockingQueue;
|
import java.util.concurrent.LinkedBlockingQueue;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import java.util.concurrent.TimeoutException;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
@ -226,16 +227,22 @@ public final class BukkitChunkCoordinator extends ChunkCoordinator {
|
|||||||
loadingChunks.incrementAndGet();
|
loadingChunks.incrementAndGet();
|
||||||
PaperLib
|
PaperLib
|
||||||
.getChunkAtAsync(this.bukkitWorld, chunk.getX(), chunk.getZ(), shouldGen, true)
|
.getChunkAtAsync(this.bukkitWorld, chunk.getX(), chunk.getZ(), shouldGen, true)
|
||||||
.completeOnTimeout(null, 10L, TimeUnit.SECONDS)
|
.orTimeout(10L, TimeUnit.SECONDS)
|
||||||
.whenComplete((chunkObject, throwable) -> {
|
.whenComplete((chunkObject, throwable) -> {
|
||||||
loadingChunks.decrementAndGet();
|
loadingChunks.decrementAndGet();
|
||||||
if (throwable != null) {
|
if (throwable != null) {
|
||||||
|
if (throwable instanceof TimeoutException) {
|
||||||
|
LOGGER.warn("Timed out awaiting chunk load {}", chunk);
|
||||||
|
this.requestedChunks.offer(chunk);
|
||||||
|
} else {
|
||||||
LOGGER.error("Failed to load chunk {}", chunk, throwable);
|
LOGGER.error("Failed to load chunk {}", chunk, throwable);
|
||||||
// We want one less because this couldn't be processed
|
// We want one less because this couldn't be processed
|
||||||
this.expectedSize.decrementAndGet();
|
this.expectedSize.decrementAndGet();
|
||||||
|
}
|
||||||
} else if (chunkObject == null) {
|
} else if (chunkObject == null) {
|
||||||
LOGGER.warn("Timed out awaiting chunk load {}", chunk);
|
if (shouldGen) {
|
||||||
this.requestedChunks.offer(chunk);
|
LOGGER.error("Null chunk returned for chunk at {}", chunk);
|
||||||
|
}
|
||||||
} else if (PlotSquared.get().isMainThread(Thread.currentThread())) {
|
} else if (PlotSquared.get().isMainThread(Thread.currentThread())) {
|
||||||
this.processChunk(chunkObject);
|
this.processChunk(chunkObject);
|
||||||
} else {
|
} else {
|
||||||
|
@ -210,7 +210,7 @@ public class ChunkCoordinatorBuilder {
|
|||||||
* - this is just a catch-all in case of future differing server implementations; the option will work on Spigot/Paper).
|
* - this is just a catch-all in case of future differing server implementations; the option will work on Spigot/Paper).
|
||||||
*
|
*
|
||||||
* @param shouldGen should generate new chunks or not
|
* @param shouldGen should generate new chunks or not
|
||||||
* @since TODO
|
* @since 7.5.0
|
||||||
*/
|
*/
|
||||||
public @NonNull ChunkCoordinatorBuilder shouldGen(final boolean shouldGen) {
|
public @NonNull ChunkCoordinatorBuilder shouldGen(final boolean shouldGen) {
|
||||||
this.shouldGen = shouldGen;
|
this.shouldGen = shouldGen;
|
||||||
|
@ -117,7 +117,7 @@ public abstract class QueueCoordinator {
|
|||||||
* depending on server implementation. (i.e. setting to false may not actually disable generation as part of this operation
|
* depending on server implementation. (i.e. setting to false may not actually disable generation as part of this operation
|
||||||
* - this is just a catch-all in case of future differing server implementations; the option will work on Spigot/Paper).
|
* - this is just a catch-all in case of future differing server implementations; the option will work on Spigot/Paper).
|
||||||
*
|
*
|
||||||
* @since TODO
|
* @since 7.5.0
|
||||||
*/
|
*/
|
||||||
public boolean isShouldGen() {
|
public boolean isShouldGen() {
|
||||||
return shouldGen;
|
return shouldGen;
|
||||||
@ -129,7 +129,7 @@ public abstract class QueueCoordinator {
|
|||||||
* - this is just a catch-all in case of future differing server implementations; the option will work on Spigot/Paper).
|
* - this is just a catch-all in case of future differing server implementations; the option will work on Spigot/Paper).
|
||||||
*
|
*
|
||||||
* @param shouldGen should generate new chunks or not
|
* @param shouldGen should generate new chunks or not
|
||||||
* @since TODO
|
* @since 7.5.0
|
||||||
*/
|
*/
|
||||||
public void setShouldGen(boolean shouldGen) {
|
public void setShouldGen(boolean shouldGen) {
|
||||||
this.shouldGen = shouldGen;
|
this.shouldGen = shouldGen;
|
||||||
|
@ -22,7 +22,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "com.intellectualsites.plotsquared"
|
group = "com.intellectualsites.plotsquared"
|
||||||
version = "7.5.0"
|
version = "7.5.2-SNAPSHOT"
|
||||||
|
|
||||||
if (!File("$rootDir/.git").exists()) {
|
if (!File("$rootDir/.git").exists()) {
|
||||||
logger.lifecycle("""
|
logger.lifecycle("""
|
||||||
|
@ -13,7 +13,7 @@ log4j = "2.19.0"
|
|||||||
|
|
||||||
# Plugins
|
# Plugins
|
||||||
worldedit = "7.2.20"
|
worldedit = "7.2.20"
|
||||||
fawe = "2.12.3"
|
fawe = "2.13.0"
|
||||||
placeholderapi = "2.11.6"
|
placeholderapi = "2.11.6"
|
||||||
luckperms = "5.4"
|
luckperms = "5.4"
|
||||||
essentialsx = "2.20.1"
|
essentialsx = "2.20.1"
|
||||||
|
Reference in New Issue
Block a user