mirror of
https://github.com/danbulant/flying-squid
synced 2026-06-18 05:51:12 +00:00
22 lines
No EOL
541 B
JavaScript
22 lines
No EOL
541 B
JavaScript
module.exports=inject;
|
|
|
|
function inject(serv,player)
|
|
{
|
|
function changeBlock(position,blockType)
|
|
{
|
|
player.getOthers().forEach(function(player) {
|
|
player.sendBlock(position, blockType);
|
|
});
|
|
serv.world.setBlockType(position,blockType);
|
|
}
|
|
|
|
function sendBlock(position, blockType) { // Call from serv.setBlock unless you want "local" fake blocks
|
|
player._client.write("block_change",{
|
|
location:position,
|
|
type:blockType<<4
|
|
});
|
|
}
|
|
|
|
player.changeBlock=changeBlock;
|
|
player.sendBlock=sendBlock;
|
|
} |