diff options
author | Alexander Harkness <bearbin@gmail.com> | 2013-07-30 21:03:31 +0200 |
---|---|---|
committer | Alexander Harkness <bearbin@gmail.com> | 2013-07-30 21:03:31 +0200 |
commit | fc1952f9a99930689eda1bf6c2789b2a3baa9632 (patch) | |
tree | cc6e6554d1a77dd6c01a0a2ee27fff22c3cf2e29 /MCServer/Plugins/Core/onbreakplaceblock.lua | |
parent | Merge pull request #26 from mc-server/dumpapimove (diff) | |
download | cuberite-fc1952f9a99930689eda1bf6c2789b2a3baa9632.tar cuberite-fc1952f9a99930689eda1bf6c2789b2a3baa9632.tar.gz cuberite-fc1952f9a99930689eda1bf6c2789b2a3baa9632.tar.bz2 cuberite-fc1952f9a99930689eda1bf6c2789b2a3baa9632.tar.lz cuberite-fc1952f9a99930689eda1bf6c2789b2a3baa9632.tar.xz cuberite-fc1952f9a99930689eda1bf6c2789b2a3baa9632.tar.zst cuberite-fc1952f9a99930689eda1bf6c2789b2a3baa9632.zip |
Diffstat (limited to 'MCServer/Plugins/Core/onbreakplaceblock.lua')
-rw-r--r-- | MCServer/Plugins/Core/onbreakplaceblock.lua | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/MCServer/Plugins/Core/onbreakplaceblock.lua b/MCServer/Plugins/Core/onbreakplaceblock.lua index 89ccd3919..49b3226c2 100644 --- a/MCServer/Plugins/Core/onbreakplaceblock.lua +++ b/MCServer/Plugins/Core/onbreakplaceblock.lua @@ -4,10 +4,12 @@ function OnPlayerPlacingBlock(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX return false end - if( Player:HasPermission("core.build") == false ) then + local PROTECTRADIUS = WorldsSpawnProtect[Player:GetWorld():GetName()]; + + if not (Player:HasPermission("core.build")) then return true else - if Player:HasPermission("core.spawnprotect.bypass") == false and SPAWNPROTECT == true then + if not (Player:HasPermission("core.spawnprotect.bypass")) and not (PROTECTRADIUS == 0) then local World = Player:GetWorld() local xcoord = World:GetSpawnX() local ycoord = World:GetSpawnY() @@ -83,10 +85,12 @@ function OnPlayerBreakingBlock(Player, BlockX, BlockY, BlockZ, BlockFace, Status -- dont check if the direction is in the air if (BlockFace ~= -1) then - if (Player:HasPermission("core.build") == false) then + local PROTECTRADIUS = WorldsSpawnProtect[Player:GetWorld():GetName()]; + + if not (Player:HasPermission("core.build")) then return true else - if Player:HasPermission("core.spawnprotect.bypass") == false and SPAWNPROTECT == true then + if not (Player:HasPermission("core.spawnprotect.bypass")) and not (PROTECTRADIUS == 0) then local World = Player:GetWorld() local xcoord = World:GetSpawnX() local ycoord = World:GetSpawnY() |