diff --git a/package.json b/package.json index 8708eaf..eb330a6 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "dependencies": { "babel-runtime": "^5.4.4", "minecraft-data": "0.7.0", - "minecraft-protocol": "^0.16.0", + "minecraft-protocol": "0.16.0", "mkdirp": "0.5.1", "moment": "^2.10.6", "node-dir": "~0.1.9", diff --git a/src/lib/plugins/placeBlock.js b/src/lib/plugins/placeBlock.js index b4da784..603a41e 100644 --- a/src/lib/plugins/placeBlock.js +++ b/src/lib/plugins/placeBlock.js @@ -14,7 +14,7 @@ var materialToSound = { module.exports.player=function(player,serv) { player._client.on("block_place",({direction,heldItem,location} = {}) => { - if(direction==-1 || heldItem.blockId==-1) return; + if(direction==-1 || heldItem.blockId==-1 || !blocks[heldItem.blockId]) return; var referencePosition=new Vec3(location.x,location.y,location.z); var directionVector=directionToVector[direction]; var placedPosition=referencePosition.plus(directionVector);