1
0

Debuggers: Added a test harness for cRoot:GetFurnaceRecipe().

The "/fr" command lists the furnace recipe for the currently held item.
This commit is contained in:
madmaxoft 2013-11-22 12:26:39 +01:00
parent 3de6f6357f
commit 07a1de8ebb

View File

@ -48,6 +48,7 @@ function Initialize(Plugin)
PM:BindCommand("/xpa", "debuggers", HandleAddExperience, "- Adds 200 experience to the player");
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");
-- Enable the following line for BlockArea / Generator interface testing:
-- PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHUNK_GENERATED);
@ -903,3 +904,23 @@ end
function HandleFurnaceRecipe(a_Split, a_Player)
local HeldItem = a_Player:GetEquippedItem();
local Out, NumTicks, In = cRoot.GetFurnaceRecipe(HeldItem);
if (Out ~= nil) then
a_Player:SendMessage(
"Furnace turns " .. ItemToFullString(In) ..
" to " .. ItemToFullString(Out) ..
" in " .. NumTicks .. " ticks (" ..
tostring(NumTicks / 20) .. " seconds)."
);
else
a_Player:SendMessage("There is no furnace recipe that would smelt " .. ItemToString(HeldItem));
end
return true;
end