Skip to content

Commit 9d70c5e

Browse files
committed
Minor datagen code cleanup to take advantage of newer Neo helpers
1 parent 5f9cd91 commit 9d70c5e

File tree

4 files changed

+9
-27
lines changed

4 files changed

+9
-27
lines changed

src/datagen/additions/java/mekanism/additions/common/AdditionsTagProvider.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,7 @@ private void addToTags(TagKey<Item> itemTag, TagKey<Block> blockTag, Map<EnumCol
156156
DyeColor dyeColor = entry.getKey().getDyeColor();
157157
if (dyeColor != null) {
158158
addToTags(Tags.Items.DYED, Tags.Blocks.DYED, entry.getValue());
159-
TagKey<Item> dyedColor = ItemTags.create(Tags.Items.DYED.location().withSuffix("/" + dyeColor.getName()));
160-
addToTags(dyedColor, BlockTags.create(dyedColor.location()), entry.getValue());
159+
addToTags(dyeColor.getDyedTag(), BlockTags.create(dyeColor.getDyedTag().location()), entry.getValue());
161160
}
162161
}
163162
}
@@ -168,7 +167,7 @@ private void addToTag(TagKey<Item> itemTag, Map<EnumColor, ? extends IItemProvid
168167
DyeColor dyeColor = entry.getKey().getDyeColor();
169168
if (dyeColor != null) {
170169
addToTag(Tags.Items.DYED, entry.getValue());
171-
addToTag(ItemTags.create(Tags.Items.DYED.location().withSuffix("/" + dyeColor.getName())), entry.getValue());
170+
addToTag(dyeColor.getDyedTag(), entry.getValue());
172171
}
173172
}
174173
}

src/datagen/main/java/mekanism/common/recipe/impl/PigmentExtractingRecipeProvider.java

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import mekanism.common.recipe.ISubRecipeProvider;
1111
import mekanism.common.registries.MekanismPigments;
1212
import mekanism.common.tags.MekanismTags;
13+
import mekanism.common.util.EnumUtils;
1314
import net.minecraft.data.recipes.RecipeOutput;
1415
import net.minecraft.tags.TagKey;
1516
import net.minecraft.world.item.DyeColor;
@@ -18,7 +19,6 @@
1819
import net.minecraft.world.item.crafting.Ingredient;
1920
import net.minecraft.world.level.block.BannerBlock;
2021
import net.minecraft.world.level.block.Blocks;
21-
import net.neoforged.neoforge.common.Tags;
2222
import net.neoforged.neoforge.common.crafting.IntersectionIngredient;
2323

2424
public class PigmentExtractingRecipeProvider implements ISubRecipeProvider {
@@ -37,22 +37,12 @@ public class PigmentExtractingRecipeProvider implements ISubRecipeProvider {
3737
private static final Map<EnumColor, TagKey<Item>> DYED_TAGS = new EnumMap<>(EnumColor.class);
3838

3939
static {
40-
DYED_TAGS.put(EnumColor.WHITE, Tags.Items.DYED_WHITE);
41-
DYED_TAGS.put(EnumColor.ORANGE, Tags.Items.DYED_ORANGE);
42-
DYED_TAGS.put(EnumColor.PINK, Tags.Items.DYED_MAGENTA);
43-
DYED_TAGS.put(EnumColor.INDIGO, Tags.Items.DYED_LIGHT_BLUE);
44-
DYED_TAGS.put(EnumColor.YELLOW, Tags.Items.DYED_YELLOW);
45-
DYED_TAGS.put(EnumColor.BRIGHT_GREEN, Tags.Items.DYED_LIME);
46-
DYED_TAGS.put(EnumColor.BRIGHT_PINK, Tags.Items.DYED_PINK);
47-
DYED_TAGS.put(EnumColor.DARK_GRAY, Tags.Items.DYED_GRAY);
48-
DYED_TAGS.put(EnumColor.GRAY, Tags.Items.DYED_LIGHT_GRAY);
49-
DYED_TAGS.put(EnumColor.DARK_AQUA, Tags.Items.DYED_CYAN);
50-
DYED_TAGS.put(EnumColor.PURPLE, Tags.Items.DYED_PURPLE);
51-
DYED_TAGS.put(EnumColor.DARK_BLUE, Tags.Items.DYED_BLUE);
52-
DYED_TAGS.put(EnumColor.BROWN, Tags.Items.DYED_BROWN);
53-
DYED_TAGS.put(EnumColor.DARK_GREEN, Tags.Items.DYED_GREEN);
54-
DYED_TAGS.put(EnumColor.RED, Tags.Items.DYED_RED);
55-
DYED_TAGS.put(EnumColor.BLACK, Tags.Items.DYED_BLACK);
40+
for (EnumColor color : EnumUtils.COLORS) {
41+
DyeColor dyeColor = color.getDyeColor();
42+
if (dyeColor != null) {
43+
DYED_TAGS.put(color, dyeColor.getDyedTag());
44+
}
45+
}
5646
}
5747

5848
@Override

src/datagen/main/resources/META-INF/datagen_ats.cfg

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,5 @@ public net.minecraft.data.HashCache cachePaths
77
public-f net.minecraft.data.HashCache initialCount
88
public net.minecraft.data.HashCache writes
99

10-
#Armor trim
11-
public net.minecraft.data.models.ItemModelGenerators GENERATED_TRIM_MODELS
12-
public net.minecraft.data.models.ItemModelGenerators$TrimModelData
13-
1410
#Misc
1511
protected net.minecraft.world.level.storage.loot.functions.CopyNbtFunction$Builder <init>(Lnet/minecraft/world/level/storage/loot/providers/nbt/NbtProvider;)V

src/main/resources/META-INF/accesstransformer.cfg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ public net.minecraft.client.model.geom.ModelPart$Cube polygons
6464
public net.minecraft.client.model.geom.ModelPart$Vertex
6565
public net.minecraft.client.model.geom.ModelPart$Polygon
6666

67-
protected net.minecraft.client.particle.BubbleParticle <init>(Lnet/minecraft/client/multiplayer/ClientLevel;DDDDDD)V
68-
protected net.minecraft.client.particle.FlameParticle <init>(Lnet/minecraft/client/multiplayer/ClientLevel;DDDDDD)V
69-
7067
public net.minecraft.client.renderer.entity.LivingEntityRenderer layers
7168
public net.minecraft.client.renderer.entity.layers.HumanoidArmorLayer innerModel
7269
public net.minecraft.client.renderer.entity.layers.HumanoidArmorLayer outerModel

0 commit comments

Comments
 (0)