diff options
author | madmaxoft <github@xoft.cz> | 2013-11-22 16:50:03 +0100 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-11-22 16:50:03 +0100 |
commit | 281bf8f90bbd295bb81ec09889bcaeefa689e6b2 (patch) | |
tree | def7903bbb2abb92381f0660a6806ad13ff2a8ba /MCServer/Plugins/Debuggers | |
parent | Fixed cRoot:GetFurnaceRecipe() Lua binding. (diff) | |
download | cuberite-281bf8f90bbd295bb81ec09889bcaeefa689e6b2.tar cuberite-281bf8f90bbd295bb81ec09889bcaeefa689e6b2.tar.gz cuberite-281bf8f90bbd295bb81ec09889bcaeefa689e6b2.tar.bz2 cuberite-281bf8f90bbd295bb81ec09889bcaeefa689e6b2.tar.lz cuberite-281bf8f90bbd295bb81ec09889bcaeefa689e6b2.tar.xz cuberite-281bf8f90bbd295bb81ec09889bcaeefa689e6b2.tar.zst cuberite-281bf8f90bbd295bb81ec09889bcaeefa689e6b2.zip |
Diffstat (limited to '')
-rw-r--r-- | MCServer/Plugins/Debuggers/Debuggers.lua | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua index e4c601da3..682a54676 100644 --- a/MCServer/Plugins/Debuggers/Debuggers.lua +++ b/MCServer/Plugins/Debuggers/Debuggers.lua @@ -49,6 +49,7 @@ function Initialize(Plugin) PM:BindCommand("/xpr", "debuggers", HandleRemoveXp, "- Remove all xp"); PM:BindCommand("/fill", "debuggers", HandleFill, "- Fills all block entities in current chunk with junk"); PM:BindCommand("/fr", "debuggers", HandleFurnaceRecipe, "- Shows the furnace recipe for the currently held item"); + PM:BindCommand("/ff", "debuggers", HandleFurnaceFuel, "- Shows how long the currently held item would burn in a furnace"); -- Enable the following line for BlockArea / Generator interface testing: -- PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHUNK_GENERATED); @@ -907,7 +908,7 @@ end function HandleFurnaceRecipe(a_Split, a_Player) local HeldItem = a_Player:GetEquippedItem(); - local Out, NumTicks, In = cRoot.GetFurnaceRecipe(HeldItem); + local Out, NumTicks, In = cRoot:GetFurnaceRecipe(HeldItem); if (Out ~= nil) then a_Player:SendMessage( "Furnace turns " .. ItemToFullString(In) .. @@ -924,3 +925,21 @@ end + +function HandleFurnaceFuel(a_Split, a_Player) + local HeldItem = a_Player:GetEquippedItem(); + local NumTicks = cRoot:GetFurnaceFuelBurnTime(HeldItem); + if (NumTicks > 0) then + a_Player:SendMessage( + ItemToFullString(HeldItem) .. " would power a furnace for " .. NumTicks .. + " ticks (" .. tostring(NumTicks / 20) .. " seconds)." + ); + else + a_Player:SendMessage(ItemToString(HeldItem) .. " will not power furnaces."); + end + return true; +end + + + + |