|
7 | 7 | import com.gregtechceu.gtceu.api.data.chemical.material.ItemMaterialData; |
8 | 8 | import com.gregtechceu.gtceu.api.data.chemical.material.Material; |
9 | 9 | import com.gregtechceu.gtceu.api.data.chemical.material.properties.FluidProperty; |
| 10 | +import com.gregtechceu.gtceu.api.data.chemical.material.properties.OreProperty; |
10 | 11 | import com.gregtechceu.gtceu.api.data.chemical.material.properties.PropertyKey; |
11 | 12 | import com.gregtechceu.gtceu.api.data.chemical.material.stack.MaterialStack; |
12 | 13 | import com.gregtechceu.gtceu.api.data.tag.TagPrefix; |
|
17 | 18 | import com.gregtechceu.gtceu.api.fluids.store.FluidStorageKeys; |
18 | 19 | import com.gregtechceu.gtceu.api.registry.GTRegistries; |
19 | 20 | import com.gregtechceu.gtceu.api.registry.registrate.forge.GTClientFluidTypeExtensions; |
20 | | -import com.gregtechceu.gtceu.common.data.GTBlocks; |
21 | 21 | import com.gregtechceu.gtceu.common.data.GTMaterialBlocks; |
22 | 22 | import com.gregtechceu.gtceu.common.data.GTMaterialItems; |
23 | 23 | import com.gregtechceu.gtceu.config.ConfigHolder; |
@@ -72,11 +72,25 @@ public static <T> void generateGTDynamicTags(Map<ResourceLocation, List<TagLoade |
72 | 72 | for (TagKey<Item> materialTag : materialTags) { |
73 | 73 | List<TagLoader.EntryWithSource> tags = new ArrayList<>(); |
74 | 74 | itemLikes.forEach(item -> tags.add(new TagLoader.EntryWithSource( |
75 | | - TagEntry.element(BuiltInRegistries.ITEM.getKey(item.get().asItem())), |
| 75 | + TagEntry.element(BuiltInRegistries.ITEM.getKey(item.get())), |
76 | 76 | GTValues.CUSTOM_TAG_SOURCE))); |
77 | 77 | tagMap.computeIfAbsent(materialTag.location(), path -> new ArrayList<>()).addAll(tags); |
78 | 78 | } |
79 | 79 |
|
| 80 | + if (entry.tagPrefix() == TagPrefix.crushed && material.hasProperty(PropertyKey.ORE)) { |
| 81 | + OreProperty ore = material.getProperty(PropertyKey.ORE); |
| 82 | + Material washedIn = ore.getWashedIn().first(); |
| 83 | + if (washedIn.isNull()) return; |
| 84 | + ResourceLocation generalTag = CustomTags.CHEM_BATH_WASHABLE.location(); |
| 85 | + ResourceLocation specificTag = generalTag.withSuffix("/" + washedIn.getName()); |
| 86 | + |
| 87 | + List<TagLoader.EntryWithSource> tags = new ArrayList<>(); |
| 88 | + itemLikes.forEach(item -> tags.add(new TagLoader.EntryWithSource( |
| 89 | + TagEntry.element(BuiltInRegistries.ITEM.getKey(item.get())), |
| 90 | + GTValues.CUSTOM_TAG_SOURCE))); |
| 91 | + tagMap.computeIfAbsent(generalTag, path -> new ArrayList<>()).addAll(tags); |
| 92 | + tagMap.computeIfAbsent(specificTag, path -> new ArrayList<>()).addAll(tags); |
| 93 | + } |
80 | 94 | } |
81 | 95 | }); |
82 | 96 |
|
@@ -133,13 +147,6 @@ public static <T> void generateGTDynamicTags(Map<ResourceLocation, List<TagLoade |
133 | 147 | .add(new TagLoader.EntryWithSource(TagEntry.element(id), GTValues.CUSTOM_TAG_SOURCE)); |
134 | 148 | }); |
135 | 149 |
|
136 | | - GTBlocks.ALL_FUSION_CASINGS.forEach((casingType, block) -> { |
137 | | - ResourceLocation blockId = BuiltInRegistries.BLOCK.getKey(block.get()); |
138 | | - tagMap.computeIfAbsent(CustomTags.TOOL_TIERS[casingType.getHarvestLevel()].location(), |
139 | | - path -> new ArrayList<>()) |
140 | | - .add(new TagLoader.EntryWithSource(TagEntry.element(blockId), GTValues.CUSTOM_TAG_SOURCE)); |
141 | | - }); |
142 | | - |
143 | 150 | // if config is NOT enabled, add the pickaxe/axe tags to the "configurable" mineability tags |
144 | 151 | if (!ConfigHolder.INSTANCE.machines.requireGTToolsForBlocks) { |
145 | 152 | var tagList = tagMap.computeIfAbsent(BlockTags.MINEABLE_WITH_PICKAXE.location(), |
|
0 commit comments