diff --git a/build.gradle b/build.gradle index 43b0f81f5..275c799ca 100644 --- a/build.gradle +++ b/build.gradle @@ -122,7 +122,7 @@ project(':clean') { clean_server { taskName 'clean_server' - main 'net.minecraft.server.MinecraftServer' + main 'net.minecraft.server.Main' workingDirectory project.file('run') } } diff --git a/patches/minecraft/net/minecraft/item/crafting/Ingredient.java.patch b/patches/minecraft/net/minecraft/item/crafting/Ingredient.java.patch index ff7f9642e..900631fbc 100644 --- a/patches/minecraft/net/minecraft/item/crafting/Ingredient.java.patch +++ b/patches/minecraft/net/minecraft/item/crafting/Ingredient.java.patch @@ -20,7 +20,7 @@ this.field_199807_b = p_i49381_1_.toArray((p_209360_0_) -> { return new Ingredient.IItemList[p_209360_0_]; }); -+ this.isSimple = !Arrays.stream(field_199807_b).anyMatch(list -> list.func_199799_a().stream().anyMatch(stack -> stack.func_77973_b().func_77645_m())); ++ this.isSimple = !net.minecraftforge.fml.ModLoader.isDataGenRunning() && !Arrays.stream(field_199807_b).anyMatch(list -> list.func_199799_a().stream().anyMatch(stack -> stack.func_77973_b().func_77645_m())); + Ingredient.INSTANCES.add(this); } diff --git a/src/generated/resources/data/minecraft/loot_tables/blocks/nether_sprouts.json b/src/generated/resources/data/minecraft/loot_tables/blocks/nether_sprouts.json new file mode 100644 index 000000000..7b3c2751e --- /dev/null +++ b/src/generated/resources/data/minecraft/loot_tables/blocks/nether_sprouts.json @@ -0,0 +1,22 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:nether_sprouts" + } + ], + "conditions": [ + { + "condition": "minecraft:match_tool", + "predicate": { + "tag": "forge:shears" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/loot_tables/blocks/twisting_vines.json b/src/generated/resources/data/minecraft/loot_tables/blocks/twisting_vines.json new file mode 100644 index 000000000..b80165c6c --- /dev/null +++ b/src/generated/resources/data/minecraft/loot_tables/blocks/twisting_vines.json @@ -0,0 +1,61 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:item", + "conditions": [ + { + "condition": "minecraft:alternative", + "terms": [ + { + "condition": "minecraft:match_tool", + "predicate": { + "tag": "forge:shears" + } + }, + { + "condition": "minecraft:match_tool", + "predicate": { + "enchantments": [ + { + "enchantment": "minecraft:silk_touch", + "levels": { + "min": 1 + } + } + ] + } + } + ] + } + ], + "name": "minecraft:twisting_vines" + }, + { + "type": "minecraft:item", + "conditions": [ + { + "condition": "minecraft:table_bonus", + "enchantment": "minecraft:fortune", + "chances": [ + 0.33, + 0.55, + 0.77, + 1.0 + ] + } + ], + "name": "minecraft:twisting_vines" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/loot_tables/blocks/weeping_vines.json b/src/generated/resources/data/minecraft/loot_tables/blocks/weeping_vines.json new file mode 100644 index 000000000..27d2c62ec --- /dev/null +++ b/src/generated/resources/data/minecraft/loot_tables/blocks/weeping_vines.json @@ -0,0 +1,61 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:item", + "conditions": [ + { + "condition": "minecraft:alternative", + "terms": [ + { + "condition": "minecraft:match_tool", + "predicate": { + "tag": "forge:shears" + } + }, + { + "condition": "minecraft:match_tool", + "predicate": { + "enchantments": [ + { + "enchantment": "minecraft:silk_touch", + "levels": { + "min": 1 + } + } + ] + } + } + ] + } + ], + "name": "minecraft:weeping_vines" + }, + { + "type": "minecraft:item", + "conditions": [ + { + "condition": "minecraft:table_bonus", + "enchantment": "minecraft:fortune", + "chances": [ + 0.33, + 0.55, + 0.77, + 1.0 + ] + } + ], + "name": "minecraft:weeping_vines" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/recipes/chain.json b/src/generated/resources/data/minecraft/recipes/chain.json new file mode 100644 index 000000000..0a9806e96 --- /dev/null +++ b/src/generated/resources/data/minecraft/recipes/chain.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "N", + "I", + "N" + ], + "key": { + "I": { + "tag": "forge:ingots/iron" + }, + "N": { + "item": "minecraft:iron_nugget" + } + }, + "result": { + "item": "minecraft:chain" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/recipes/crimson_fence.json b/src/generated/resources/data/minecraft/recipes/crimson_fence.json new file mode 100644 index 000000000..a9d3d7376 --- /dev/null +++ b/src/generated/resources/data/minecraft/recipes/crimson_fence.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:crafting_shaped", + "group": "wooden_fence", + "pattern": [ + "W#W", + "W#W" + ], + "key": { + "#": { + "tag": "forge:rods/wooden" + }, + "W": { + "item": "minecraft:crimson_planks" + } + }, + "result": { + "item": "minecraft:crimson_fence", + "count": 3 + } +} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/recipes/crimson_fence_gate.json b/src/generated/resources/data/minecraft/recipes/crimson_fence_gate.json new file mode 100644 index 000000000..6d23d40e5 --- /dev/null +++ b/src/generated/resources/data/minecraft/recipes/crimson_fence_gate.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:crafting_shaped", + "group": "wooden_fence_gate", + "pattern": [ + "#W#", + "#W#" + ], + "key": { + "#": { + "tag": "forge:rods/wooden" + }, + "W": { + "item": "minecraft:crimson_planks" + } + }, + "result": { + "item": "minecraft:crimson_fence_gate" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/recipes/crimson_sign.json b/src/generated/resources/data/minecraft/recipes/crimson_sign.json new file mode 100644 index 000000000..886e5e8b7 --- /dev/null +++ b/src/generated/resources/data/minecraft/recipes/crimson_sign.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:crafting_shaped", + "group": "sign", + "pattern": [ + "###", + "###", + " X " + ], + "key": { + "#": { + "item": "minecraft:crimson_planks" + }, + "X": { + "tag": "forge:rods/wooden" + } + }, + "result": { + "item": "minecraft:crimson_sign", + "count": 3 + } +} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/recipes/furnace.json b/src/generated/resources/data/minecraft/recipes/furnace.json deleted file mode 100644 index df635a157..000000000 --- a/src/generated/resources/data/minecraft/recipes/furnace.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "###", - "# #", - "###" - ], - "key": { - "#": { - "tag": "forge:cobblestone" - } - }, - "result": { - "item": "minecraft:furnace" - } -} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/recipes/netherite_ingot.json b/src/generated/resources/data/minecraft/recipes/netherite_ingot.json new file mode 100644 index 000000000..7404c866f --- /dev/null +++ b/src/generated/resources/data/minecraft/recipes/netherite_ingot.json @@ -0,0 +1,33 @@ +{ + "type": "minecraft:crafting_shapeless", + "group": "netherite_ingot", + "ingredients": [ + { + "item": "minecraft:netherite_scrap" + }, + { + "item": "minecraft:netherite_scrap" + }, + { + "item": "minecraft:netherite_scrap" + }, + { + "item": "minecraft:netherite_scrap" + }, + { + "tag": "forge:ingots/gold" + }, + { + "tag": "forge:ingots/gold" + }, + { + "tag": "forge:ingots/gold" + }, + { + "tag": "forge:ingots/gold" + } + ], + "result": { + "item": "minecraft:netherite_ingot" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/recipes/soul_campfire.json b/src/generated/resources/data/minecraft/recipes/soul_campfire.json new file mode 100644 index 000000000..cf52c9639 --- /dev/null +++ b/src/generated/resources/data/minecraft/recipes/soul_campfire.json @@ -0,0 +1,22 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + " S ", + "S#S", + "LLL" + ], + "key": { + "L": { + "tag": "minecraft:logs" + }, + "S": { + "tag": "forge:rods/wooden" + }, + "#": { + "tag": "minecraft:soul_fire_base_blocks" + } + }, + "result": { + "item": "minecraft:soul_campfire" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/recipes/soul_torch.json b/src/generated/resources/data/minecraft/recipes/soul_torch.json new file mode 100644 index 000000000..8d36f0a97 --- /dev/null +++ b/src/generated/resources/data/minecraft/recipes/soul_torch.json @@ -0,0 +1,28 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "X", + "#", + "S" + ], + "key": { + "X": [ + { + "item": "minecraft:coal" + }, + { + "item": "minecraft:charcoal" + } + ], + "#": { + "tag": "forge:rods/wooden" + }, + "S": { + "tag": "minecraft:soul_fire_base_blocks" + } + }, + "result": { + "item": "minecraft:soul_torch", + "count": 4 + } +} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/recipes/warped_fence.json b/src/generated/resources/data/minecraft/recipes/warped_fence.json new file mode 100644 index 000000000..acbd03dc4 --- /dev/null +++ b/src/generated/resources/data/minecraft/recipes/warped_fence.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:crafting_shaped", + "group": "wooden_fence", + "pattern": [ + "W#W", + "W#W" + ], + "key": { + "#": { + "tag": "forge:rods/wooden" + }, + "W": { + "item": "minecraft:warped_planks" + } + }, + "result": { + "item": "minecraft:warped_fence", + "count": 3 + } +} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/recipes/warped_fence_gate.json b/src/generated/resources/data/minecraft/recipes/warped_fence_gate.json new file mode 100644 index 000000000..392d027b4 --- /dev/null +++ b/src/generated/resources/data/minecraft/recipes/warped_fence_gate.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:crafting_shaped", + "group": "wooden_fence_gate", + "pattern": [ + "#W#", + "#W#" + ], + "key": { + "#": { + "tag": "forge:rods/wooden" + }, + "W": { + "item": "minecraft:warped_planks" + } + }, + "result": { + "item": "minecraft:warped_fence_gate" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/recipes/warped_sign.json b/src/generated/resources/data/minecraft/recipes/warped_sign.json new file mode 100644 index 000000000..46f1d327b --- /dev/null +++ b/src/generated/resources/data/minecraft/recipes/warped_sign.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:crafting_shaped", + "group": "sign", + "pattern": [ + "###", + "###", + " X " + ], + "key": { + "#": { + "item": "minecraft:warped_planks" + }, + "X": { + "tag": "forge:rods/wooden" + } + }, + "result": { + "item": "minecraft:warped_sign", + "count": 3 + } +} \ No newline at end of file diff --git a/src/main/java/net/minecraftforge/common/data/ForgeItemTagsProvider.java b/src/main/java/net/minecraftforge/common/data/ForgeItemTagsProvider.java index b1bed9e13..489d2e8c1 100644 --- a/src/main/java/net/minecraftforge/common/data/ForgeItemTagsProvider.java +++ b/src/main/java/net/minecraftforge/common/data/ForgeItemTagsProvider.java @@ -131,6 +131,7 @@ public class ForgeItemTagsProvider extends ItemTagsProvider func_240522_a_(Tags.Items.SEEDS_MELON).func_240534_a_(Items.MELON_SEEDS); func_240522_a_(Tags.Items.SEEDS_PUMPKIN).func_240534_a_(Items.PUMPKIN_SEEDS); func_240522_a_(Tags.Items.SEEDS_WHEAT).func_240534_a_(Items.WHEAT_SEEDS); + func_240522_a_(Tags.Items.SHEARS).func_240534_a_(Items.SHEARS); func_240522_a_(Tags.Items.SLIMEBALLS).func_240534_a_(Items.SLIME_BALL); func_240521_a_(Tags.Blocks.STAINED_GLASS, Tags.Items.STAINED_GLASS); func_240521_a_(Tags.Blocks.STAINED_GLASS_PANES, Tags.Items.STAINED_GLASS_PANES); diff --git a/src/main/java/net/minecraftforge/common/data/ForgeRecipeProvider.java b/src/main/java/net/minecraftforge/common/data/ForgeRecipeProvider.java index 80290c590..4f5a400db 100644 --- a/src/main/java/net/minecraftforge/common/data/ForgeRecipeProvider.java +++ b/src/main/java/net/minecraftforge/common/data/ForgeRecipeProvider.java @@ -153,7 +153,7 @@ public class ForgeRecipeProvider extends RecipeProvider boolean modified = false; List items = new ArrayList<>(); - IItemList[] vanillaItems = getField(Ingredient.class, vanilla, 3); + IItemList[] vanillaItems = getField(Ingredient.class, vanilla, 2); //This will probably crash between versions, if null fix index for (IItemList entry : vanillaItems) { if (entry instanceof SingleItemList) diff --git a/src/main/java/net/minecraftforge/fml/ModLoader.java b/src/main/java/net/minecraftforge/fml/ModLoader.java index 22f8a58c0..c4ca4921b 100644 --- a/src/main/java/net/minecraftforge/fml/ModLoader.java +++ b/src/main/java/net/minecraftforge/fml/ModLoader.java @@ -285,9 +285,16 @@ public class ModLoader this.loadingWarnings.add(warning); } + private static boolean runningDataGen = false; + + public static boolean isDataGenRunning () { + return runningDataGen; + } + public void runDataGenerator(final Set mods, final Path path, final Collection inputs, Collection existingPacks, final boolean serverGenerators, final boolean clientGenerators, final boolean devToolGenerators, final boolean reportsGenerator, final boolean structureValidator, final boolean flat) { if (mods.contains("minecraft") && mods.size() == 1) return; LOGGER.info("Initializing Data Gatherer for mods {}", mods); + runningDataGen = true; Bootstrap.register(); dataGeneratorConfig = new GatherDataEvent.DataGeneratorConfig(mods, path, inputs, serverGenerators, clientGenerators, devToolGenerators, reportsGenerator, structureValidator, flat); existingFileHelper = new ExistingFileHelper(existingPacks, structureValidator);