From c8ab4072fbcd30cc08bd039fbda6bc64a0f0b620 Mon Sep 17 00:00:00 2001 From: screret <68943070+screret@users.noreply.github.com> Date: Sat, 11 May 2024 15:03:27 +0300 Subject: [PATCH] revert #1206 because it made diamond ore not smeltable (#1235) * revert #1206 because it made diamond ore not smeltable * add a NO_ORE_SMELTING for no ore smelting * amend changelog * add missing recipe config things for bamboo, slabs, netherite block compression * fix rotor material not serializing addon materials correctly * fix slab tags * oops * chore: cherrypick --- CHANGELOG.md | 30 +++--------- gradle.properties | 2 +- .../chemical/material/info/MaterialFlags.java | 7 +++ .../api/item/component/IMaterialPartItem.java | 2 +- .../gtceu/common/data/GTBlocks.java | 8 +-- .../recipe/configurable/RecipeAddition.java | 28 ++++++++++- .../recipe/configurable/RecipeRemoval.java | 49 +++++++++++++++---- .../recipe/generated/OreRecipeHandler.java | 2 +- .../data/recipe/misc/WoodMachineRecipes.java | 13 +++++ 9 files changed, 101 insertions(+), 40 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36a8b438aa..559213d97f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,31 +1,15 @@ # ChangeLog -Version: 1.2.2 +Version: 1.2.2.a ### ADDITIONS: -- Ported Powder Barrels, Industrial TNT and Dynamite from 1.12 -- Ported Armor from 1.12 +- added NO_ORE_SMELTING material flag for stopping ore/raw ore -> dust/ingot/gem smelting ### CHANGES: -- Updated Russian translation -- Moved coils, filters, PSS battery maps out of GTBlocks, to make it easier for addons to add to them ### FIXES: -- Made natural decor blocks obtainable -- Fixed compression recipes being generated for ignored materials -- Fixed fluid locking -- Fixed items being voided when Multiblock auto-building fails -- Fixed missing drops for Laser Pipes and Optical Pipes -- Fixed missing harder chest recipes -- Fixed setting the dimension for Bedrock Ore Veins and Fluid Veins in KJS -- Fixed energy transfer display in the Portable Scanner -- Fixed parallel issues, multi smelter not overclocking -- Fixed Overclocking display for ULV in recipe viewers -- Fixed parallel processing for steam machines -- Fixed machine controllers not working for indirectly powered blocks -- Fixed raw ores being smeltable into ingots even with the NO_SMELTING flag -- Fixed language entries for treated/rubber wood signs -- Fixed sign rendering -- Fixed wire throughput counting -- Fixed chainsaw durability usage -- Fixed recipe conflict between mud and fertilizer recipes \ No newline at end of file +- Fixed raw diamonds not being smeltable into diamonds, raw coal not being smeltable into coal +- fixed rubber & treated wood slab tags +- fixed addon turbine rotors using the wrong material +- fixed hardWoodRecipes not applying to bamboo +- fixed transformers not having enough input storage \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index c62686fa0b..536667b4a8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ org.gradle.jvmargs = -Xmx6G # Mod Info mod_id = gtceu mod_name = GregTech -mod_version = 1.2.2 +mod_version = 1.2.2.a mod_description = GregTech CE Unofficial, ported from 1.12.2 mod_license = LGPL-3.0 license mod_url = https://github.com/GregTechCEu/GregTech-Modern/ diff --git a/src/main/java/com/gregtechceu/gtceu/api/data/chemical/material/info/MaterialFlags.java b/src/main/java/com/gregtechceu/gtceu/api/data/chemical/material/info/MaterialFlags.java index 9ead4b7dda..7f327d656d 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/data/chemical/material/info/MaterialFlags.java +++ b/src/main/java/com/gregtechceu/gtceu/api/data/chemical/material/info/MaterialFlags.java @@ -172,6 +172,13 @@ public String toString() { .requireProps(PropertyKey.DUST) .build(); + /** + * Add to material if it's impossible to smelt it from an ore. + */ + public static final MaterialFlag NO_ORE_SMELTING = new MaterialFlag.Builder("no_ore_smelting") + .requireProps(PropertyKey.DUST) + .build(); + /** * Add this to your Material if you want to have its Ore Calcite heated in a Blast Furnace for more output. Already listed are: * Iron, Pyrite, PigIron, WroughtIron. diff --git a/src/main/java/com/gregtechceu/gtceu/api/item/component/IMaterialPartItem.java b/src/main/java/com/gregtechceu/gtceu/api/item/component/IMaterialPartItem.java index c166adf2ef..2c3d6ac892 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/item/component/IMaterialPartItem.java +++ b/src/main/java/com/gregtechceu/gtceu/api/item/component/IMaterialPartItem.java @@ -55,7 +55,7 @@ default void setPartMaterial(ItemStack itemStack, @NotNull Material material) { if (!material.hasProperty(PropertyKey.INGOT)) throw new IllegalArgumentException("Part material must have an Ingot!"); var compound = getOrCreatePartStatsTag(itemStack); - compound.putString("Material", material.getName()); + compound.putString("Material", material.getResourceLocation().toString()); } default int getPartDamage(ItemStack itemStack) { diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/GTBlocks.java b/src/main/java/com/gregtechceu/gtceu/common/data/GTBlocks.java index 3bb04dc281..00a6d85229 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/GTBlocks.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/GTBlocks.java @@ -1031,9 +1031,9 @@ public static ItemColor leavesItemColor() { .initialProperties(() -> Blocks.SPRUCE_SLAB) .lang("Rubber Slab") .blockstate((ctx, prov) -> prov.slabBlock(ctx.getEntry(), prov.blockTexture(GTBlocks.RUBBER_PLANK.get()), prov.blockTexture(GTBlocks.RUBBER_PLANK.get()))) - .tag(BlockTags.SLABS) + .tag(BlockTags.WOODEN_SLABS) .item() - .tag(ItemTags.SLABS) + .tag(ItemTags.WOODEN_SLABS) .onRegister(compassNode(GTCompassSections.GENERATIONS)) .build() .register(); @@ -1187,9 +1187,9 @@ public static ItemColor leavesItemColor() { .initialProperties(() -> Blocks.SPRUCE_SLAB) .lang("Treated Wood Slab") .blockstate((ctx, prov) -> prov.slabBlock(ctx.getEntry(), prov.blockTexture(GTBlocks.TREATED_WOOD_PLANK.get()), prov.blockTexture(GTBlocks.TREATED_WOOD_PLANK.get()))) - .tag(BlockTags.SLABS) + .tag(BlockTags.WOODEN_SLABS) .item() - .tag(ItemTags.SLABS) + .tag(ItemTags.WOODEN_SLABS) .onRegister(compassNode(GTCompassSections.GENERATIONS)) .build() .register(); diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeAddition.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeAddition.java index 47b2e76d29..3185f32d93 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeAddition.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeAddition.java @@ -1031,16 +1031,42 @@ private static void flintAndSteelRequireSteel(Consumer provider) } private static void removeVanillaBlockRecipes(Consumer provider) { + VanillaRecipeHelper.addShapedRecipe(provider, "stone_slab_saw", new ItemStack(Blocks.STONE_SLAB), "sS", 'S', new ItemStack(Blocks.STONE)); + VanillaRecipeHelper.addShapedRecipe(provider, "smooth_stone_slab_saw", new ItemStack(Blocks.SMOOTH_STONE_SLAB), "sS", 'S', new ItemStack(Blocks.SMOOTH_STONE)); + VanillaRecipeHelper.addShapedRecipe(provider, "andesite_slab_saw", new ItemStack(Blocks.ANDESITE_SLAB), "sS", 'S', new ItemStack(Blocks.ANDESITE)); + VanillaRecipeHelper.addShapedRecipe(provider, "granite_slab_saw", new ItemStack(Blocks.GRANITE_SLAB), "sS", 'S', new ItemStack(Blocks.GRANITE)); + VanillaRecipeHelper.addShapedRecipe(provider, "diorite_slab_saw", new ItemStack(Blocks.DIORITE_SLAB), "sS", 'S', new ItemStack(Blocks.DIORITE)); + VanillaRecipeHelper.addShapedRecipe(provider, "polished_andesite_slab_saw", new ItemStack(Blocks.POLISHED_ANDESITE_SLAB), "sS", 'S', new ItemStack(Blocks.POLISHED_ANDESITE)); + VanillaRecipeHelper.addShapedRecipe(provider, "polished_granite_slab_saw", new ItemStack(Blocks.POLISHED_GRANITE_SLAB), "sS", 'S', new ItemStack(Blocks.POLISHED_GRANITE)); + VanillaRecipeHelper.addShapedRecipe(provider, "polished_diorite_slab_saw", new ItemStack(Blocks.POLISHED_DIORITE_SLAB), "sS", 'S', new ItemStack(Blocks.POLISHED_DIORITE)); VanillaRecipeHelper.addShapedRecipe(provider, "sandstone_slab_saw", new ItemStack(Blocks.SANDSTONE_SLAB), "sS", 'S', new ItemStack(Blocks.SANDSTONE)); VanillaRecipeHelper.addShapedRecipe(provider, "smooth_sandstone_slab_saw", new ItemStack(Blocks.SMOOTH_SANDSTONE_SLAB), "sS", 'S', new ItemStack(Blocks.SMOOTH_SANDSTONE)); + VanillaRecipeHelper.addShapedRecipe(provider, "red_sandstone_slab_saw", new ItemStack(Blocks.RED_SANDSTONE_SLAB), "sS", 'S', new ItemStack(Blocks.RED_SANDSTONE)); + VanillaRecipeHelper.addShapedRecipe(provider, "smooth_red_sandstone_slab_saw", new ItemStack(Blocks.SMOOTH_RED_SANDSTONE_SLAB), "sS", 'S', new ItemStack(Blocks.SMOOTH_RED_SANDSTONE)); VanillaRecipeHelper.addShapedRecipe(provider, "cobblestone_slab_saw", new ItemStack(Blocks.COBBLESTONE_SLAB), "sS", 'S', new ItemStack(Blocks.COBBLESTONE)); + VanillaRecipeHelper.addShapedRecipe(provider, "blackstone_slab_saw", new ItemStack(Blocks.BLACKSTONE_SLAB), "sS", 'S', new ItemStack(Blocks.BLACKSTONE)); + VanillaRecipeHelper.addShapedRecipe(provider, "polished_blackstone_slab_saw", new ItemStack(Blocks.POLISHED_BLACKSTONE_SLAB), "sS", 'S', new ItemStack(Blocks.POLISHED_BLACKSTONE)); + VanillaRecipeHelper.addShapedRecipe(provider, "polished_blackstone_brick_slab_saw", new ItemStack(Blocks.POLISHED_BLACKSTONE_BRICK_SLAB), "sS", 'S', new ItemStack(Blocks.POLISHED_BLACKSTONE_BRICKS)); VanillaRecipeHelper.addShapedRecipe(provider, "brick_slab_saw", new ItemStack(Blocks.BRICK_SLAB), "sS", 'S', new ItemStack(Blocks.BRICKS)); + VanillaRecipeHelper.addShapedRecipe(provider, "mud_brick_slab_saw", new ItemStack(Blocks.MUD_BRICK_SLAB), "sS", 'S', new ItemStack(Blocks.MUD_BRICKS)); VanillaRecipeHelper.addShapedRecipe(provider, "stone_brick_slab_saw", new ItemStack(Blocks.STONE_BRICK_SLAB), "sS", 'S', ItemTags.STONE_BRICKS); VanillaRecipeHelper.addShapedRecipe(provider, "nether_brick_slab_saw", new ItemStack(Blocks.NETHER_BRICK_SLAB), "sS", 'S', new ItemStack(Blocks.NETHER_BRICKS)); + VanillaRecipeHelper.addShapedRecipe(provider, "red_nether_brick_slab_saw", new ItemStack(Blocks.RED_NETHER_BRICK_SLAB), "sS", 'S', new ItemStack(Blocks.RED_NETHER_BRICKS)); VanillaRecipeHelper.addShapedRecipe(provider, "quartz_slab_saw", new ItemStack(Blocks.QUARTZ_SLAB), "sS", 'S', new ItemStack(Blocks.QUARTZ_BLOCK)); VanillaRecipeHelper.addShapedRecipe(provider, "smooth_quartz_slab_saw", new ItemStack(Blocks.SMOOTH_QUARTZ_SLAB), "sS", 'S', new ItemStack(Blocks.SMOOTH_QUARTZ)); - VanillaRecipeHelper.addShapedRecipe(provider, "red_sandstone_slab_saw", new ItemStack(Blocks.RED_SANDSTONE_SLAB), "sS", 'S', new ItemStack(Blocks.RED_SANDSTONE)); + VanillaRecipeHelper.addShapedRecipe(provider, "cut_copper_slab_saw", new ItemStack(Blocks.CUT_COPPER_SLAB), "sS", 'S', new ItemStack(Blocks.CUT_COPPER)); + VanillaRecipeHelper.addShapedRecipe(provider, "exposed_cut_copper_slab_saw", new ItemStack(Blocks.EXPOSED_CUT_COPPER_SLAB), "sS", 'S', new ItemStack(Blocks.EXPOSED_CUT_COPPER)); + VanillaRecipeHelper.addShapedRecipe(provider, "oxidized_cut_copper_slab_saw", new ItemStack(Blocks.OXIDIZED_CUT_COPPER_SLAB), "sS", 'S', new ItemStack(Blocks.OXIDIZED_CUT_COPPER)); + VanillaRecipeHelper.addShapedRecipe(provider, "weathered_cut_copper_slab_saw", new ItemStack(Blocks.WEATHERED_CUT_COPPER_SLAB), "sS", 'S', new ItemStack(Blocks.OXIDIZED_CUT_COPPER)); + VanillaRecipeHelper.addShapedRecipe(provider, "waxed_cut_copper_slab_saw", new ItemStack(Blocks.WAXED_CUT_COPPER_SLAB), "sS", 'S', new ItemStack(Blocks.WAXED_CUT_COPPER)); + VanillaRecipeHelper.addShapedRecipe(provider, "waxed_exposed_cut_copper_slab_saw", new ItemStack(Blocks.WAXED_EXPOSED_CUT_COPPER_SLAB), "sS", 'S', new ItemStack(Blocks.WAXED_EXPOSED_CUT_COPPER)); + VanillaRecipeHelper.addShapedRecipe(provider, "waxed_oxidized_cut_copper_slab_saw", new ItemStack(Blocks.WAXED_OXIDIZED_CUT_COPPER_SLAB), "sS", 'S', new ItemStack(Blocks.WAXED_OXIDIZED_CUT_COPPER)); + VanillaRecipeHelper.addShapedRecipe(provider, "waxed_weathered_cut_copper_slab_saw", new ItemStack(Blocks.WAXED_WEATHERED_CUT_COPPER_SLAB), "sS", 'S', new ItemStack(Blocks.WAXED_OXIDIZED_CUT_COPPER)); VanillaRecipeHelper.addShapedRecipe(provider, "purpur_slab_saw", new ItemStack(Blocks.PURPUR_SLAB), "sS", 'S', new ItemStack(Blocks.PURPUR_BLOCK)); + VanillaRecipeHelper.addShapedRecipe(provider, "end_stone_brick_slab_saw", new ItemStack(Blocks.END_STONE_BRICK_SLAB), "sS", 'S', new ItemStack(Blocks.END_STONE_BRICKS)); + VanillaRecipeHelper.addShapedRecipe(provider, "prismarine_slab_saw", new ItemStack(Blocks.PRISMARINE_SLAB), "sS", 'S', new ItemStack(Blocks.PRISMARINE)); + VanillaRecipeHelper.addShapedRecipe(provider, "prismarine_brick_slab_saw", new ItemStack(Blocks.PRISMARINE_BRICK_SLAB), "sS", 'S', new ItemStack(Blocks.PRISMARINE_BRICKS)); + VanillaRecipeHelper.addShapedRecipe(provider, "dark_prismarine_slab_saw", new ItemStack(Blocks.DARK_PRISMARINE_SLAB), "sS", 'S', new ItemStack(Blocks.DARK_PRISMARINE)); } private static void createShovelRecipe(Consumer provider, String regName, ItemStack output, Material material) { diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeRemoval.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeRemoval.java index d6c2521d7d..27c51a29e8 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeRemoval.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeRemoval.java @@ -92,6 +92,9 @@ private static void disableManualCompression(Consumer registry registry.accept(new ResourceLocation("minecraft:clay")); registry.accept(new ResourceLocation("minecraft:nether_brick")); registry.accept(new ResourceLocation("minecraft:glowstone")); + // TODO netherite material + //registry.accept(new ResourceLocation("minecraft:netherite_block")); + //registry.accept(new ResourceLocation("minecraft:netherite_ingot_from_netherite_block")); } private static void harderBrickRecipes(Consumer registry) { @@ -297,14 +300,42 @@ private static void removeVanillaBlockRecipes(Consumer registr registry.accept(new ResourceLocation("minecraft:sea_lantern")); // Slab replacement - registry.accept(new ResourceLocation("minecraft:stone_slab"));; - registry.accept(new ResourceLocation("minecraft:sandstone_slab"));; - registry.accept(new ResourceLocation("minecraft:cobblestone_slab"));; - registry.accept(new ResourceLocation("minecraft:brick_slab"));; - registry.accept(new ResourceLocation("minecraft:stone_brick_slab"));; - registry.accept(new ResourceLocation("minecraft:nether_brick_slab"));; - registry.accept(new ResourceLocation("minecraft:quartz_slab"));; - registry.accept(new ResourceLocation("minecraft:red_sandstone_slab"));; - registry.accept(new ResourceLocation("minecraft:purpur_slab"));; + registry.accept(new ResourceLocation("minecraft:stone_slab")); + registry.accept(new ResourceLocation("minecraft:smooth_stone_slab")); + registry.accept(new ResourceLocation("minecraft:andesite_slab")); + registry.accept(new ResourceLocation("minecraft:granite_slab")); + registry.accept(new ResourceLocation("minecraft:diorite_slab")); + registry.accept(new ResourceLocation("minecraft:polished_andesite_slab")); + registry.accept(new ResourceLocation("minecraft:polished_granite_slab")); + registry.accept(new ResourceLocation("minecraft:polished_diorite_slab")); + registry.accept(new ResourceLocation("minecraft:sandstone_slab")); + registry.accept(new ResourceLocation("minecraft:smooth_sandstone_slab")); + registry.accept(new ResourceLocation("minecraft:red_sandstone_slab")); + registry.accept(new ResourceLocation("minecraft:smooth_red_sandstone_slab")); + registry.accept(new ResourceLocation("minecraft:cobblestone_slab")); + registry.accept(new ResourceLocation("minecraft:blackstone_slab")); + registry.accept(new ResourceLocation("minecraft:polished_blackstone_slab")); + registry.accept(new ResourceLocation("minecraft:polished_blackstone_brick_slab")); + registry.accept(new ResourceLocation("minecraft:brick_slab")); + registry.accept(new ResourceLocation("minecraft:stone_brick_slab")); + registry.accept(new ResourceLocation("minecraft:mud_brick_slab")); + registry.accept(new ResourceLocation("minecraft:nether_brick_slab")); + registry.accept(new ResourceLocation("minecraft:red_nether_brick_slab")); + registry.accept(new ResourceLocation("minecraft:quartz_slab")); + registry.accept(new ResourceLocation("minecraft:smooth_quartz_slab")); + registry.accept(new ResourceLocation("minecraft:cut_copper_slab")); + registry.accept(new ResourceLocation("minecraft:exposed_cut_copper_slab")); + registry.accept(new ResourceLocation("minecraft:oxidized_cut_copper_slab")); + registry.accept(new ResourceLocation("minecraft:weathered_cut_copper_slab")); + registry.accept(new ResourceLocation("minecraft:waxed_cut_copper_slab")); + registry.accept(new ResourceLocation("minecraft:waxed_exposed_cut_copper_slab")); + registry.accept(new ResourceLocation("minecraft:waxed_oxidized_cut_copper_slab")); + registry.accept(new ResourceLocation("minecraft:waxed_weathered_cut_copper_slab")); + registry.accept(new ResourceLocation("minecraft:red_sandstone_slab")); + registry.accept(new ResourceLocation("minecraft:purpur_slab")); + registry.accept(new ResourceLocation("minecraft:end_stone_brick_slab")); + registry.accept(new ResourceLocation("minecraft:prismarine_slab")); + registry.accept(new ResourceLocation("minecraft:prismarine_brick_slab")); + registry.accept(new ResourceLocation("minecraft:dark_prismarine_slab")); } } diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/OreRecipeHandler.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/OreRecipeHandler.java index c9ede1a77d..45723db4bd 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/OreRecipeHandler.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/generated/OreRecipeHandler.java @@ -431,7 +431,7 @@ public static void processPureDust(TagPrefix purePrefix, Material material, OreP } private static boolean doesMaterialUseNormalFurnace(Material material) { - return !material.hasProperty(PropertyKey.BLAST) && !material.hasFlag(MaterialFlags.NO_SMELTING); + return !material.hasProperty(PropertyKey.BLAST) && !material.hasFlag(MaterialFlags.NO_ORE_SMELTING); } diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/WoodMachineRecipes.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/WoodMachineRecipes.java index 584667a34a..617946bd35 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/WoodMachineRecipes.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/WoodMachineRecipes.java @@ -135,6 +135,19 @@ private static List getDefaultEntries() { .boat(Items.DARK_OAK_BOAT, "dark_oak_boat") .registerAllUnificationInfo() .build(), + new WoodTypeEntry.Builder(mcModId, "bamboo") + .planks(Items.BAMBOO_PLANKS, "bamboo_planks") + .log(Items.BAMBOO_BLOCK).removeCharcoalRecipe() + .strippedLog(Items.STRIPPED_BAMBOO_BLOCK) + .door(Items.BAMBOO_DOOR, "bamboo_door") + .trapdoor(Items.BAMBOO_TRAPDOOR, "bamboo_trapdoor") + .slab(Items.BAMBOO_SLAB, "bamboo_slab") + .fence(Items.BAMBOO_FENCE, "bamboo_fence") + .fenceGate(Items.BAMBOO_FENCE_GATE, "bamboo_fence_gate") + .stairs(Items.BAMBOO_STAIRS, "bamboo_stairs") + .boat(Items.BAMBOO_RAFT, "bamboo_raft") + .registerAllUnificationInfo() + .build(), new WoodTypeEntry.Builder(mcModId, "cherry") .planks(Items.CHERRY_PLANKS, "cherry_planks") .log(Items.CHERRY_LOG).removeCharcoalRecipe()