properly build Vec3 from block_dig location, fix #103

This commit is contained in:
Romain Beaumont 2015-11-19 21:55:54 +01:00
parent b25036a10a
commit 477d5ff3b1
2 changed files with 2 additions and 2 deletions

View file

@ -3,7 +3,7 @@ var Vec3 = require("vec3").Vec3
module.exports.player=function(player,serv)
{
player._client.on("block_dig",({location,status} = {}) => {
var pos=new Vec3(location);
var pos=new Vec3(location.x,location.y,location.z);
player.world.getBlock(pos)
.then(block => {
currentlyDugBlock=block;

View file

@ -158,7 +158,7 @@ module.exports.server=function(serv,settings)
newLevel();
player._client.on("block_dig", function (packet) {
var pos = new Vec3(packet.location);
var pos = new Vec3(packet.location.x,packet.location.y,packet.location.z);
if (packet.status == 0 && player.gameMode != 1)
startDestroyBlock(pos.x, pos.y, pos.z, 0);
else if (packet.status == 2)