limit /portal command to 21x21

This commit is contained in:
Romain Beaumont 2016-03-14 21:47:06 +01:00
parent b39072ebb2
commit b5328463a4

View file

@ -64,6 +64,8 @@ module.exports.player=function(player,serv) {
return {bottomLeft,direction,width,height};
},
async action({bottomLeft,direction,width,height}) {
if(width>21 || height>21)
throw new UserError("Portals can only be 21x21!");
const portal=generatePortal(bottomLeft,direction,width,height);
await addPortalToWorld(player.world,portal,[],[],async (pos,type) => {
await serv.setBlock(player.world,pos,type,0);