Skip to content

Commit 5cbba64

Browse files
authored
Use new block.isWaterlogged over reading block properties (#120)
1 parent 4cdd93e commit 5cbba64

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ function Physics (mcData, world) {
592592
function getRenderedDepth (block) {
593593
if (!block) return -1
594594
if (waterLike.has(block.type)) return 0
595-
if (block.getProperties().waterlogged) return 0
595+
if (block.isWaterlogged) return 0
596596
if (!waterIds.includes(block.type)) return -1
597597
const meta = block.metadata
598598
return meta >= 8 ? 0 : meta
@@ -640,7 +640,7 @@ function Physics (mcData, world) {
640640
for (cursor.z = Math.floor(bb.minZ); cursor.z <= Math.floor(bb.maxZ); cursor.z++) {
641641
for (cursor.x = Math.floor(bb.minX); cursor.x <= Math.floor(bb.maxX); cursor.x++) {
642642
const block = world.getBlock(cursor)
643-
if (block && (waterIds.includes(block.type) || waterLike.has(block.type) || block.getProperties().waterlogged)) {
643+
if (block && (waterIds.includes(block.type) || waterLike.has(block.type) || block.isWaterlogged)) {
644644
const waterLevel = cursor.y + 1 - getLiquidHeightPcent(block)
645645
if (Math.ceil(bb.maxY) >= waterLevel) waterBlocks.push(block)
646646
}

0 commit comments

Comments
 (0)