Ensure the block actually can be waterlogged when checking for waterlogged status.

Fixes #632
Fixed #633
Dieser Commit ist enthalten in:
dordsor21 2020-09-19 16:54:42 +01:00
Ursprung 7aedf62c63
Commit be0e33746c
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 1E53E88969FFCF0B

Datei anzeigen

@ -950,11 +950,13 @@ public class NMSRelighter implements Relighter {
if (heightMapList.get(HeightMapType.OCEAN_FLOOR)[j] == 0 && material.isSolid()) { if (heightMapList.get(HeightMapType.OCEAN_FLOOR)[j] == 0 && material.isSolid()) {
heightMapList.get(HeightMapType.OCEAN_FLOOR)[j] = y + 1; heightMapList.get(HeightMapType.OCEAN_FLOOR)[j] = y + 1;
} }
if (heightMapList.get(HeightMapType.MOTION_BLOCKING)[j] == 0 && (material.isSolid() || material.isLiquid() || state.getState(waterLogged))) { if (heightMapList.get(HeightMapType.MOTION_BLOCKING)[j] == 0 && (material.isSolid() || material.isLiquid() || (
state.getStates().containsKey(waterLogged) && state.getState(waterLogged)))) {
heightMapList.get(HeightMapType.MOTION_BLOCKING)[j] = y + 1; heightMapList.get(HeightMapType.MOTION_BLOCKING)[j] = y + 1;
} }
if (heightMapList.get(HeightMapType.MOTION_BLOCKING_NO_LEAVES)[j] == 0 && (material.isSolid() || material.isLiquid() || state if (heightMapList.get(HeightMapType.MOTION_BLOCKING_NO_LEAVES)[j] == 0 && (material.isSolid() || material.isLiquid() || (
.getState(waterLogged)) && !state.getBlockType().getId().toLowerCase().contains("leaves")) { state.getStates().containsKey(waterLogged) && state.getState(waterLogged))) && !state.getBlockType().getId().toLowerCase()
.contains("leaves")) {
heightMapList.get(HeightMapType.MOTION_BLOCKING_NO_LEAVES)[j] = y + 1; heightMapList.get(HeightMapType.MOTION_BLOCKING_NO_LEAVES)[j] = y + 1;
} }
} }