minor fixes to crafting contrib

This commit is contained in:
InspectorCaracal 2023-06-03 15:20:51 -06:00 committed by InspectorCaracal
parent 6504f4cc90
commit 9f058d2cae

View file

@ -604,8 +604,12 @@ class CraftingRecipe(CraftingRecipeBase):
else:
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:
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 "
"have the same length as .output_prototypes."
)
@ -617,10 +621,6 @@ class CraftingRecipe(CraftingRecipeBase):
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
# over and over since nothing changes.
self.allow_reuse = not bool(self.consumable_tags)