use of net.silentchaos512.gear.item.RepairKitItem in project Silent-Gear by SilentChaos512.
the class ModRecipesProvider method registerModifierKits.
private void registerModifierKits(Consumer<FinishedRecipe> consumer) {
ShapedRecipeBuilder.shaped(ModItems.MOD_KIT).define('#', ModTags.Items.TEMPLATE_BOARDS).define('/', Tags.Items.RODS_WOODEN).define('o', Tags.Items.INGOTS_IRON).pattern("##o").pattern("##/").unlockedBy("has_item", has(ModTags.Items.TEMPLATE_BOARDS)).save(consumer);
ShapedRecipeBuilder.shaped(ModItems.VERY_CRUDE_REPAIR_KIT).define('#', ModTags.Items.TEMPLATE_BOARDS).define('/', Tags.Items.RODS_WOODEN).define('o', Tags.Items.STONE).pattern(" / ").pattern("#o#").pattern("###").unlockedBy("has_item", has(ModTags.Items.TEMPLATE_BOARDS)).save(consumer);
ShapedRecipeBuilder.shaped(ModItems.CRUDE_REPAIR_KIT).define('#', ModTags.Items.TEMPLATE_BOARDS).define('/', Tags.Items.RODS_WOODEN).define('o', Tags.Items.INGOTS_IRON).pattern(" / ").pattern("#o#").pattern("###").unlockedBy("has_item", has(ModTags.Items.TEMPLATE_BOARDS)).save(consumer);
ShapedRecipeBuilder.shaped(ModItems.STURDY_REPAIR_KIT).define('#', Tags.Items.INGOTS_IRON).define('/', ModTags.Items.RODS_IRON).define('o', Tags.Items.GEMS_DIAMOND).pattern(" / ").pattern("#o#").pattern("###").unlockedBy("has_item", has(Tags.Items.INGOTS_IRON)).save(consumer);
ShapedRecipeBuilder.shaped(ModItems.CRIMSON_REPAIR_KIT).define('#', ModTags.Items.INGOTS_CRIMSON_STEEL).define('/', Tags.Items.RODS_BLAZE).define('o', ModTags.Items.INGOTS_BLAZE_GOLD).pattern(" / ").pattern("#o#").pattern("###").unlockedBy("has_item", has(ModTags.Items.INGOTS_CRIMSON_STEEL)).save(consumer);
ShapedRecipeBuilder.shaped(ModItems.AZURE_REPAIR_KIT).define('#', ModTags.Items.INGOTS_AZURE_ELECTRUM).define('/', Items.END_ROD).define('o', Tags.Items.GEMS_EMERALD).pattern(" / ").pattern("#o#").pattern("###").unlockedBy("has_item", has(ModTags.Items.INGOTS_AZURE_ELECTRUM)).save(consumer);
for (RepairKitItem item : Registration.getItems(RepairKitItem.class)) {
// Empty repair kit recipes
ExtendedShapelessRecipeBuilder.vanillaBuilder(item).addIngredient(item).addIngredient(Tags.Items.RODS_WOODEN).build(consumer, SilentGear.getId(NameUtils.from(item).getPath() + "_empty"));
}
}
use of net.silentchaos512.gear.item.RepairKitItem in project Silent-Gear by SilentChaos512.
the class FillRepairKitRecipe method matches.
@Override
public boolean matches(CraftingContainer inv, Level worldIn) {
// Need 1 repair kit and 1+ mats
boolean kitFound = false;
int matsFound = 0;
for (int i = 0; i < inv.getContainerSize(); ++i) {
ItemStack stack = inv.getItem(i);
if (!stack.isEmpty()) {
if (stack.getItem() instanceof RepairKitItem) {
if (kitFound) {
return false;
}
kitFound = true;
} else if (isRepairMaterial(stack)) {
++matsFound;
} else {
return false;
}
}
}
return kitFound && matsFound > 0;
}
Aggregations