mirror of
https://github.com/danbulant/flying-squid
synced 2026-06-17 21:41:06 +00:00
Merge pull request #358 from bitknox/master
Fixed #353 - Crash Helditem
This commit is contained in:
commit
1b519708bc
2 changed files with 2 additions and 0 deletions
|
|
@ -15,6 +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 (direction === -1 || heldItem.type === -1 || !blocks[heldItem.type]) return
|
||||
const referencePosition = new Vec3(location.x, location.y, location.z)
|
||||
const directionVector = directionToVector[direction]
|
||||
|
|
|
|||
|
|
@ -5,6 +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 (direction === -1 || heldItem.type === -1 || !items[heldItem.type]) return
|
||||
const item = heldItem
|
||||
const referencePosition = new Vec3(location.x, location.y, location.z)
|
||||
|
|
|
|||
Loading…
Reference in a new issue