fixed the spread effect and chunk loader visualization not working below 0

This commit is contained in:
Ell 2023-02-06 11:21:22 +01:00
parent e5b2f0f9c5
commit bf757248d2
2 changed files with 3 additions and 3 deletions

View file

@ -44,10 +44,10 @@ public class BlockChunkLoader extends BlockContainerImpl implements IVisualizabl
if (range > 0) {
return new AABB(
pos.getX() - range >> 4 << 4,
0,
level.getMinBuildHeight(),
pos.getZ() - range >> 4 << 4,
(pos.getX() + range >> 4 << 4) + 16,
level.getHeight(),
level.getMaxBuildHeight(),
(pos.getZ() + range >> 4 << 4) + 16);
}
}

View file

@ -27,7 +27,7 @@ public class SpreadEffect implements IDrainSpotEffect {
var bestAmount = drain ? Integer.MAX_VALUE : Integer.MIN_VALUE;
for (var facing : Direction.values()) {
var offset = pos.relative(facing, 15);
if (level.isLoaded(offset) && offset.getY() >= 0 && offset.getY() <= level.getHeight()) {
if (level.isLoaded(offset) && offset.getY() >= level.getMinBuildHeight() && offset.getY() <= level.getMaxBuildHeight()) {
var amount = IAuraChunk.getAuraInArea(level, offset, 14);
if (drain ? amount < bestAmount : amount > bestAmount) {
bestAmount = amount;