From dde70cdf19931fd0ccebc2498ccd9cbdca0d2f79 Mon Sep 17 00:00:00 2001 From: Mirality Date: Sun, 22 Dec 2024 18:37:11 +1300 Subject: [PATCH 1/3] Tidy up crafting tags for 1.21 --- .../tags/item/blacksmith_product.json | 1 + .../tags/item/fletcher_do_ingredient.json | 22 ++++++++++++++++++ .../tags/item/mechanic_product.json | 11 ++++++++- .../tags/item/mechanic_product_excluded.json | 1 + .../tags/item/stonemason_do_ingredient.json | 4 +++- .../tags/item/stonemason_product.json | 2 ++ .../defaults/DefaultItemTagsProvider.java | 23 +++++++++++++------ 7 files changed, 55 insertions(+), 9 deletions(-) create mode 100644 src/datagen/generated/minecolonies/data/minecolonies/tags/item/fletcher_do_ingredient.json diff --git a/src/datagen/generated/minecolonies/data/minecolonies/tags/item/blacksmith_product.json b/src/datagen/generated/minecolonies/data/minecolonies/tags/item/blacksmith_product.json index 3fe56c9b026..4e60bf1cd7c 100644 --- a/src/datagen/generated/minecolonies/data/minecolonies/tags/item/blacksmith_product.json +++ b/src/datagen/generated/minecolonies/data/minecolonies/tags/item/blacksmith_product.json @@ -2,6 +2,7 @@ "values": [ "minecraft:shears", "minecraft:lightning_rod", + "minecraft:mace", "#c:nuggets", "#c:ingots" ] diff --git a/src/datagen/generated/minecolonies/data/minecolonies/tags/item/fletcher_do_ingredient.json b/src/datagen/generated/minecolonies/data/minecolonies/tags/item/fletcher_do_ingredient.json new file mode 100644 index 00000000000..a9174b91ec8 --- /dev/null +++ b/src/datagen/generated/minecolonies/data/minecolonies/tags/item/fletcher_do_ingredient.json @@ -0,0 +1,22 @@ +{ + "values": [ + "minecraft:azalea_leaves", + "minecraft:flowering_azalea_leaves", + "minecraft:coarse_dirt", + "minecraft:rooted_dirt", + "minecraft:grass_block", + "minecraft:hay_block", + "minecraft:moss_block", + "minecraft:dried_kelp_block", + "minecraft:mud", + "minecraft:packed_mud", + "minecraft:mud_bricks", + "minecraft:muddy_mangrove_roots", + "minecraft:podzol", + "minecraft:mycelium", + "minecraft:brown_mushroom_block", + "minecraft:red_mushroom_block", + "minecraft:nether_wart_block", + "minecraft:warped_wart_block" + ] +} \ No newline at end of file diff --git a/src/datagen/generated/minecolonies/data/minecolonies/tags/item/mechanic_product.json b/src/datagen/generated/minecolonies/data/minecolonies/tags/item/mechanic_product.json index 15c932afcdc..ebab7aebc37 100644 --- a/src/datagen/generated/minecolonies/data/minecolonies/tags/item/mechanic_product.json +++ b/src/datagen/generated/minecolonies/data/minecolonies/tags/item/mechanic_product.json @@ -30,9 +30,18 @@ "minecraft:fire_charge", "minecraft:conduit", "minecraft:respawn_anchor", + "minecraft:recovery_compass", "minecraft:shulker_box", "minecraft:slime_ball", "minecraft:glow_item_frame", - "minecraft:spyglass" + "minecraft:spyglass", + "minecraft:waxed_copper_door", + "minecraft:waxed_copper_trapdoor", + "minecraft:waxed_exposed_copper_door", + "minecraft:waxed_exposed_copper_trapdoor", + "minecraft:waxed_oxidized_copper_door", + "minecraft:waxed_oxidized_copper_trapdoor", + "minecraft:waxed_weathered_copper_door", + "minecraft:waxed_weathered_copper_trapdoor" ] } \ No newline at end of file diff --git a/src/datagen/generated/minecolonies/data/minecolonies/tags/item/mechanic_product_excluded.json b/src/datagen/generated/minecolonies/data/minecolonies/tags/item/mechanic_product_excluded.json index e97476ced9b..7e0da38613f 100644 --- a/src/datagen/generated/minecolonies/data/minecolonies/tags/item/mechanic_product_excluded.json +++ b/src/datagen/generated/minecolonies/data/minecolonies/tags/item/mechanic_product_excluded.json @@ -2,6 +2,7 @@ "values": [ "minecraft:spectral_arrow", "minecraft:hay_block", + "minecraft:wheat", "minecraft:lead" ] } \ No newline at end of file diff --git a/src/datagen/generated/minecolonies/data/minecolonies/tags/item/stonemason_do_ingredient.json b/src/datagen/generated/minecolonies/data/minecolonies/tags/item/stonemason_do_ingredient.json index b55dcef52f2..0e23681655d 100644 --- a/src/datagen/generated/minecolonies/data/minecolonies/tags/item/stonemason_do_ingredient.json +++ b/src/datagen/generated/minecolonies/data/minecolonies/tags/item/stonemason_do_ingredient.json @@ -2,7 +2,9 @@ "values": [ "minecraft:stone", "minecraft:calcite", - "minecraft:mud_bricks", + "minecraft:polished_andesite", + "minecraft:polished_diorite", + "minecraft:polished_granite", "minecraft:quartz_block", "minecraft:smooth_quartz", "minecraft:quartz_bricks", diff --git a/src/datagen/generated/minecolonies/data/minecolonies/tags/item/stonemason_product.json b/src/datagen/generated/minecolonies/data/minecolonies/tags/item/stonemason_product.json index 5f7561d7e87..bdf43e5d0a9 100644 --- a/src/datagen/generated/minecolonies/data/minecolonies/tags/item/stonemason_product.json +++ b/src/datagen/generated/minecolonies/data/minecolonies/tags/item/stonemason_product.json @@ -7,9 +7,11 @@ "minecraft:cracked_deepslate_tiles", "minecraft:bricks", "minecraft:polished_blackstone_bricks", + "minecraft:tuff_bricks", "minecraft:nether_bricks", "minecraft:chiseled_nether_bricks", "minecraft:dripstone_block", + "minecraft:quartz_block", "minecraft:chiseled_quartz_block", "minecraft:quartz_pillar", "minecraft:quartz_bricks", diff --git a/src/main/java/com/minecolonies/core/generation/defaults/DefaultItemTagsProvider.java b/src/main/java/com/minecolonies/core/generation/defaults/DefaultItemTagsProvider.java index 199d3436239..ec9d0b1c9f6 100644 --- a/src/main/java/com/minecolonies/core/generation/defaults/DefaultItemTagsProvider.java +++ b/src/main/java/com/minecolonies/core/generation/defaults/DefaultItemTagsProvider.java @@ -201,7 +201,7 @@ protected void addTags(final @NotNull HolderLookup.Provider provider) .addTag(ModTags.crafterIngredient.get(TagConstants.CRAFTING_MECHANIC)) .add(Items.BRICK, Items.NETHER_BRICK); tag(ModTags.crafterProduct.get(TagConstants.CRAFTING_BLACKSMITH)) - .add(Items.SHEARS, Items.LIGHTNING_ROD) + .add(Items.SHEARS, Items.LIGHTNING_ROD, Items.MACE) .addTags(Tags.Items.NUGGETS, Tags.Items.INGOTS); tag(ModTags.crafterProductExclusions.get(TagConstants.CRAFTING_BLACKSMITH)) .addTag(ModTags.crafterProduct.get(TagConstants.CRAFTING_DYER)) @@ -325,6 +325,11 @@ protected void addTags(final @NotNull HolderLookup.Provider provider) tag(ModTags.crafterProductExclusions.get(TagConstants.CRAFTING_FLETCHER)) .add(Items.BOOK) .add(Items.ITEM_FRAME); + tag(ModTags.crafterDoIngredient.get(TagConstants.CRAFTING_FLETCHER)) + .add(Items.AZALEA_LEAVES, Items.FLOWERING_AZALEA_LEAVES) + .add(Items.COARSE_DIRT, Items.ROOTED_DIRT, Items.GRASS_BLOCK, Items.HAY_BLOCK, Items.MOSS_BLOCK, Items.DRIED_KELP_BLOCK) + .add(Items.MUD, Items.PACKED_MUD, Items.MUD_BRICKS, Items.MUDDY_MANGROVE_ROOTS, Items.PODZOL, Items.MYCELIUM) + .add(Items.BROWN_MUSHROOM_BLOCK, Items.RED_MUSHROOM_BLOCK, Items.NETHER_WART_BLOCK, Items.WARPED_WART_BLOCK); tag(ModTags.crafterIngredient.get(TagConstants.CRAFTING_GLASSBLOWER)) .addTag(Tags.Items.GLASS_BLOCKS) @@ -382,13 +387,18 @@ protected void addTags(final @NotNull HolderLookup.Provider provider) .add(Items.FIRE_CHARGE) .add(Items.CONDUIT) .add(Items.RESPAWN_ANCHOR) + .add(Items.RECOVERY_COMPASS) .add(Items.SHULKER_BOX) .add(Items.SLIME_BALL) .add(Items.GLOW_ITEM_FRAME) - .add(Items.SPYGLASS); + .add(Items.SPYGLASS) + .add(Items.WAXED_COPPER_DOOR, Items.WAXED_COPPER_TRAPDOOR) + .add(Items.WAXED_EXPOSED_COPPER_DOOR, Items.WAXED_EXPOSED_COPPER_TRAPDOOR) + .add(Items.WAXED_OXIDIZED_COPPER_DOOR, Items.WAXED_OXIDIZED_COPPER_TRAPDOOR) + .add(Items.WAXED_WEATHERED_COPPER_DOOR, Items.WAXED_WEATHERED_COPPER_TRAPDOOR); tag(ModTags.crafterProductExclusions.get(TagConstants.CRAFTING_MECHANIC)) .add(Items.SPECTRAL_ARROW) - .add(Items.HAY_BLOCK) + .add(Items.HAY_BLOCK, Items.WHEAT) .add(Items.LEAD); tag(ModTags.crafterIngredient.get(TagConstants.CRAFTING_PLANTATION)) @@ -456,10 +466,10 @@ protected void addTags(final @NotNull HolderLookup.Provider provider) tag(ModTags.crafterProduct.get(TagConstants.CRAFTING_STONEMASON)) .add(Items.POLISHED_DEEPSLATE, Items.DEEPSLATE_BRICKS, Items.DEEPSLATE_TILES) .add(Items.CRACKED_DEEPSLATE_BRICKS, Items.CRACKED_DEEPSLATE_TILES) - .add(Items.BRICKS, Items.POLISHED_BLACKSTONE_BRICKS) + .add(Items.BRICKS, Items.POLISHED_BLACKSTONE_BRICKS, Items.TUFF_BRICKS) .add(Items.NETHER_BRICKS, Items.CHISELED_NETHER_BRICKS) .add(Items.DRIPSTONE_BLOCK) - .add(Items.CHISELED_QUARTZ_BLOCK) + .add(Items.QUARTZ_BLOCK, Items.CHISELED_QUARTZ_BLOCK) .add(Items.QUARTZ_PILLAR) .add(Items.QUARTZ_BRICKS) .add(Items.CUT_COPPER, Items.EXPOSED_CUT_COPPER, Items.OXIDIZED_CUT_COPPER, Items.WEATHERED_CUT_COPPER) @@ -482,8 +492,7 @@ protected void addTags(final @NotNull HolderLookup.Provider provider) .add(paperExtras); tag(ModTags.crafterDoIngredient.get(TagConstants.CRAFTING_STONEMASON)) - .add(Items.STONE, Items.CALCITE) - .add(Items.MUD_BRICKS) + .add(Items.STONE, Items.CALCITE, Items.POLISHED_ANDESITE, Items.POLISHED_DIORITE, Items.POLISHED_GRANITE) .add(Items.QUARTZ_BLOCK, Items.SMOOTH_QUARTZ, Items.QUARTZ_BRICKS, Items.QUARTZ_PILLAR, Items.CHISELED_QUARTZ_BLOCK) .add(Items.NETHERRACK) .add(Items.BLACKSTONE, Items.CHISELED_POLISHED_BLACKSTONE, Items.CRACKED_POLISHED_BLACKSTONE_BRICKS) From 3709dab9511f7d818a29fea7510727377cd7a7d0 Mon Sep 17 00:00:00 2001 From: Mirality Date: Sun, 22 Dec 2024 18:47:52 +1300 Subject: [PATCH 2/3] Fix missed port for #10473 --- .../core/generation/defaults/DefaultBlockTagsProvider.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/minecolonies/core/generation/defaults/DefaultBlockTagsProvider.java b/src/main/java/com/minecolonies/core/generation/defaults/DefaultBlockTagsProvider.java index 72ef4aba199..48aa5f0d9fe 100644 --- a/src/main/java/com/minecolonies/core/generation/defaults/DefaultBlockTagsProvider.java +++ b/src/main/java/com/minecolonies/core/generation/defaults/DefaultBlockTagsProvider.java @@ -187,12 +187,10 @@ protected void addTags(final HolderLookup.Provider holder) .addTag(BlockTags.LOGS) .addTag(ModTags.mangroveTree) .add(Blocks.MUSHROOM_STEM) - .addOptionalTag(new ResourceLocation("productivebees", "nests/wood_nests")); + .addOptionalTag(ResourceLocation.fromNamespaceAndPath("productivebees", "nests/wood_nests")); tag(ModTags.colonyProtectionException) - .addOptional(ResourceLocation.parse("waystones:waystone")) - .addOptional(ResourceLocation.parse("waystones:sandy_waystone")) - .addOptional(ResourceLocation.parse("waystones:mossy_waystone")); + .addOptionalTag(ResourceLocation.fromNamespaceAndPath("waystones", "waystones")); tag(ModTags.indestructible).add(Blocks.BEDROCK); tag(ModTags.oreChanceBlocks) From 16aee7100ae0ab11dadc2745a978f79c02b0222d Mon Sep 17 00:00:00 2001 From: Mirality Date: Sun, 22 Dec 2024 18:51:36 +1300 Subject: [PATCH 3/3] Port #10529 --- .../loot_table/{loot_tables => }/miner/lucky_ore1.json | 2 +- .../loot_table/{loot_tables => }/miner/lucky_ore2.json | 2 +- .../loot_table/{loot_tables => }/miner/lucky_ore3.json | 2 +- .../loot_table/{loot_tables => }/miner/lucky_ore4.json | 2 +- .../loot_table/{loot_tables => }/miner/lucky_ore5.json | 2 +- .../ai/workers/production/EntityAIStructureMiner.java | 9 +++------ 6 files changed, 8 insertions(+), 11 deletions(-) rename src/datagen/generated/minecolonies/data/minecolonies/loot_table/{loot_tables => }/miner/lucky_ore1.json (85%) rename src/datagen/generated/minecolonies/data/minecolonies/loot_table/{loot_tables => }/miner/lucky_ore2.json (90%) rename src/datagen/generated/minecolonies/data/minecolonies/loot_table/{loot_tables => }/miner/lucky_ore3.json (92%) rename src/datagen/generated/minecolonies/data/minecolonies/loot_table/{loot_tables => }/miner/lucky_ore4.json (94%) rename src/datagen/generated/minecolonies/data/minecolonies/loot_table/{loot_tables => }/miner/lucky_ore5.json (94%) diff --git a/src/datagen/generated/minecolonies/data/minecolonies/loot_table/loot_tables/miner/lucky_ore1.json b/src/datagen/generated/minecolonies/data/minecolonies/loot_table/miner/lucky_ore1.json similarity index 85% rename from src/datagen/generated/minecolonies/data/minecolonies/loot_table/loot_tables/miner/lucky_ore1.json rename to src/datagen/generated/minecolonies/data/minecolonies/loot_table/miner/lucky_ore1.json index d3f2141376e..98057f8a369 100644 --- a/src/datagen/generated/minecolonies/data/minecolonies/loot_table/loot_tables/miner/lucky_ore1.json +++ b/src/datagen/generated/minecolonies/data/minecolonies/loot_table/miner/lucky_ore1.json @@ -18,5 +18,5 @@ "rolls": 1.0 } ], - "random_sequence": "minecolonies:loot_tables/miner/lucky_ore1" + "random_sequence": "minecolonies:miner/lucky_ore1" } \ No newline at end of file diff --git a/src/datagen/generated/minecolonies/data/minecolonies/loot_table/loot_tables/miner/lucky_ore2.json b/src/datagen/generated/minecolonies/data/minecolonies/loot_table/miner/lucky_ore2.json similarity index 90% rename from src/datagen/generated/minecolonies/data/minecolonies/loot_table/loot_tables/miner/lucky_ore2.json rename to src/datagen/generated/minecolonies/data/minecolonies/loot_table/miner/lucky_ore2.json index 17b3a58ede2..17397b95a81 100644 --- a/src/datagen/generated/minecolonies/data/minecolonies/loot_table/loot_tables/miner/lucky_ore2.json +++ b/src/datagen/generated/minecolonies/data/minecolonies/loot_table/miner/lucky_ore2.json @@ -28,5 +28,5 @@ "rolls": 1.0 } ], - "random_sequence": "minecolonies:loot_tables/miner/lucky_ore2" + "random_sequence": "minecolonies:miner/lucky_ore2" } \ No newline at end of file diff --git a/src/datagen/generated/minecolonies/data/minecolonies/loot_table/loot_tables/miner/lucky_ore3.json b/src/datagen/generated/minecolonies/data/minecolonies/loot_table/miner/lucky_ore3.json similarity index 92% rename from src/datagen/generated/minecolonies/data/minecolonies/loot_table/loot_tables/miner/lucky_ore3.json rename to src/datagen/generated/minecolonies/data/minecolonies/loot_table/miner/lucky_ore3.json index ee6123f51e0..d684cf81372 100644 --- a/src/datagen/generated/minecolonies/data/minecolonies/loot_table/loot_tables/miner/lucky_ore3.json +++ b/src/datagen/generated/minecolonies/data/minecolonies/loot_table/miner/lucky_ore3.json @@ -38,5 +38,5 @@ "rolls": 1.0 } ], - "random_sequence": "minecolonies:loot_tables/miner/lucky_ore3" + "random_sequence": "minecolonies:miner/lucky_ore3" } \ No newline at end of file diff --git a/src/datagen/generated/minecolonies/data/minecolonies/loot_table/loot_tables/miner/lucky_ore4.json b/src/datagen/generated/minecolonies/data/minecolonies/loot_table/miner/lucky_ore4.json similarity index 94% rename from src/datagen/generated/minecolonies/data/minecolonies/loot_table/loot_tables/miner/lucky_ore4.json rename to src/datagen/generated/minecolonies/data/minecolonies/loot_table/miner/lucky_ore4.json index 47fc1fedbbb..3e05baab008 100644 --- a/src/datagen/generated/minecolonies/data/minecolonies/loot_table/loot_tables/miner/lucky_ore4.json +++ b/src/datagen/generated/minecolonies/data/minecolonies/loot_table/miner/lucky_ore4.json @@ -47,5 +47,5 @@ "rolls": 1.0 } ], - "random_sequence": "minecolonies:loot_tables/miner/lucky_ore4" + "random_sequence": "minecolonies:miner/lucky_ore4" } \ No newline at end of file diff --git a/src/datagen/generated/minecolonies/data/minecolonies/loot_table/loot_tables/miner/lucky_ore5.json b/src/datagen/generated/minecolonies/data/minecolonies/loot_table/miner/lucky_ore5.json similarity index 94% rename from src/datagen/generated/minecolonies/data/minecolonies/loot_table/loot_tables/miner/lucky_ore5.json rename to src/datagen/generated/minecolonies/data/minecolonies/loot_table/miner/lucky_ore5.json index a0d604f8c5b..4cabe4d9219 100644 --- a/src/datagen/generated/minecolonies/data/minecolonies/loot_table/loot_tables/miner/lucky_ore5.json +++ b/src/datagen/generated/minecolonies/data/minecolonies/loot_table/miner/lucky_ore5.json @@ -47,5 +47,5 @@ "rolls": 1.0 } ], - "random_sequence": "minecolonies:loot_tables/miner/lucky_ore5" + "random_sequence": "minecolonies:miner/lucky_ore5" } \ No newline at end of file diff --git a/src/main/java/com/minecolonies/core/entity/ai/workers/production/EntityAIStructureMiner.java b/src/main/java/com/minecolonies/core/entity/ai/workers/production/EntityAIStructureMiner.java index 12a7a7d34ba..1cc1a7647b3 100755 --- a/src/main/java/com/minecolonies/core/entity/ai/workers/production/EntityAIStructureMiner.java +++ b/src/main/java/com/minecolonies/core/entity/ai/workers/production/EntityAIStructureMiner.java @@ -25,7 +25,6 @@ import it.unimi.dsi.fastutil.objects.ObjectArrayList; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; -import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.Registries; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceKey; @@ -36,14 +35,12 @@ import net.minecraft.world.item.Items; import net.minecraft.world.level.block.*; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.material.FluidState; -import net.minecraft.world.level.material.Fluids; -import net.minecraft.world.level.storage.loot.LootTable; -import net.neoforged.neoforge.common.ItemAbilities; import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.LootParams.Builder; +import net.minecraft.world.level.storage.loot.LootTable; import net.minecraft.world.level.storage.loot.parameters.LootContextParamSet; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; +import net.neoforged.neoforge.common.ItemAbilities; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -78,7 +75,7 @@ public class EntityAIStructureMiner extends AbstractEntityAIStructureWithWorkOrd /** * Lucky ore loot table */ - public static final ResourceLocation LUCKY_ORE_LOOT_TABLE = new ResourceLocation(Constants.MOD_ID, "loot_tables/miner/lucky_ore"); + public static final ResourceLocation LUCKY_ORE_LOOT_TABLE = new ResourceLocation(Constants.MOD_ID, "miner/lucky_ore"); /** * Lead the miner to the other side of the shaft.