Skip to content

Commit

Permalink
move tile entities also
Browse files Browse the repository at this point in the history
  • Loading branch information
apaleslimghost committed Jun 24, 2020
1 parent 230eef6 commit dad9d9e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ async function moveChunk({ from, to }) {
}
}

const tileEntities = chunk.value.Level.value.TileEntities.value

if (tileEntities.type === 'compound') {
for (const tileEntity of tileEntities.value) {
tileEntity.x.value = tileEntity.x.value - fromBlockX + toBlockX
tileEntity.z.value = tileEntity.z.value - fromBlockZ + toBlockZ
}
}

await target.saveRaw(to.x, to.z, chunk)
}

Expand Down

0 comments on commit dad9d9e

Please sign in to comment.