summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-19 21:30:24 +0100
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-19 21:30:24 +0100
commited7b680d3cb100b6e633573b1422855eb08cd07a (patch)
tree1c8f930e3fead5e6fdf28dd9e7362eacf51c1aa2
parentFixed player heads always pointing north (new EntityHeadLook packet) (diff)
downloadcuberite-ed7b680d3cb100b6e633573b1422855eb08cd07a.tar
cuberite-ed7b680d3cb100b6e633573b1422855eb08cd07a.tar.gz
cuberite-ed7b680d3cb100b6e633573b1422855eb08cd07a.tar.bz2
cuberite-ed7b680d3cb100b6e633573b1422855eb08cd07a.tar.lz
cuberite-ed7b680d3cb100b6e633573b1422855eb08cd07a.tar.xz
cuberite-ed7b680d3cb100b6e633573b1422855eb08cd07a.tar.zst
cuberite-ed7b680d3cb100b6e633573b1422855eb08cd07a.zip
-rw-r--r--Plugins/Core/main.lua1
-rw-r--r--Plugins/Core/onblockdig.lua11
-rw-r--r--Plugins/Core/onblockplace.lua4
-rw-r--r--groups.example.ini4
-rw-r--r--groups.ini4
5 files changed, 20 insertions, 4 deletions
diff --git a/Plugins/Core/main.lua b/Plugins/Core/main.lua
index af1a49369..2706a6846 100644
--- a/Plugins/Core/main.lua
+++ b/Plugins/Core/main.lua
@@ -19,6 +19,7 @@ function Initialize( Plugin )
PluginManager:AddHook( Plugin, cPluginManager.E_PLUGIN_PLAYER_JOIN )
PluginManager:AddHook( Plugin, cPluginManager.E_PLUGIN_LOGIN )
PluginManager:AddHook( Plugin, cPluginManager.E_PLUGIN_BLOCK_PLACE )
+ PluginManager:AddHook( Plugin, cPluginManager.E_PLUGIN_BLOCK_DIG )
PluginManager:AddHook( Plugin, cPluginManager.E_PLUGIN_KILLED )
Plugin:AddCommand("/help", " - [Page] Show this message", "core.help")
diff --git a/Plugins/Core/onblockdig.lua b/Plugins/Core/onblockdig.lua
new file mode 100644
index 000000000..0fe671ad6
--- /dev/null
+++ b/Plugins/Core/onblockdig.lua
@@ -0,0 +1,11 @@
+function OnBlockDig( Block, Player )
+
+ -- dont check if the direction is in the air
+ if Block.m_Direction ~= -1 then
+
+ if( Player:HasPermission("core.build") == false ) then
+ return true
+ end
+ end
+ return false
+end \ No newline at end of file
diff --git a/Plugins/Core/onblockplace.lua b/Plugins/Core/onblockplace.lua
index 5717d76ca..12b536e7a 100644
--- a/Plugins/Core/onblockplace.lua
+++ b/Plugins/Core/onblockplace.lua
@@ -3,6 +3,10 @@ function OnBlockPlace( Block, Player )
-- dont check if the direction is in the air
if Block.m_Direction ~= -1 then
+ if( Player:HasPermission("core.build") == false ) then
+ return true
+ end
+
local X = Block.m_PosX
local Y = Block.m_PosY
local Z = Block.m_PosZ
diff --git a/groups.example.ini b/groups.example.ini
index 2f03bc229..7f061204b 100644
--- a/groups.example.ini
+++ b/groups.example.ini
@@ -13,5 +13,5 @@ Color=2
Inherits=Default
[Default]
-Permissions=core.help,core.playerlist,core.pluginlist,core.spawn
-Color=7
+Permissions=core.build,core.help,core.playerlist,core.pluginlist,core.spawn
+Color=7 \ No newline at end of file
diff --git a/groups.ini b/groups.ini
index 2f03bc229..7f061204b 100644
--- a/groups.ini
+++ b/groups.ini
@@ -13,5 +13,5 @@ Color=2
Inherits=Default
[Default]
-Permissions=core.help,core.playerlist,core.pluginlist,core.spawn
-Color=7
+Permissions=core.build,core.help,core.playerlist,core.pluginlist,core.spawn
+Color=7 \ No newline at end of file