mirror of
https://github.com/danbulant/flying-squid
synced 2026-07-05 19:20:54 +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": {
|
"dependencies": {
|
||||||
"babel-runtime": "^5.4.4",
|
"babel-runtime": "^5.4.4",
|
||||||
"minecraft-data": "0.7.0",
|
"minecraft-data": "0.7.0",
|
||||||
"minecraft-protocol": "^0.16.0",
|
"minecraft-protocol": "0.16.0",
|
||||||
"mkdirp": "0.5.1",
|
"mkdirp": "0.5.1",
|
||||||
"moment": "^2.10.6",
|
"moment": "^2.10.6",
|
||||||
"node-dir": "~0.1.9",
|
"node-dir": "~0.1.9",
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ var materialToSound = {
|
||||||
module.exports.player=function(player,serv)
|
module.exports.player=function(player,serv)
|
||||||
{
|
{
|
||||||
player._client.on("block_place",({direction,heldItem,location} = {}) => {
|
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 referencePosition=new Vec3(location.x,location.y,location.z);
|
||||||
var directionVector=directionToVector[direction];
|
var directionVector=directionToVector[direction];
|
||||||
var placedPosition=referencePosition.plus(directionVector);
|
var placedPosition=referencePosition.plus(directionVector);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue