From b5328463a425bc0072d2cdedc7bdd108b03ee543 Mon Sep 17 00:00:00 2001 From: Romain Beaumont Date: Mon, 14 Mar 2016 21:47:06 +0100 Subject: [PATCH] limit /portal command to 21x21 --- src/lib/plugins/portal.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/plugins/portal.js b/src/lib/plugins/portal.js index a7b8871..953ebff 100644 --- a/src/lib/plugins/portal.js +++ b/src/lib/plugins/portal.js @@ -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);