mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-22 19:58:34 +01:00
made the spreading not spread into the void
This commit is contained in:
parent
5700ab3053
commit
a9b39cf3da
1 changed files with 8 additions and 4 deletions
|
@ -25,12 +25,16 @@ public class SpreadEffect implements IDrainSpotEffect {
|
|||
int bestAmount = drain ? Integer.MAX_VALUE : Integer.MIN_VALUE;
|
||||
for (EnumFacing facing : EnumFacing.VALUES) {
|
||||
BlockPos offset = pos.offset(facing, 15);
|
||||
if (offset.getY() >= 0 && offset.getY() <= world.getHeight()) {
|
||||
int amount = IAuraChunk.getAuraInArea(world, offset, 14);
|
||||
if (drain ? amount < bestAmount : amount > bestAmount) {
|
||||
bestAmount = amount;
|
||||
bestOffset = offset;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(bestOffset == null)
|
||||
break;
|
||||
|
||||
BlockPos bestPos = drain ? IAuraChunk.getLowestSpot(world, bestOffset, 14, bestOffset)
|
||||
: IAuraChunk.getHighestSpot(world, bestOffset, 14, bestOffset);
|
||||
|
|
Loading…
Reference in a new issue