mirror of
https://github.com/danbulant/flying-squid
synced 2026-06-15 04:21:04 +00:00
add a check in block_place : only place a block if you are holding a block, fix #104
This commit is contained in:
parent
477d5ff3b1
commit
6ea69796fb
2 changed files with 2 additions and 2 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue