diff --git a/src/lib/plugins/placeBlock.js b/src/lib/plugins/placeBlock.js index 2f62d4e..cac40fc 100644 --- a/src/lib/plugins/placeBlock.js +++ b/src/lib/plugins/placeBlock.js @@ -15,7 +15,7 @@ module.exports.player = function (player, serv, { version }) { player._client.on('block_place', ({ direction, location } = {}) => { const heldItem = player.inventory.slots[36 + player.heldItemSlot] - if(heldItem == undefined) return + if (heldItem === undefined) return if (direction === -1 || heldItem.type === -1 || !blocks[heldItem.type]) return const referencePosition = new Vec3(location.x, location.y, location.z) const directionVector = directionToVector[direction] diff --git a/src/lib/plugins/useItem.js b/src/lib/plugins/useItem.js index 82f5f30..bfcdfef 100644 --- a/src/lib/plugins/useItem.js +++ b/src/lib/plugins/useItem.js @@ -5,7 +5,7 @@ module.exports.player = function (player, serv, { version }) { player._client.on('block_place', ({ direction, location } = {}) => { const heldItem = player.inventory.slots[36 + player.heldItemSlot] - if(heldItem == undefined) return + if (heldItem === undefined) return if (direction === -1 || heldItem.type === -1 || !items[heldItem.type]) return const item = heldItem const referencePosition = new Vec3(location.x, location.y, location.z)