From 757b049c153923946a1eda94ce44ffe8af09b5fd Mon Sep 17 00:00:00 2001 From: Romain Beaumont Date: Thu, 27 Aug 2015 01:56:26 +0200 Subject: [PATCH] basic digging implementation --- lib/playerPlugins/digging.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lib/playerPlugins/digging.js diff --git a/lib/playerPlugins/digging.js b/lib/playerPlugins/digging.js new file mode 100644 index 0000000..a02c1f8 --- /dev/null +++ b/lib/playerPlugins/digging.js @@ -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); + } + }); +} \ No newline at end of file