summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/Core
diff options
context:
space:
mode:
Diffstat (limited to 'MCServer/Plugins/Core')
-rw-r--r--MCServer/Plugins/Core/main.lua1
-rw-r--r--MCServer/Plugins/Core/stop.lua4
-rw-r--r--MCServer/Plugins/Core/weather.lua10
3 files changed, 12 insertions, 3 deletions
diff --git a/MCServer/Plugins/Core/main.lua b/MCServer/Plugins/Core/main.lua
index 7f595fcdf..2eb07b6fd 100644
--- a/MCServer/Plugins/Core/main.lua
+++ b/MCServer/Plugins/Core/main.lua
@@ -32,6 +32,7 @@ function Initialize(Plugin)
PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHUNK_GENERATING)
PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_MOVING)
+ PluginManager:BindCommand("/toggledownfall", "core.toggledownfall", HandleToggleDownfallCommand, " - Toggles the weather");
PluginManager:BindCommand("/back", "core.back", HandleBackCommand, " - Return to your last position");
PluginManager:BindCommand("/save-all", "core.save-all", HandleSaveAllCommand, " - Saves all your worlds");
PluginManager:BindCommand("/help", "core.help", HandleHelpCommand, " [Page] - Show available commands");
diff --git a/MCServer/Plugins/Core/stop.lua b/MCServer/Plugins/Core/stop.lua
index 4b4cca3b6..0a06fc7d3 100644
--- a/MCServer/Plugins/Core/stop.lua
+++ b/MCServer/Plugins/Core/stop.lua
@@ -1,8 +1,6 @@
function HandleStopCommand( Split, Player )
Server = cRoot:Get():GetServer()
- PluginManager = cRoot:Get():GetPluginManager()
Server:SendMessage( cChatColor.Green .. "Stopping the server..." )
- PluginManager:ExecuteConsoleCommand("stop")
- --cRoot:Get():ServerCommand("stop")
+ cRoot:Get():ServerCommand("stop")
return true
end \ No newline at end of file
diff --git a/MCServer/Plugins/Core/weather.lua b/MCServer/Plugins/Core/weather.lua
new file mode 100644
index 000000000..49cbaa079
--- /dev/null
+++ b/MCServer/Plugins/Core/weather.lua
@@ -0,0 +1,10 @@
+function HandleToggleDownfallCommand( Split, Player )
+ World = Player:GetWorld()
+ if World:GetWeather() == 0 then
+ World:SetWeather(1)
+ else
+ World:SetWeather(0)
+ end
+ Player:SendMessage( cChatColor.Green .. "Weather toggled")
+ return true
+end \ No newline at end of file