mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 10:14:42 +02:00
Add utility methods for world height in QueueCoordinator
This commit is contained in:
@ -53,8 +53,8 @@ public class LocalChunk {
|
||||
this.parent = parent;
|
||||
this.x = x;
|
||||
this.z = z;
|
||||
this.minSection = parent.getWorld() != null ? (parent.getWorld().getMinY() >> 4) : 0;
|
||||
int sections = parent.getWorld() != null ? (parent.getWorld().getMaxY() >> 4) - minSection + 1 : 16;
|
||||
this.minSection = parent.getMinLayer();
|
||||
int sections = parent.getMaxLayer() - parent.getMinLayer() + 1;
|
||||
baseblocks = new BaseBlock[sections][];
|
||||
biomes = new BiomeType[sections][];
|
||||
}
|
||||
|
@ -481,4 +481,32 @@ public abstract class QueueCoordinator {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the min Y limit associated with the queue
|
||||
*/
|
||||
protected int getMinY() {
|
||||
return getWorld() != null ? getWorld().getMinY() : PlotSquared.platform().versionMinHeight();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the max Y limit associated with the queue
|
||||
*/
|
||||
protected int getMaxY() {
|
||||
return getWorld() != null ? getWorld().getMinY() : PlotSquared.platform().versionMaxHeight();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the min chunk layer associated with the queue. Usually 0 or -4;
|
||||
*/
|
||||
protected int getMinLayer() {
|
||||
return (getWorld() != null ? getWorld().getMinY() : PlotSquared.platform().versionMinHeight()) >> 4;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the max chunk layer associated with the queue. Usually 15 or 19
|
||||
*/
|
||||
protected int getMaxLayer() {
|
||||
return (getWorld() != null ? getWorld().getMinY() : PlotSquared.platform().versionMaxHeight()) >> 4;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user