mirror of
https://github.com/danbulant/flying-squid
synced 2026-06-19 22:41:52 +00:00
properly build Vec3 from block_dig location, fix #103
This commit is contained in:
parent
b25036a10a
commit
477d5ff3b1
2 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue