Skip to content

Commit

Permalink
Use new block.isWaterlogged over reading block properties (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
extremeheat authored Jan 24, 2025
1 parent 4cdd93e commit 5cbba64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ function Physics (mcData, world) {
function getRenderedDepth (block) {
if (!block) return -1
if (waterLike.has(block.type)) return 0
if (block.getProperties().waterlogged) return 0
if (block.isWaterlogged) return 0
if (!waterIds.includes(block.type)) return -1
const meta = block.metadata
return meta >= 8 ? 0 : meta
Expand Down Expand Up @@ -640,7 +640,7 @@ function Physics (mcData, world) {
for (cursor.z = Math.floor(bb.minZ); cursor.z <= Math.floor(bb.maxZ); cursor.z++) {
for (cursor.x = Math.floor(bb.minX); cursor.x <= Math.floor(bb.maxX); cursor.x++) {
const block = world.getBlock(cursor)
if (block && (waterIds.includes(block.type) || waterLike.has(block.type) || block.getProperties().waterlogged)) {
if (block && (waterIds.includes(block.type) || waterLike.has(block.type) || block.isWaterlogged)) {
const waterLevel = cursor.y + 1 - getLiquidHeightPcent(block)
if (Math.ceil(bb.maxY) >= waterLevel) waterBlocks.push(block)
}
Expand Down

0 comments on commit 5cbba64

Please sign in to comment.