9
0
mirror of https://github.com/Xiao-MoMi/Custom-Crops.git synced 2025-12-28 11:29:19 +00:00

Update PotBlock.java

This commit is contained in:
XiaoMoMi
2024-09-04 21:15:12 +08:00
parent 5a7bb86112
commit 9998be4411

View File

@@ -368,16 +368,18 @@ public class PotBlock extends AbstractCustomCropsBlock {
}
if (!hasNaturalWater && config.isNearbyWaterAccepted()) {
for (int i = -4; i <= 4; i++) {
for (int j = -4; j <= 4; j++) {
for (int k : new int[]{0, 1}) {
BlockData block = bukkitWorld.getBlockData(location.x() + i, location.y() + j, location.z() + k);
if (block.getMaterial() == Material.WATER || (block instanceof Waterlogged waterlogged && waterlogged.isWaterlogged())) {
if (addWater(state, 1)) {
waterChanged = true;
outer: {
for (int i = -4; i <= 4; i++) {
for (int j = -4; j <= 4; j++) {
for (int k : new int[]{0, 1}) {
BlockData block = bukkitWorld.getBlockData(location.x() + i, location.y() + j, location.z() + k);
if (block.getMaterial() == Material.WATER || (block instanceof Waterlogged waterlogged && waterlogged.isWaterlogged())) {
if (addWater(state, 1)) {
waterChanged = true;
}
hasNaturalWater = true;
break outer;
}
hasNaturalWater = true;
break;
}
}
}