mirror of
https://github.com/danbulant/flying-squid
synced 2026-07-06 03:31:10 +00:00
basic digging implementation
This commit is contained in:
parent
f5963eb2d7
commit
757b049c15
1 changed files with 16 additions and 0 deletions
16
lib/playerPlugins/digging.js
Normal file
16
lib/playerPlugins/digging.js
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
module.exports=inject;
|
||||||
|
|
||||||
|
function inject(serv,player)
|
||||||
|
{
|
||||||
|
// doesn't check whether the player actually wait the correct time
|
||||||
|
player._client.on("block_dig",function(packet){
|
||||||
|
if(packet.status==2)
|
||||||
|
{
|
||||||
|
player._writeOthers("block_change",{
|
||||||
|
location:packet.location,
|
||||||
|
type:0
|
||||||
|
});
|
||||||
|
serv.world.setBlockType(packet.location.x,packet.location.y,packet.location.z,0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue