Skip to content

Commit e78d1d6

Browse files
Add "Washed by 'Liquid'" tag for filtering (#3171)
Co-authored-by: screret <68943070+screret@users.noreply.github.com>
1 parent ca90097 commit e78d1d6

3 files changed

Lines changed: 19 additions & 10 deletions

File tree

src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.gregtechceu.gtceu.api.data.chemical.material.ItemMaterialData;
88
import com.gregtechceu.gtceu.api.data.chemical.material.Material;
99
import com.gregtechceu.gtceu.api.data.chemical.material.properties.FluidProperty;
10+
import com.gregtechceu.gtceu.api.data.chemical.material.properties.OreProperty;
1011
import com.gregtechceu.gtceu.api.data.chemical.material.properties.PropertyKey;
1112
import com.gregtechceu.gtceu.api.data.chemical.material.stack.MaterialStack;
1213
import com.gregtechceu.gtceu.api.data.tag.TagPrefix;
@@ -17,7 +18,6 @@
1718
import com.gregtechceu.gtceu.api.fluids.store.FluidStorageKeys;
1819
import com.gregtechceu.gtceu.api.registry.GTRegistries;
1920
import com.gregtechceu.gtceu.api.registry.registrate.forge.GTClientFluidTypeExtensions;
20-
import com.gregtechceu.gtceu.common.data.GTBlocks;
2121
import com.gregtechceu.gtceu.common.data.GTMaterialBlocks;
2222
import com.gregtechceu.gtceu.common.data.GTMaterialItems;
2323
import com.gregtechceu.gtceu.config.ConfigHolder;
@@ -72,11 +72,25 @@ public static <T> void generateGTDynamicTags(Map<ResourceLocation, List<TagLoade
7272
for (TagKey<Item> materialTag : materialTags) {
7373
List<TagLoader.EntryWithSource> tags = new ArrayList<>();
7474
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())),
7676
GTValues.CUSTOM_TAG_SOURCE)));
7777
tagMap.computeIfAbsent(materialTag.location(), path -> new ArrayList<>()).addAll(tags);
7878
}
7979

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+
}
8094
}
8195
});
8296

@@ -133,13 +147,6 @@ public static <T> void generateGTDynamicTags(Map<ResourceLocation, List<TagLoade
133147
.add(new TagLoader.EntryWithSource(TagEntry.element(id), GTValues.CUSTOM_TAG_SOURCE));
134148
});
135149

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-
143150
// if config is NOT enabled, add the pickaxe/axe tags to the "configurable" mineability tags
144151
if (!ConfigHolder.INSTANCE.machines.requireGTToolsForBlocks) {
145152
var tagList = tagMap.computeIfAbsent(BlockTags.MINEABLE_WITH_PICKAXE.location(),

src/main/java/com/gregtechceu/gtceu/data/recipe/CustomTags.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ public class CustomTags {
120120
public static final TagKey<Item> STEP_BOOTS = TagUtil.createModItemTag("step_boots");
121121
public static final TagKey<Item> RUBBER_LOGS = TagUtil.createModItemTag("rubber_logs");
122122

123+
public static final TagKey<Item> CHEM_BATH_WASHABLE = TagUtil.createModItemTag("chemical_bath_washable");
124+
123125
// Mineability tags
124126
public static final TagKey<Block> MINEABLE_WITH_WRENCH = TagUtil.createBlockTag("mineable/wrench");
125127
public static final TagKey<Block> MINEABLE_WITH_WIRE_CUTTER = TagUtil.createBlockTag("mineable/wire_cutter");

src/main/java/com/gregtechceu/gtceu/utils/GTUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
import java.lang.reflect.ParameterizedType;
5252
import java.lang.reflect.Type;
53-
import java.util.List;
53+
import java.util.*;
5454

5555
import static com.gregtechceu.gtceu.api.data.chemical.material.properties.PropertyKey.HAZARD;
5656

0 commit comments

Comments
 (0)