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:
parent
3de6f6357f
commit
07a1de8ebb
@ -48,6 +48,7 @@ function Initialize(Plugin)
|
|||||||
PM:BindCommand("/xpa", "debuggers", HandleAddExperience, "- Adds 200 experience to the player");
|
PM:BindCommand("/xpa", "debuggers", HandleAddExperience, "- Adds 200 experience to the player");
|
||||||
PM:BindCommand("/xpr", "debuggers", HandleRemoveXp, "- Remove all xp");
|
PM:BindCommand("/xpr", "debuggers", HandleRemoveXp, "- Remove all xp");
|
||||||
PM:BindCommand("/fill", "debuggers", HandleFill, "- Fills all block entities in current chunk with junk");
|
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:
|
-- Enable the following line for BlockArea / Generator interface testing:
|
||||||
-- PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHUNK_GENERATED);
|
-- 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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user