diff options
Diffstat (limited to 'MCServer')
-rw-r--r-- | MCServer/.gitignore | 2 | ||||
-rw-r--r-- | MCServer/Plugins/Debuggers/Debuggers.lua | 27 |
2 files changed, 28 insertions, 1 deletions
diff --git a/MCServer/.gitignore b/MCServer/.gitignore index e455b8cdc..8452ec2d7 100644 --- a/MCServer/.gitignore +++ b/MCServer/.gitignore @@ -6,7 +6,7 @@ banned.ini logs players whitelist.ini -world +world* API.txt *.dat schematics diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua index e2523e63e..1bc625c35 100644 --- a/MCServer/Plugins/Debuggers/Debuggers.lua +++ b/MCServer/Plugins/Debuggers/Debuggers.lua @@ -33,6 +33,8 @@ function Initialize(Plugin) PluginManager:BindCommand("/dash", "debuggers", HandleDashCmd, "Switches between fast and normal sprinting speed");
PluginManager:BindCommand("/hunger", "debuggers", HandleHungerCmd, "Lists the current hunger-related variables");
PluginManager:BindCommand("/poison", "debuggers", HandlePoisonCmd, "Sets food-poisoning for 15 seconds");
+ PluginManager:BindCommand("/starve", "debuggers", HandleStarveCmd, "Sets the food level to zero");
+ PluginManager:BindCommand("/fl", "debuggers", HandleFoodLevelCmd, "Sets the food level to the given value");
-- Enable the following line for BlockArea / Generator interface testing:
-- PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHUNK_GENERATED);
@@ -715,3 +717,28 @@ end +
+function HandleStarveCmd(a_Split, a_Player)
+ a_Player:SetFoodLevel(0);
+ a_Player:SendMessage("You are now starving");
+ return true;
+end
+
+
+
+
+
+function HandleFoodLevelCmd(a_Split, a_Player)
+ if (#a_Split ~= 2) then
+ a_Player:SendMessage("Missing an argument: the food level to set");
+ return true;
+ end
+
+ a_Player:SetFoodLevel(tonumber(a_Split[2]));
+ a_Player:SendMessage("Food level set to " .. a_Player:GetFoodLevel());
+ return true;
+end
+
+
+
+
|