table fix
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
require 'recipecode'
|
||||
|
||||
function Recipe.OnCreate.FromConditionInheriter(craftRecipeData, player)
|
||||
ConditionInheriter = ConditionInheriter or {}
|
||||
|
||||
function ConditionInheriter.FromConditionInheriter(craftRecipeData, player)
|
||||
local items = craftRecipeData:getAllConsumedItems();
|
||||
local results = craftRecipeData:getAllCreatedItems()
|
||||
local box = items:get(0);
|
||||
@@ -13,7 +15,7 @@ function Recipe.OnCreate.FromConditionInheriter(craftRecipeData, player)
|
||||
end
|
||||
end
|
||||
|
||||
function Recipe.OnCreate.ToConditionInheriter(craftRecipeData, player)
|
||||
function ConditionInheriter.ToConditionInheriter(craftRecipeData, player)
|
||||
local results = craftRecipeData:getAllCreatedItems()
|
||||
local items = craftRecipeData:getAllConsumedItems();
|
||||
|
||||
@@ -24,4 +26,12 @@ function Recipe.OnCreate.ToConditionInheriter(craftRecipeData, player)
|
||||
box:getModData()["condition" .. i] = item:getCondition();
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if type(Recipe) == "table" then
|
||||
if type(Recipe.OnCreate) ~= "table" then
|
||||
Recipe.OnCreate = {}
|
||||
end
|
||||
Recipe.OnCreate.FromConditionInheriter = ConditionInheriter.FromConditionInheriter
|
||||
Recipe.OnCreate.ToConditionInheriter = ConditionInheriter.ToConditionInheriter
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user