From a91c5d2bcdecd070f006017f78e29aedb8caeed5 Mon Sep 17 00:00:00 2001 From: Wyn Price Date: Fri, 22 Apr 2022 18:21:18 +0100 Subject: [PATCH 1/2] Update to 1.18.2 --- build.gradle | 6 +- gradle.properties | 12 +- .../campanion/block/RopeBridgePostBlock.java | 2 +- .../client/renderer/item/FakeWorld.java | 2 +- .../client/util/TentPreviewImmediate.java | 2 +- .../config/CampanionConfigManager.java | 6 +- .../campanion/data/CampanionData.java | 136 +++++++++--------- .../mixin/client/MixinMinecraftClient.java | 4 +- .../campanion/recipe/TarpRecipe.java | 19 +-- .../campanion/tag/CampanionBlockTags.java | 20 +-- .../campanion/tag/CampanionItemTags.java | 40 +++--- src/main/resources/campanion.mixins.json | 2 - 12 files changed, 127 insertions(+), 124 deletions(-) diff --git a/build.gradle b/build.gradle index a1832f57..3c8a9b86 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { apply from: 'https://raw.githubusercontent.com/TerraformersMC/GradleScripts/2.1/ferry.gradle' repositories { -// mavenLocal() + mavenLocal() maven { url "https://maven.jamieswhiteshirt.com/libs-release" content { @@ -31,8 +31,8 @@ dependencies { include modImplementation("com.jamieswhiteshirt:reach-entity-attributes:${project.reach_entity_attributes_version}") } -minecraft { - accessWidener = file("src/main/resources/campanion.accesswidener") +loom { + accessWidenerPath = file("src/main/resources/campanion.accesswidener") } subprojects.each { diff --git a/gradle.properties b/gradle.properties index 946be8da..b7456e13 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,14 +3,14 @@ org.gradle.jvmargs=-Xmx1G maven_group=com.terraformersmc archive_name=campanion -minecraft_version=1.18.1 -yarn_mappings=1.18.1+build.3 -loader_version=0.12.11 -fabric_version=0.44.0+1.18 -dossier_version=0.5.0 +minecraft_version=1.18.2 +yarn_mappings=1.18.2+build.2 +loader_version=0.13.3 +fabric_version=0.51.1+1.18.2 +dossier_version=0.6.0 reach_entity_attributes_version=2.1.1 #gravestones_version=v1.9 -trinkets_version=3.1.0 +trinkets_version=3.3.0 # Project Metadata project_name=Campanion diff --git a/src/main/java/com/terraformersmc/campanion/block/RopeBridgePostBlock.java b/src/main/java/com/terraformersmc/campanion/block/RopeBridgePostBlock.java index 4b967a73..e0bf953b 100644 --- a/src/main/java/com/terraformersmc/campanion/block/RopeBridgePostBlock.java +++ b/src/main/java/com/terraformersmc/campanion/block/RopeBridgePostBlock.java @@ -116,7 +116,7 @@ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEnt tag.putLong(CLICKED_POSITION_KEY, pos.asLong()); } } - if (ItemTags.PLANKS.contains(stack.getItem()) && this.incrementBridge(world, player, be, pos, true) && !player.isCreative()) { + if (stack.isIn(ItemTags.PLANKS) && this.incrementBridge(world, player, be, pos, true) && !player.isCreative()) { stack.decrement(1); } } diff --git a/src/main/java/com/terraformersmc/campanion/client/renderer/item/FakeWorld.java b/src/main/java/com/terraformersmc/campanion/client/renderer/item/FakeWorld.java index 86519709..321fed73 100644 --- a/src/main/java/com/terraformersmc/campanion/client/renderer/item/FakeWorld.java +++ b/src/main/java/com/terraformersmc/campanion/client/renderer/item/FakeWorld.java @@ -33,7 +33,7 @@ public class FakeWorld extends ClientWorld { public FakeWorld(ItemStack stack, BlockPos basePos, int lightOverride) { super(CLIENT.player.networkHandler, new ClientWorld.Properties(CLIENT.world.getLevelProperties().getDifficulty(), CLIENT.world.getLevelProperties().isDifficultyLocked(), CLIENT.world.getLevelProperties().isHardcore()), - CLIENT.world.getRegistryKey(), CLIENT.world.getDimension(), 3, 3, CLIENT::getProfiler, + CLIENT.world.getRegistryKey(), CLIENT.world.method_40134(), 3, 3, CLIENT::getProfiler, CLIENT.worldRenderer, CLIENT.world.isDebugWorld(), ((AccessorBiomeAccess) CLIENT.world.getBiomeAccess()).getSeed()); updatePositioning(basePos, lightOverride); diff --git a/src/main/java/com/terraformersmc/campanion/client/util/TentPreviewImmediate.java b/src/main/java/com/terraformersmc/campanion/client/util/TentPreviewImmediate.java index cdc24a27..27ec2219 100644 --- a/src/main/java/com/terraformersmc/campanion/client/util/TentPreviewImmediate.java +++ b/src/main/java/com/terraformersmc/campanion/client/util/TentPreviewImmediate.java @@ -37,7 +37,7 @@ public void draw(RenderLayer layer) { boolean bl = Objects.equals(this.currentLayer, layer.asOptional()); if ((bl || buffer != this.fallbackBuffer) && this.activeConsumers.remove(buffer)) { if (buffer.isBuilding()) { - buffer.setCameraPosition(0, 0, 0); + buffer.sortFrom(0, 0, 0); buffer.end(); layer.startDrawing(); diff --git a/src/main/java/com/terraformersmc/campanion/config/CampanionConfigManager.java b/src/main/java/com/terraformersmc/campanion/config/CampanionConfigManager.java index 422ed268..deadc042 100644 --- a/src/main/java/com/terraformersmc/campanion/config/CampanionConfigManager.java +++ b/src/main/java/com/terraformersmc/campanion/config/CampanionConfigManager.java @@ -1,6 +1,8 @@ package com.terraformersmc.campanion.config; import com.terraformersmc.campanion.Campanion; +import com.terraformersmc.campanion.item.CampanionItems; +import com.terraformersmc.campanion.tag.CampanionItemTags; import dev.emi.trinkets.api.SlotType; import dev.emi.trinkets.api.TrinketsApi; import net.fabricmc.fabric.api.util.TriState; @@ -49,9 +51,7 @@ private static void load() { if (FabricLoader.getInstance().isModLoaded("trinkets")) { TrinketsApi.registerTrinketPredicate(new Identifier("campanion", "backpacks"), (stack, ref, entity) -> { - SlotType slot = ref.inventory().getSlotType(); - Tag tag = ItemTags.getTagGroup().getTagOrEmpty(new Identifier("campanion", "backpacks")); - if (tag.contains(stack.getItem())) { + if (stack.isIn(CampanionItemTags.BACKPACKS)) { return config.isTrinketsBackpacksEnabled() ? TriState.TRUE : TriState.FALSE; } return TriState.DEFAULT; diff --git a/src/main/java/com/terraformersmc/campanion/data/CampanionData.java b/src/main/java/com/terraformersmc/campanion/data/CampanionData.java index a3a5746f..38b4a88c 100644 --- a/src/main/java/com/terraformersmc/campanion/data/CampanionData.java +++ b/src/main/java/com/terraformersmc/campanion/data/CampanionData.java @@ -76,74 +76,74 @@ protected void addItemTags() { private static class CampanionRecipesGenerator extends RecipesDossier { @Override protected void addRecipes(Consumer exporter) { - ShapedRecipeJsonFactory.create(CampanionItems.MARSHMALLOW, 2).input('S', Items.SUGAR).pattern("SS").pattern("SS").criterion("has_sugar", this.conditionsFrom(Items.SUGAR)).offerTo(exporter); - ShapelessRecipeJsonFactory.create(CampanionItems.MARSHMALLOW_ON_A_STICK).input(CampanionItems.MARSHMALLOW).input(Items.STICK).criterion("has_marshmallow", this.conditionsFrom(CampanionItems.MARSHMALLOW)).offerTo(exporter); - ShapelessRecipeJsonFactory.create(CampanionItems.MRE).input(CampanionItemTags.PROTEINS).input(CampanionItemTags.FRUITS).input(CampanionItemTags.GRAINS).input(CampanionItemTags.VEGETABLES).criterion("has_mre_components", this.conditionsFrom(CampanionItemTags.MRE_COMPONENTS)).offerTo(exporter); - ShapedRecipeJsonFactory.create(CampanionItems.CRACKER, 4).input('W', Items.WHEAT).pattern("WW").criterion("has_wheat", this.conditionsFrom(Items.WHEAT)).offerTo(exporter); - ShapelessRecipeJsonFactory.create(CampanionItems.SMORE).input(CampanionItems.CRACKER).input(CampanionItemTags.MELTED_MARSHMALLOWS).input(Items.COCOA_BEANS).input(CampanionItems.CRACKER).criterion("has_marshmallow", this.conditionsFrom(CampanionItemTags.MARSHMALLOWS)).offerTo(exporter); - - ShapedRecipeJsonFactory.create(CampanionItems.ROPE).input('S', Items.STRING).pattern("SSS").criterion("has_string", this.conditionsFrom(Items.STRING)).offerTo(exporter); - ShapedRecipeJsonFactory.create(CampanionBlocks.ROPE_BRIDGE_POST, 2).input('L', net.minecraft.tag.ItemTags.LOGS).pattern("L L").pattern("L L").criterion("has_rope", this.conditionsFrom(CampanionItems.ROPE)).offerTo(exporter); - ShapedRecipeJsonFactory.create(CampanionBlocks.ROPE_LADDER, 16).input('R', CampanionItems.ROPE).input('S', Items.STICK).pattern("RSR").pattern("RSR").pattern("RSR").criterion("has_string", this.conditionsFrom(Items.STRING)).offerTo(exporter); - ShapelessRecipeJsonFactory.create(CampanionItems.SKIPPING_STONE, 8).input(Blocks.COBBLESTONE).criterion("has_cobblestone", this.conditionsFrom(Blocks.COBBLESTONE)).offerTo(exporter); - ShapedRecipeJsonFactory.create(CampanionItems.SLEEPING_BAG).input('T', CampanionItems.WOOL_TARP).pattern("TT").criterion("has_wool", this.conditionsFrom(net.minecraft.tag.ItemTags.WOOL)).offerTo(exporter); - - ShapedRecipeJsonFactory.create(CampanionItems.WOODEN_ROD).input('S', Items.STICK).pattern("S").pattern("S").pattern("S").criterion("has_stick", this.conditionsFrom(Items.STICK)).offerTo(exporter); - ShapedRecipeJsonFactory.create(CampanionItems.SMALL_UNBUILT_TENT).input('T', CampanionItems.WOOL_TARP).input('S', CampanionItems.WOODEN_ROD).input('R', CampanionItems.ROPE).pattern(" T ").pattern("TST").pattern("R R").criterion("has_wool", this.conditionsFrom(net.minecraft.tag.ItemTags.WOOL)).offerTo(exporter); - ShapedRecipeJsonFactory.create(CampanionItems.LARGE_UNBUILT_TENT).input('T', CampanionItems.WOOL_TARP).input('S', CampanionItems.WOODEN_ROD).input('R', CampanionItems.ROPE).pattern("TTT").pattern("TST").pattern("RSR").criterion("has_wool", this.conditionsFrom(net.minecraft.tag.ItemTags.WOOL)).offerTo(exporter); - ShapedRecipeJsonFactory.create(CampanionItems.TENT_BAG).input('T', CampanionItems.TANNED_LEATHER).input('I', Items.IRON_INGOT).input('R', CampanionItems.ROPE).pattern("IRI").pattern("TTT").criterion("has_rope", this.conditionsFrom(CampanionItems.ROPE)).offerTo(exporter); - - ShapedRecipeJsonFactory.create(CampanionItems.LEATHER_POUCH).input('L', Items.LEATHER).input('S', Items.STRING).pattern("L L").pattern("SLS").criterion("has_leather", this.conditionsFrom(Items.LEATHER)).offerTo(exporter); - ShapedRecipeJsonFactory.create(CampanionItems.TANNED_LEATHER_POUCH).input('T', CampanionItems.TANNED_LEATHER).input('S', Items.STRING).pattern("T T").pattern("T T").pattern("STS").criterion("has_tanned_leather", this.conditionsFrom(CampanionItems.TANNED_LEATHER)).offerTo(exporter); - ShapedRecipeJsonFactory.create(CampanionBlocks.LEATHER_TANNER).input('S', Items.STICK).pattern("S S").pattern("S S").pattern("S S").criterion("has_stick", this.conditionsFrom(Items.STICK)).offerTo(exporter); - ShapedRecipeJsonFactory.create(CampanionItems.DAY_PACK).input('I', Items.IRON_INGOT).input('R', CampanionItems.ROPE).input('P', CampanionItems.LEATHER_POUCH).pattern(" I ").pattern("RPR").criterion("has_leather", this.conditionsFrom(Items.LEATHER)).offerTo(exporter); - ShapedRecipeJsonFactory.create(CampanionItems.CAMPING_PACK).input('I', Items.IRON_INGOT).input('R', CampanionItems.ROPE).input('P', CampanionItems.LEATHER_POUCH).input('T', CampanionItems.TANNED_LEATHER_POUCH).pattern(" I ").pattern("RTR").pattern(" P ").criterion("has_tanned_leather", this.conditionsFrom(CampanionItems.TANNED_LEATHER)).offerTo(exporter); - ShapedRecipeJsonFactory.create(CampanionItems.HIKING_PACK).input('I', Items.IRON_INGOT).input('R', CampanionItems.ROPE).input('T', CampanionItems.TANNED_LEATHER_POUCH).pattern(" I ").pattern("RTR").pattern("ITI").criterion("has_tanned_leather", this.conditionsFrom(CampanionItems.TANNED_LEATHER)).offerTo(exporter); - - ShapedRecipeJsonFactory.create(CampanionItems.GRAPPLING_HOOK).input('I', Items.IRON_INGOT).input('P', net.minecraft.tag.ItemTags.PLANKS).input('R', CampanionItems.ROPE).input('S', Items.STICK).pattern(" I ").pattern("PRI").pattern("SI ").criterion("has_grappling_hook", this.conditionsFrom(CampanionItems.GRAPPLING_HOOK)).offerTo(exporter); - - ShapedRecipeJsonFactory.create(CampanionItems.WOODEN_SPEAR).input('#', CampanionItems.WOODEN_ROD).input('X', net.minecraft.tag.ItemTags.PLANKS).pattern("X").pattern("#").criterion("has_stick", this.conditionsFrom(Items.STICK)).offerTo(exporter); - ShapedRecipeJsonFactory.create(CampanionItems.STONE_SPEAR).input('#', CampanionItems.WOODEN_ROD).input('X', net.minecraft.tag.ItemTags.STONE_TOOL_MATERIALS).pattern("X").pattern("#").criterion("has_stone", this.conditionsFrom(Blocks.COBBLESTONE)).offerTo(exporter); - ShapedRecipeJsonFactory.create(CampanionItems.IRON_SPEAR).input('#', CampanionItems.WOODEN_ROD).input('X', Items.IRON_INGOT).pattern("X").pattern("#").criterion("has_iron", this.conditionsFrom(Items.IRON_INGOT)).offerTo(exporter); - ShapedRecipeJsonFactory.create(CampanionItems.GOLDEN_SPEAR).input('#', CampanionItems.WOODEN_ROD).input('X', Items.GOLD_INGOT).pattern("X").pattern("#").criterion("has_gold", this.conditionsFrom(Items.GOLD_INGOT)).offerTo(exporter); - ShapedRecipeJsonFactory.create(CampanionItems.DIAMOND_SPEAR).input('#', CampanionItems.WOODEN_ROD).input('X', Items.DIAMOND).pattern("X").pattern("#").criterion("has_diamond", this.conditionsFrom(Items.DIAMOND)).offerTo(exporter); - - ShapedRecipeJsonFactory.create(CampanionBlocks.WHITE_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.WHITE_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_white_carpet", this.conditionsFrom(Blocks.WHITE_CARPET)).offerTo(exporter); - ShapedRecipeJsonFactory.create(CampanionBlocks.ORANGE_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.ORANGE_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_orange_carpet", this.conditionsFrom(Blocks.ORANGE_CARPET)).offerTo(exporter); - ShapelessRecipeJsonFactory.create(CampanionBlocks.ORANGE_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.ORANGE_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:orange_lawn_chair_from_existing_chair"); - ShapedRecipeJsonFactory.create(CampanionBlocks.MAGENTA_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.MAGENTA_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_magenta_carpet", this.conditionsFrom(Blocks.MAGENTA_CARPET)).offerTo(exporter); - ShapelessRecipeJsonFactory.create(CampanionBlocks.MAGENTA_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.MAGENTA_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:magenta_lawn_chair_from_existing_chair"); - ShapedRecipeJsonFactory.create(CampanionBlocks.LIGHT_BLUE_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.LIGHT_BLUE_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_light_blue_carpet", this.conditionsFrom(Blocks.LIGHT_BLUE_CARPET)).offerTo(exporter); - ShapelessRecipeJsonFactory.create(CampanionBlocks.LIGHT_BLUE_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.LIGHT_BLUE_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:light_blue_lawn_chair_from_existing_chair"); - ShapedRecipeJsonFactory.create(CampanionBlocks.YELLOW_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.YELLOW_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_yellow_carpet", this.conditionsFrom(Blocks.YELLOW_CARPET)).offerTo(exporter); - ShapelessRecipeJsonFactory.create(CampanionBlocks.YELLOW_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.YELLOW_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:yellow_lawn_chair_from_existing_chair"); - ShapedRecipeJsonFactory.create(CampanionBlocks.LIME_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.LIME_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_lime_carpet", this.conditionsFrom(Blocks.LIME_CARPET)).offerTo(exporter); - ShapelessRecipeJsonFactory.create(CampanionBlocks.LIME_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.LIME_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:lime_lawn_chair_from_existing_chair"); - ShapedRecipeJsonFactory.create(CampanionBlocks.PINK_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.PINK_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_pink_carpet", this.conditionsFrom(Blocks.PINK_CARPET)).offerTo(exporter); - ShapelessRecipeJsonFactory.create(CampanionBlocks.PINK_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.PINK_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:pink_lawn_chair_from_existing_chair"); - ShapedRecipeJsonFactory.create(CampanionBlocks.GRAY_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.GRAY_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_gray_carpet", this.conditionsFrom(Blocks.GRAY_CARPET)).offerTo(exporter); - ShapelessRecipeJsonFactory.create(CampanionBlocks.GRAY_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.GRAY_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:gray_lawn_chair_from_existing_chair"); - ShapedRecipeJsonFactory.create(CampanionBlocks.LIGHT_GRAY_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.LIGHT_GRAY_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_light_gray_carpet", this.conditionsFrom(Blocks.LIGHT_GRAY_CARPET)).offerTo(exporter); - ShapelessRecipeJsonFactory.create(CampanionBlocks.LIGHT_GRAY_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.LIGHT_GRAY_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:light_gray_lawn_chair_from_existing_chair"); - ShapedRecipeJsonFactory.create(CampanionBlocks.CYAN_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.CYAN_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_cyan_carpet", this.conditionsFrom(Blocks.CYAN_CARPET)).offerTo(exporter); - ShapelessRecipeJsonFactory.create(CampanionBlocks.CYAN_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.CYAN_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:cyan_lawn_chair_from_existing_chair"); - ShapedRecipeJsonFactory.create(CampanionBlocks.PURPLE_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.PURPLE_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_purple_carpet", this.conditionsFrom(Blocks.PURPLE_CARPET)).offerTo(exporter); - ShapelessRecipeJsonFactory.create(CampanionBlocks.PURPLE_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.PURPLE_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:purple_lawn_chair_from_existing_chair"); - ShapedRecipeJsonFactory.create(CampanionBlocks.BLUE_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.BLUE_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_blue_carpet", this.conditionsFrom(Blocks.BLUE_CARPET)).offerTo(exporter); - ShapelessRecipeJsonFactory.create(CampanionBlocks.BLUE_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.BLUE_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:blue_lawn_chair_from_existing_chair"); - ShapedRecipeJsonFactory.create(CampanionBlocks.BROWN_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.BROWN_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_brown_carpet", this.conditionsFrom(Blocks.BROWN_CARPET)).offerTo(exporter); - ShapelessRecipeJsonFactory.create(CampanionBlocks.BROWN_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.BROWN_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:brown_lawn_chair_from_existing_chair"); - ShapedRecipeJsonFactory.create(CampanionBlocks.GREEN_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.GREEN_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_green_carpet", this.conditionsFrom(Blocks.GREEN_CARPET)).offerTo(exporter); - ShapelessRecipeJsonFactory.create(CampanionBlocks.GREEN_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.GREEN_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:green_lawn_chair_from_existing_chair"); - ShapedRecipeJsonFactory.create(CampanionBlocks.RED_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.RED_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_red_carpet", this.conditionsFrom(Blocks.RED_CARPET)).offerTo(exporter); - ShapelessRecipeJsonFactory.create(CampanionBlocks.RED_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.RED_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:red_lawn_chair_from_existing_chair"); - ShapedRecipeJsonFactory.create(CampanionBlocks.BLACK_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.BLACK_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_black_carpet", this.conditionsFrom(Blocks.BLACK_CARPET)).offerTo(exporter); - ShapelessRecipeJsonFactory.create(CampanionBlocks.BLACK_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.BLACK_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:black_lawn_chair_from_existing_chair"); - - SmithingRecipeJsonFactory.create(Ingredient.ofItems(CampanionItems.DIAMOND_SPEAR), Ingredient.ofItems(Items.NETHERITE_INGOT), CampanionItems.NETHERITE_SPEAR).criterion("has_netherite_ingot", this.conditionsFrom(Items.NETHERITE_INGOT)).offerTo(exporter, "campanion:netherite_spear"); - - ComplexRecipeJsonFactory.create(CampanionRecipeSerializers.TENT_BUILDING_RECIPE).offerTo(exporter, "campanion:tent_building"); - ComplexRecipeJsonFactory.create(CampanionRecipeSerializers.TARP_RECIPE).offerTo(exporter, "campanion:wool_tarp"); + ShapedRecipeJsonBuilder.create(CampanionItems.MARSHMALLOW, 2).input('S', Items.SUGAR).pattern("SS").pattern("SS").criterion("has_sugar", this.conditionsFrom(Items.SUGAR)).offerTo(exporter); + ShapelessRecipeJsonBuilder.create(CampanionItems.MARSHMALLOW_ON_A_STICK).input(CampanionItems.MARSHMALLOW).input(Items.STICK).criterion("has_marshmallow", this.conditionsFrom(CampanionItems.MARSHMALLOW)).offerTo(exporter); + ShapelessRecipeJsonBuilder.create(CampanionItems.MRE).input(CampanionItemTags.PROTEINS).input(CampanionItemTags.FRUITS).input(CampanionItemTags.GRAINS).input(CampanionItemTags.VEGETABLES).criterion("has_mre_components", this.conditionsFrom(CampanionItemTags.MRE_COMPONENTS)).offerTo(exporter); + ShapedRecipeJsonBuilder.create(CampanionItems.CRACKER, 4).input('W', Items.WHEAT).pattern("WW").criterion("has_wheat", this.conditionsFrom(Items.WHEAT)).offerTo(exporter); + ShapelessRecipeJsonBuilder.create(CampanionItems.SMORE).input(CampanionItems.CRACKER).input(CampanionItemTags.MELTED_MARSHMALLOWS).input(Items.COCOA_BEANS).input(CampanionItems.CRACKER).criterion("has_marshmallow", this.conditionsFrom(CampanionItemTags.MARSHMALLOWS)).offerTo(exporter); + + ShapedRecipeJsonBuilder.create(CampanionItems.ROPE).input('S', Items.STRING).pattern("SSS").criterion("has_string", this.conditionsFrom(Items.STRING)).offerTo(exporter); + ShapedRecipeJsonBuilder.create(CampanionBlocks.ROPE_BRIDGE_POST, 2).input('L', net.minecraft.tag.ItemTags.LOGS).pattern("L L").pattern("L L").criterion("has_rope", this.conditionsFrom(CampanionItems.ROPE)).offerTo(exporter); + ShapedRecipeJsonBuilder.create(CampanionBlocks.ROPE_LADDER, 16).input('R', CampanionItems.ROPE).input('S', Items.STICK).pattern("RSR").pattern("RSR").pattern("RSR").criterion("has_string", this.conditionsFrom(Items.STRING)).offerTo(exporter); + ShapelessRecipeJsonBuilder.create(CampanionItems.SKIPPING_STONE, 8).input(Blocks.COBBLESTONE).criterion("has_cobblestone", this.conditionsFrom(Blocks.COBBLESTONE)).offerTo(exporter); + ShapedRecipeJsonBuilder.create(CampanionItems.SLEEPING_BAG).input('T', CampanionItems.WOOL_TARP).pattern("TT").criterion("has_wool", this.conditionsFrom(net.minecraft.tag.ItemTags.WOOL)).offerTo(exporter); + + ShapedRecipeJsonBuilder.create(CampanionItems.WOODEN_ROD).input('S', Items.STICK).pattern("S").pattern("S").pattern("S").criterion("has_stick", this.conditionsFrom(Items.STICK)).offerTo(exporter); + ShapedRecipeJsonBuilder.create(CampanionItems.SMALL_UNBUILT_TENT).input('T', CampanionItems.WOOL_TARP).input('S', CampanionItems.WOODEN_ROD).input('R', CampanionItems.ROPE).pattern(" T ").pattern("TST").pattern("R R").criterion("has_wool", this.conditionsFrom(net.minecraft.tag.ItemTags.WOOL)).offerTo(exporter); + ShapedRecipeJsonBuilder.create(CampanionItems.LARGE_UNBUILT_TENT).input('T', CampanionItems.WOOL_TARP).input('S', CampanionItems.WOODEN_ROD).input('R', CampanionItems.ROPE).pattern("TTT").pattern("TST").pattern("RSR").criterion("has_wool", this.conditionsFrom(net.minecraft.tag.ItemTags.WOOL)).offerTo(exporter); + ShapedRecipeJsonBuilder.create(CampanionItems.TENT_BAG).input('T', CampanionItems.TANNED_LEATHER).input('I', Items.IRON_INGOT).input('R', CampanionItems.ROPE).pattern("IRI").pattern("TTT").criterion("has_rope", this.conditionsFrom(CampanionItems.ROPE)).offerTo(exporter); + + ShapedRecipeJsonBuilder.create(CampanionItems.LEATHER_POUCH).input('L', Items.LEATHER).input('S', Items.STRING).pattern("L L").pattern("SLS").criterion("has_leather", this.conditionsFrom(Items.LEATHER)).offerTo(exporter); + ShapedRecipeJsonBuilder.create(CampanionItems.TANNED_LEATHER_POUCH).input('T', CampanionItems.TANNED_LEATHER).input('S', Items.STRING).pattern("T T").pattern("T T").pattern("STS").criterion("has_tanned_leather", this.conditionsFrom(CampanionItems.TANNED_LEATHER)).offerTo(exporter); + ShapedRecipeJsonBuilder.create(CampanionBlocks.LEATHER_TANNER).input('S', Items.STICK).pattern("S S").pattern("S S").pattern("S S").criterion("has_stick", this.conditionsFrom(Items.STICK)).offerTo(exporter); + ShapedRecipeJsonBuilder.create(CampanionItems.DAY_PACK).input('I', Items.IRON_INGOT).input('R', CampanionItems.ROPE).input('P', CampanionItems.LEATHER_POUCH).pattern(" I ").pattern("RPR").criterion("has_leather", this.conditionsFrom(Items.LEATHER)).offerTo(exporter); + ShapedRecipeJsonBuilder.create(CampanionItems.CAMPING_PACK).input('I', Items.IRON_INGOT).input('R', CampanionItems.ROPE).input('P', CampanionItems.LEATHER_POUCH).input('T', CampanionItems.TANNED_LEATHER_POUCH).pattern(" I ").pattern("RTR").pattern(" P ").criterion("has_tanned_leather", this.conditionsFrom(CampanionItems.TANNED_LEATHER)).offerTo(exporter); + ShapedRecipeJsonBuilder.create(CampanionItems.HIKING_PACK).input('I', Items.IRON_INGOT).input('R', CampanionItems.ROPE).input('T', CampanionItems.TANNED_LEATHER_POUCH).pattern(" I ").pattern("RTR").pattern("ITI").criterion("has_tanned_leather", this.conditionsFrom(CampanionItems.TANNED_LEATHER)).offerTo(exporter); + + ShapedRecipeJsonBuilder.create(CampanionItems.GRAPPLING_HOOK).input('I', Items.IRON_INGOT).input('P', net.minecraft.tag.ItemTags.PLANKS).input('R', CampanionItems.ROPE).input('S', Items.STICK).pattern(" I ").pattern("PRI").pattern("SI ").criterion("has_grappling_hook", this.conditionsFrom(CampanionItems.GRAPPLING_HOOK)).offerTo(exporter); + + ShapedRecipeJsonBuilder.create(CampanionItems.WOODEN_SPEAR).input('#', CampanionItems.WOODEN_ROD).input('X', net.minecraft.tag.ItemTags.PLANKS).pattern("X").pattern("#").criterion("has_stick", this.conditionsFrom(Items.STICK)).offerTo(exporter); + ShapedRecipeJsonBuilder.create(CampanionItems.STONE_SPEAR).input('#', CampanionItems.WOODEN_ROD).input('X', net.minecraft.tag.ItemTags.STONE_TOOL_MATERIALS).pattern("X").pattern("#").criterion("has_stone", this.conditionsFrom(Blocks.COBBLESTONE)).offerTo(exporter); + ShapedRecipeJsonBuilder.create(CampanionItems.IRON_SPEAR).input('#', CampanionItems.WOODEN_ROD).input('X', Items.IRON_INGOT).pattern("X").pattern("#").criterion("has_iron", this.conditionsFrom(Items.IRON_INGOT)).offerTo(exporter); + ShapedRecipeJsonBuilder.create(CampanionItems.GOLDEN_SPEAR).input('#', CampanionItems.WOODEN_ROD).input('X', Items.GOLD_INGOT).pattern("X").pattern("#").criterion("has_gold", this.conditionsFrom(Items.GOLD_INGOT)).offerTo(exporter); + ShapedRecipeJsonBuilder.create(CampanionItems.DIAMOND_SPEAR).input('#', CampanionItems.WOODEN_ROD).input('X', Items.DIAMOND).pattern("X").pattern("#").criterion("has_diamond", this.conditionsFrom(Items.DIAMOND)).offerTo(exporter); + + ShapedRecipeJsonBuilder.create(CampanionBlocks.WHITE_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.WHITE_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_white_carpet", this.conditionsFrom(Blocks.WHITE_CARPET)).offerTo(exporter); + ShapedRecipeJsonBuilder.create(CampanionBlocks.ORANGE_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.ORANGE_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_orange_carpet", this.conditionsFrom(Blocks.ORANGE_CARPET)).offerTo(exporter); + ShapelessRecipeJsonBuilder.create(CampanionBlocks.ORANGE_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.ORANGE_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:orange_lawn_chair_from_existing_chair"); + ShapedRecipeJsonBuilder.create(CampanionBlocks.MAGENTA_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.MAGENTA_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_magenta_carpet", this.conditionsFrom(Blocks.MAGENTA_CARPET)).offerTo(exporter); + ShapelessRecipeJsonBuilder.create(CampanionBlocks.MAGENTA_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.MAGENTA_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:magenta_lawn_chair_from_existing_chair"); + ShapedRecipeJsonBuilder.create(CampanionBlocks.LIGHT_BLUE_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.LIGHT_BLUE_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_light_blue_carpet", this.conditionsFrom(Blocks.LIGHT_BLUE_CARPET)).offerTo(exporter); + ShapelessRecipeJsonBuilder.create(CampanionBlocks.LIGHT_BLUE_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.LIGHT_BLUE_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:light_blue_lawn_chair_from_existing_chair"); + ShapedRecipeJsonBuilder.create(CampanionBlocks.YELLOW_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.YELLOW_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_yellow_carpet", this.conditionsFrom(Blocks.YELLOW_CARPET)).offerTo(exporter); + ShapelessRecipeJsonBuilder.create(CampanionBlocks.YELLOW_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.YELLOW_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:yellow_lawn_chair_from_existing_chair"); + ShapedRecipeJsonBuilder.create(CampanionBlocks.LIME_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.LIME_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_lime_carpet", this.conditionsFrom(Blocks.LIME_CARPET)).offerTo(exporter); + ShapelessRecipeJsonBuilder.create(CampanionBlocks.LIME_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.LIME_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:lime_lawn_chair_from_existing_chair"); + ShapedRecipeJsonBuilder.create(CampanionBlocks.PINK_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.PINK_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_pink_carpet", this.conditionsFrom(Blocks.PINK_CARPET)).offerTo(exporter); + ShapelessRecipeJsonBuilder.create(CampanionBlocks.PINK_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.PINK_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:pink_lawn_chair_from_existing_chair"); + ShapedRecipeJsonBuilder.create(CampanionBlocks.GRAY_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.GRAY_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_gray_carpet", this.conditionsFrom(Blocks.GRAY_CARPET)).offerTo(exporter); + ShapelessRecipeJsonBuilder.create(CampanionBlocks.GRAY_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.GRAY_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:gray_lawn_chair_from_existing_chair"); + ShapedRecipeJsonBuilder.create(CampanionBlocks.LIGHT_GRAY_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.LIGHT_GRAY_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_light_gray_carpet", this.conditionsFrom(Blocks.LIGHT_GRAY_CARPET)).offerTo(exporter); + ShapelessRecipeJsonBuilder.create(CampanionBlocks.LIGHT_GRAY_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.LIGHT_GRAY_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:light_gray_lawn_chair_from_existing_chair"); + ShapedRecipeJsonBuilder.create(CampanionBlocks.CYAN_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.CYAN_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_cyan_carpet", this.conditionsFrom(Blocks.CYAN_CARPET)).offerTo(exporter); + ShapelessRecipeJsonBuilder.create(CampanionBlocks.CYAN_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.CYAN_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:cyan_lawn_chair_from_existing_chair"); + ShapedRecipeJsonBuilder.create(CampanionBlocks.PURPLE_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.PURPLE_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_purple_carpet", this.conditionsFrom(Blocks.PURPLE_CARPET)).offerTo(exporter); + ShapelessRecipeJsonBuilder.create(CampanionBlocks.PURPLE_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.PURPLE_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:purple_lawn_chair_from_existing_chair"); + ShapedRecipeJsonBuilder.create(CampanionBlocks.BLUE_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.BLUE_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_blue_carpet", this.conditionsFrom(Blocks.BLUE_CARPET)).offerTo(exporter); + ShapelessRecipeJsonBuilder.create(CampanionBlocks.BLUE_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.BLUE_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:blue_lawn_chair_from_existing_chair"); + ShapedRecipeJsonBuilder.create(CampanionBlocks.BROWN_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.BROWN_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_brown_carpet", this.conditionsFrom(Blocks.BROWN_CARPET)).offerTo(exporter); + ShapelessRecipeJsonBuilder.create(CampanionBlocks.BROWN_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.BROWN_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:brown_lawn_chair_from_existing_chair"); + ShapedRecipeJsonBuilder.create(CampanionBlocks.GREEN_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.GREEN_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_green_carpet", this.conditionsFrom(Blocks.GREEN_CARPET)).offerTo(exporter); + ShapelessRecipeJsonBuilder.create(CampanionBlocks.GREEN_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.GREEN_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:green_lawn_chair_from_existing_chair"); + ShapedRecipeJsonBuilder.create(CampanionBlocks.RED_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.RED_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_red_carpet", this.conditionsFrom(Blocks.RED_CARPET)).offerTo(exporter); + ShapelessRecipeJsonBuilder.create(CampanionBlocks.RED_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.RED_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:red_lawn_chair_from_existing_chair"); + ShapedRecipeJsonBuilder.create(CampanionBlocks.BLACK_LAWN_CHAIR).input('P', net.minecraft.tag.ItemTags.PLANKS).input('C', Blocks.BLACK_CARPET).input('S', Items.STICK).pattern("P ").pattern("PCP").pattern("S S").group("lawn_chair").criterion("has_black_carpet", this.conditionsFrom(Blocks.BLACK_CARPET)).offerTo(exporter); + ShapelessRecipeJsonBuilder.create(CampanionBlocks.BLACK_LAWN_CHAIR).input(CampanionItemTags.LAWN_CHAIRS).input(Items.BLACK_DYE).group("dyed_lawn_chair").criterion("has_lawn_chair", this.conditionsFrom(CampanionItemTags.LAWN_CHAIRS)).offerTo(exporter, "campanion:black_lawn_chair_from_existing_chair"); + + SmithingRecipeJsonBuilder.create(Ingredient.ofItems(CampanionItems.DIAMOND_SPEAR), Ingredient.ofItems(Items.NETHERITE_INGOT), CampanionItems.NETHERITE_SPEAR).criterion("has_netherite_ingot", this.conditionsFrom(Items.NETHERITE_INGOT)).offerTo(exporter, "campanion:netherite_spear"); + + ComplexRecipeJsonBuilder.create(CampanionRecipeSerializers.TENT_BUILDING_RECIPE).offerTo(exporter, "campanion:tent_building"); + ComplexRecipeJsonBuilder.create(CampanionRecipeSerializers.TARP_RECIPE).offerTo(exporter, "campanion:wool_tarp"); } } diff --git a/src/main/java/com/terraformersmc/campanion/mixin/client/MixinMinecraftClient.java b/src/main/java/com/terraformersmc/campanion/mixin/client/MixinMinecraftClient.java index dc1ef392..a4598f58 100644 --- a/src/main/java/com/terraformersmc/campanion/mixin/client/MixinMinecraftClient.java +++ b/src/main/java/com/terraformersmc/campanion/mixin/client/MixinMinecraftClient.java @@ -25,10 +25,10 @@ public class MixinMinecraftClient { @Inject(method = "handleInputEvents", at = @At("HEAD"), cancellable = true) public void handleInputEvents(CallbackInfo info) { - if (this.player != null && this.options.keyAttack.isPressed()) { + if (this.player != null && this.options.attackKey.isPressed()) { ItemStack stack = this.player.getMainHandStack(); if (stack.getItem() instanceof PlaceableTentItem && ((PlaceableTentItem) stack.getItem()).hasBlocks(stack)) { - if (this.options.keyAttack.wasPressed()) { + if (this.options.attackKey.wasPressed()) { this.player.networkHandler.sendPacket(C2SRotateHeldItem.createPacket()); } info.cancel(); diff --git a/src/main/java/com/terraformersmc/campanion/recipe/TarpRecipe.java b/src/main/java/com/terraformersmc/campanion/recipe/TarpRecipe.java index 48bd7734..e40ccea1 100644 --- a/src/main/java/com/terraformersmc/campanion/recipe/TarpRecipe.java +++ b/src/main/java/com/terraformersmc/campanion/recipe/TarpRecipe.java @@ -1,7 +1,7 @@ package com.terraformersmc.campanion.recipe; import com.terraformersmc.campanion.item.CampanionItems; -import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags; +import net.fabricmc.fabric.api.tag.convention.v1.ConventionalItemTags; import net.minecraft.inventory.CraftingInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -26,9 +26,9 @@ public boolean matches(CraftingInventory inv, World world) { int shearAmount = 0; for (int i = 0; i < inv.size(); i++) { ItemStack stack = inv.getStack(i); - if(FabricToolTags.SHEARS.contains(stack.getItem())) { + if(stack.isIn(ConventionalItemTags.SHEARS)) { shearAmount++; - } else if(ItemTags.WOOL.contains(stack.getItem())) { + } else if(stack.isIn(ItemTags.WOOL)) { woolAmount++; } } @@ -48,7 +48,7 @@ public DefaultedList getIngredients() { list.add(Ingredient.fromTag(ItemTags.WOOL)); list.add(Ingredient.fromTag(ItemTags.WOOL)); - list.add(Ingredient.fromTag(FabricToolTags.SHEARS)); + list.add(Ingredient.fromTag(ConventionalItemTags.SHEARS)); return list; } @@ -77,14 +77,15 @@ public DefaultedList getRemainder(CraftingInventory inventory) { DefaultedList defaultedList = DefaultedList.ofSize(inventory.size(), ItemStack.EMPTY); for(int i = 0; i < defaultedList.size(); ++i) { - Item item = inventory.getStack(i).getItem(); + ItemStack stack = inventory.getStack(i); + Item item = stack.getItem(); if (item.hasRecipeRemainder()) { defaultedList.set(i, new ItemStack(item.getRecipeRemainder())); } - if(FabricToolTags.SHEARS.contains(item)) { - ItemStack stack = inventory.getStack(i).copy(); - if (!stack.damage(1, new Random(), null)) { - defaultedList.set(i, stack); + if(stack.isIn(ConventionalItemTags.SHEARS)) { + ItemStack copy = stack.copy(); + if (!copy.damage(1, new Random(), null)) { + defaultedList.set(i, copy); } } } diff --git a/src/main/java/com/terraformersmc/campanion/tag/CampanionBlockTags.java b/src/main/java/com/terraformersmc/campanion/tag/CampanionBlockTags.java index f6b30975..33961c34 100644 --- a/src/main/java/com/terraformersmc/campanion/tag/CampanionBlockTags.java +++ b/src/main/java/com/terraformersmc/campanion/tag/CampanionBlockTags.java @@ -1,20 +1,22 @@ package com.terraformersmc.campanion.tag; import com.terraformersmc.campanion.Campanion; -import com.terraformersmc.campanion.mixin.AccessorBlockTags; import net.minecraft.block.Block; import net.minecraft.tag.Tag; +import net.minecraft.tag.TagKey; +import net.minecraft.util.Identifier; +import net.minecraft.util.registry.Registry; public class CampanionBlockTags { - public static final Tag.Identified LAWN_CHAIRS = get("lawn_chairs"); - public static final Tag.Identified TENT_SIDES = get("tent_sides"); - public static final Tag.Identified TENT_TOPS = get("tent_tops"); - public static final Tag.Identified FLAT_TENT_TOPS = get("flat_tent_tops"); - public static final Tag.Identified TOPPED_TENT_POLES = get("topped_tent_poles"); - public static final Tag.Identified TENT_POLES = get("tent_poles"); + public static final TagKey LAWN_CHAIRS = get("lawn_chairs"); + public static final TagKey TENT_SIDES = get("tent_sides"); + public static final TagKey TENT_TOPS = get("tent_tops"); + public static final TagKey FLAT_TENT_TOPS = get("flat_tent_tops"); + public static final TagKey TOPPED_TENT_POLES = get("topped_tent_poles"); + public static final TagKey TENT_POLES = get("tent_poles"); - private static Tag.Identified get(String id) { - return AccessorBlockTags.callRegister(Campanion.MOD_ID + ":" + id); + private static TagKey get(String id) { + return TagKey.of(Registry.BLOCK_KEY, new Identifier(Campanion.MOD_ID, id)); } public static void load() { diff --git a/src/main/java/com/terraformersmc/campanion/tag/CampanionItemTags.java b/src/main/java/com/terraformersmc/campanion/tag/CampanionItemTags.java index c1705f73..8b9999d2 100644 --- a/src/main/java/com/terraformersmc/campanion/tag/CampanionItemTags.java +++ b/src/main/java/com/terraformersmc/campanion/tag/CampanionItemTags.java @@ -1,32 +1,34 @@ package com.terraformersmc.campanion.tag; import com.terraformersmc.campanion.Campanion; -import com.terraformersmc.campanion.mixin.AccessorItemTags; import net.minecraft.item.Item; import net.minecraft.tag.Tag; +import net.minecraft.tag.TagKey; +import net.minecraft.util.Identifier; +import net.minecraft.util.registry.Registry; public class CampanionItemTags { - public static final Tag.Identified MARSHMALLOWS = get("marshmallows"); - public static final Tag.Identified MELTED_MARSHMALLOWS = get("melted_marshmallows"); - public static final Tag.Identified MARSHMALLOWS_ON_STICKS = get("marshmallows_on_sticks"); - public static final Tag.Identified SPEARS = get("spears"); - public static final Tag.Identified BACKPACKS = get("backpacks"); - public static final Tag.Identified LAWN_CHAIRS = get("lawn_chairs"); + public static final TagKey MARSHMALLOWS = get("marshmallows"); + public static final TagKey MELTED_MARSHMALLOWS = get("melted_marshmallows"); + public static final TagKey MARSHMALLOWS_ON_STICKS = get("marshmallows_on_sticks"); + public static final TagKey SPEARS = get("spears"); + public static final TagKey BACKPACKS = get("backpacks"); + public static final TagKey LAWN_CHAIRS = get("lawn_chairs"); - public static final Tag.Identified TENT_SIDES = get("tent_sides"); - public static final Tag.Identified TENT_TOPS = get("tent_tops"); - public static final Tag.Identified FLAT_TENT_TOPS = get("flat_tent_tops"); - public static final Tag.Identified TOPPED_TENT_POLES = get("topped_tent_poles"); - public static final Tag.Identified TENT_POLES = get("tent_poles"); + public static final TagKey TENT_SIDES = get("tent_sides"); + public static final TagKey TENT_TOPS = get("tent_tops"); + public static final TagKey FLAT_TENT_TOPS = get("flat_tent_tops"); + public static final TagKey TOPPED_TENT_POLES = get("topped_tent_poles"); + public static final TagKey TENT_POLES = get("tent_poles"); - public static final Tag.Identified FRUITS = get("fruits"); - public static final Tag.Identified GRAINS = get("grains"); - public static final Tag.Identified PROTEINS = get("proteins"); - public static final Tag.Identified VEGETABLES = get("vegetables"); - public static final Tag.Identified MRE_COMPONENTS = get("mre_components"); + public static final TagKey FRUITS = get("fruits"); + public static final TagKey GRAINS = get("grains"); + public static final TagKey PROTEINS = get("proteins"); + public static final TagKey VEGETABLES = get("vegetables"); + public static final TagKey MRE_COMPONENTS = get("mre_components"); - private static Tag.Identified get(String id) { - return AccessorItemTags.callRegister(Campanion.MOD_ID + ":" + id); + private static TagKey get(String id) { + return TagKey.of(Registry.ITEM_KEY, new Identifier(Campanion.MOD_ID, id)); } public static void load() { diff --git a/src/main/resources/campanion.mixins.json b/src/main/resources/campanion.mixins.json index d7ce573f..6b7acdcb 100644 --- a/src/main/resources/campanion.mixins.json +++ b/src/main/resources/campanion.mixins.json @@ -5,8 +5,6 @@ "compatibilityLevel": "JAVA_17", "mixins": [ "AccessorBiomeAccess", - "AccessorBlockTags", - "AccessorItemTags", "InvokerCriteria", "InvokerBlockEntity", "InvokerEntity", From 1d93927d5d7fd2fafb8d4725af3a3b714ca70ba0 Mon Sep 17 00:00:00 2001 From: Wyn Price Date: Sun, 24 Apr 2022 03:11:55 +0100 Subject: [PATCH 2/2] Remove unused mixins --- .../campanion/mixin/AccessorBlockTags.java | 15 --------------- .../campanion/mixin/AccessorItemTags.java | 15 --------------- 2 files changed, 30 deletions(-) delete mode 100644 src/main/java/com/terraformersmc/campanion/mixin/AccessorBlockTags.java delete mode 100644 src/main/java/com/terraformersmc/campanion/mixin/AccessorItemTags.java diff --git a/src/main/java/com/terraformersmc/campanion/mixin/AccessorBlockTags.java b/src/main/java/com/terraformersmc/campanion/mixin/AccessorBlockTags.java deleted file mode 100644 index 9cc6a9db..00000000 --- a/src/main/java/com/terraformersmc/campanion/mixin/AccessorBlockTags.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.terraformersmc.campanion.mixin; - -import net.minecraft.block.Block; -import net.minecraft.tag.BlockTags; -import net.minecraft.tag.Tag; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.gen.Invoker; - -@Mixin(BlockTags.class) -public interface AccessorBlockTags { - @Invoker - static Tag.Identified callRegister(String id) { - return null; - } -} diff --git a/src/main/java/com/terraformersmc/campanion/mixin/AccessorItemTags.java b/src/main/java/com/terraformersmc/campanion/mixin/AccessorItemTags.java deleted file mode 100644 index b83d1e8b..00000000 --- a/src/main/java/com/terraformersmc/campanion/mixin/AccessorItemTags.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.terraformersmc.campanion.mixin; - -import net.minecraft.item.Item; -import net.minecraft.tag.ItemTags; -import net.minecraft.tag.Tag; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.gen.Invoker; - -@Mixin(ItemTags.class) -public interface AccessorItemTags { - @Invoker - static Tag.Identified callRegister(String id) { - return null; - } -}