mirror of
https://github.com/danbulant/flying-squid
synced 2026-07-10 21:50:33 +00:00
make the program crash in case of errors
This commit is contained in:
parent
17b65f5021
commit
24370e9d0f
3 changed files with 24 additions and 14 deletions
|
|
@ -7,6 +7,7 @@ function inject(serv, player)
|
|||
player._client.on('block_place', async function (packet) {
|
||||
var referencePosition=new vec3(packet.location.x,packet.location.y,packet.location.z);
|
||||
if (player.entity.crouching) return;
|
||||
try {
|
||||
var id = await serv.world.getBlockType(referencePosition);
|
||||
var blockAbove = await serv.world.getBlockType(referencePosition.clone().add(new vec3(0, 1, 0)));
|
||||
|
||||
|
|
@ -21,6 +22,10 @@ function inject(serv, player)
|
|||
slotCount: 9 * 3 + 8 // 3 rows, make nicer later
|
||||
});
|
||||
}
|
||||
}
|
||||
catch(err) {
|
||||
setTimeout(function(){throw err;},0);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
|
@ -18,7 +18,8 @@ function inject(serv,player)
|
|||
cancelDigging(pos);
|
||||
else if(packet.status==0 && player.gameMode==1)
|
||||
creativeDigging(pos);
|
||||
});
|
||||
})
|
||||
.catch((err)=> setTimeout(function(){throw err;},0));
|
||||
});
|
||||
|
||||
function diggingTime(location)
|
||||
|
|
|
|||
|
|
@ -94,13 +94,17 @@ function inject(serv,player)
|
|||
function sendRestMap()
|
||||
{
|
||||
player.sendingChunks=true;
|
||||
sendChunksAroundPlayer(player.view).then(() => player.sendingChunks=false);
|
||||
sendChunksAroundPlayer(player.view)
|
||||
.then(() => player.sendingChunks=false)
|
||||
.catch((err)=> setTimeout(function(){throw err;},0));
|
||||
|
||||
player.on("positionChanged",function(){
|
||||
if(!player.sendingChunks && player.entity.position.distanceTo(player.lastPositionChunkUpdated)>16*32)
|
||||
{
|
||||
player.sendingChunks=true;
|
||||
sendChunksAroundPlayer(player.view).then(() => player.sendingChunks=false);
|
||||
sendChunksAroundPlayer(player.view)
|
||||
.then(() => player.sendingChunks=false)
|
||||
.catch((err)=> setTimeout(function(){throw err;},0));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue