minor fixes to crafting contrib

This commit is contained in:
InspectorCaracal 2023-06-03 15:20:51 -06:00 committed by InspectorCaracal
parent f78d4abcdd
commit 54dc392e9c

View file

@ -604,8 +604,12 @@ class CraftingRecipe(CraftingRecipeBase):
else: else:
self.tool_names = self.tool_tags self.tool_names = self.tool_tags
assert isinstance(
self.output_prototypes, (list, tuple)
), "Crafting {self.__class__}.output_prototypes must be a list or tuple."
if self.output_names: if self.output_names:
assert len(self.consumable_names) == len(self.consumable_tags), ( assert len(self.output_names) == len(self.output_prototypes), (
f"Crafting {self.__class__}.output_names list must " f"Crafting {self.__class__}.output_names list must "
"have the same length as .output_prototypes." "have the same length as .output_prototypes."
) )
@ -617,10 +621,6 @@ class CraftingRecipe(CraftingRecipeBase):
for prot in self.output_prototypes for prot in self.output_prototypes
] ]
assert isinstance(
self.output_prototypes, (list, tuple)
), "Crafting {self.__class__}.output_prototypes must be a list or tuple."
# don't allow reuse if we have consumables. If only tools we can reuse # don't allow reuse if we have consumables. If only tools we can reuse
# over and over since nothing changes. # over and over since nothing changes.
self.allow_reuse = not bool(self.consumable_tags) self.allow_reuse = not bool(self.consumable_tags)