mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-14 19:55:52 -07:00
Add buffer to CraftWorld#warnUnsafeChunk
This allows plugins to access chunks slightly outside of the max world border (such as ones which may be loaded naturally by players) without tripping any logs.
This commit is contained in:
@@ -356,7 +356,8 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
// Paper start
|
||||
private static void warnUnsafeChunk(String reason, int x, int z) {
|
||||
// if any chunk coord is outside of 30 million blocks
|
||||
if (x > 1875000 || z > 1875000 || x < -1875000 || z < -1875000) {
|
||||
int max = (30_000_000 / 16) + 625;
|
||||
if (x > max || z > max || x < -max || z < -max) {
|
||||
Plugin plugin = io.papermc.paper.util.StackWalkerUtil.getFirstPluginCaller();
|
||||
if (plugin != null) {
|
||||
plugin.getLogger().warning("Plugin is %s at (%s, %s), this might cause issues.".formatted(reason, x, z));
|
||||
|
Reference in New Issue
Block a user