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

Fixes #632
Fixed #633
This commit is contained in:
dordsor21 2020-09-19 16:54:42 +01:00
parent 7aedf62c63
commit be0e33746c
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B

View File

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