simplify duplicate tagging

This commit is contained in:
LordGrimmauld 2020-06-19 22:59:38 +02:00
parent a6fab28722
commit b5afa41152
7 changed files with 35 additions and 15 deletions

View file

@ -2410,6 +2410,7 @@ d3fdb8ece6cb072a93ddb64a0baad5ac952117a4 data\create\recipes\weathered_limestone
6eceb25fabbb6b389ca35de3b829ad061c9c456a data\create\recipes\weathered_limestone_pillar.json
11667414f73bc2d00bda7c5c1a7d2934bf6e9165 data\create\recipes\weathered_limestone_pillar_from_weathered_limestone_stonecutting.json
266f08e604d229a9d2b46f7272c0b06ec270bf3d data\create\recipes\zinc_block.json
081f5aa35602fc27af2ca01ea9f2fd5e7eb284dc data\create\tags\items\create_ingots.json
d2dc4ff179ef7b2aa9276455c196e15d44aa95a8 data\create\tags\items\crushed_ores.json
16bcb8fcbe9170c2c11f1ca8d99d8b36cd812bbd data\forge\tags\blocks\glass\colorless.json
81ced867d24ec814942909965dd4576eff1db685 data\forge\tags\blocks\glass_panes.json
@ -2418,10 +2419,10 @@ d5ea262a0f5fb210612d22521818e26cf08e591a data\forge\tags\blocks\ores\zinc.json
ff1900963bc4cd8ceffa78d58ef1952ceacb2fb7 data\forge\tags\blocks\storage_blocks\brass.json
f6c8f34ceb475546dba5cc6ff288863ea795d20b data\forge\tags\blocks\storage_blocks\copper.json
7f71a774800111e50b42de0e6159ed2d2a807d32 data\forge\tags\blocks\storage_blocks\zinc.json
081f5aa35602fc27af2ca01ea9f2fd5e7eb284dc data\forge\tags\items\beacon_payment.json
d9ffc62a496946fc4848934e7c0a6e917337f8be data\forge\tags\items\beacon_payment.json
16bcb8fcbe9170c2c11f1ca8d99d8b36cd812bbd data\forge\tags\items\glass\colorless.json
81ced867d24ec814942909965dd4576eff1db685 data\forge\tags\items\glass_panes.json
081f5aa35602fc27af2ca01ea9f2fd5e7eb284dc data\forge\tags\items\ingots.json
d9ffc62a496946fc4848934e7c0a6e917337f8be data\forge\tags\items\ingots.json
2dfd21017cb51d4bdc18d977a7d16f103cc3a985 data\forge\tags\items\ingots\brass.json
8e0ca32df10a50544f54fbe3dbfe485971b23315 data\forge\tags\items\ingots\copper.json
2f9ac80569a5cc168061742f9e3c36277d4d056e data\forge\tags\items\ingots\zinc.json

View file

@ -0,0 +1,8 @@
{
"replace": false,
"values": [
"create:copper_ingot",
"create:zinc_ingot",
"create:brass_ingot"
]
}

View file

@ -1,8 +1,6 @@
{
"replace": false,
"values": [
"create:copper_ingot",
"create:zinc_ingot",
"create:brass_ingot"
"#create:create_ingots"
]
}

View file

@ -1,8 +1,6 @@
{
"replace": false,
"values": [
"create:copper_ingot",
"create:zinc_ingot",
"create:brass_ingot"
"#create:create_ingots"
]
}

View file

@ -72,12 +72,9 @@ public class AllItems {
CRUSHED_BRASS = taggedIngredient("crushed_brass", AllItemTags.CRUSHED_ORES.tag),
ANDESITE_ALLOY = ingredient("andesite_alloy"),
COPPER_INGOT = taggedIngredient("copper_ingot", forgeItemTag("ingots/copper"), AllItemTags.beacon_payment.tag,
AllItemTags.ingots.tag),
ZINC_INGOT = taggedIngredient("zinc_ingot", forgeItemTag("ingots/zinc"), AllItemTags.beacon_payment.tag,
AllItemTags.ingots.tag),
BRASS_INGOT = taggedIngredient("brass_ingot", forgeItemTag("ingots/brass"), AllItemTags.beacon_payment.tag,
AllItemTags.ingots.tag),
COPPER_INGOT = taggedIngredient("copper_ingot", forgeItemTag("ingots/copper"), AllItemTags.CREATE_INGOTS.tag),
ZINC_INGOT = taggedIngredient("zinc_ingot", forgeItemTag("ingots/zinc"), AllItemTags.CREATE_INGOTS.tag),
BRASS_INGOT = taggedIngredient("brass_ingot", forgeItemTag("ingots/brass"), AllItemTags.CREATE_INGOTS.tag),
WHEAT_FLOUR = ingredient("wheat_flour"), DOUGH = ingredient("dough"),
POWDERED_OBSIDIAN = ingredient("powdered_obsidian"), ROSE_QUARTZ = ingredient("rose_quartz"),

View file

@ -1,8 +1,10 @@
package com.simibubi.create;
import com.simibubi.create.foundation.data.CreateRegistrate;
import com.simibubi.create.foundation.utility.Lang;
import com.tterrag.registrate.builders.BlockBuilder;
import com.tterrag.registrate.builders.ItemBuilder;
import com.tterrag.registrate.providers.ProviderType;
import com.tterrag.registrate.util.nullness.NonNullFunction;
import net.minecraft.block.Block;
@ -17,6 +19,9 @@ import net.minecraft.tags.TagCollection;
import net.minecraft.util.ResourceLocation;
public class AllTags {
private static final CreateRegistrate REGISTRATE = Create.registrate()
.itemGroup(() -> Create.baseCreativeTab);
public static <T extends Block, P> NonNullFunction<BlockBuilder<T, P>, ItemBuilder<BlockItem, BlockBuilder<T, P>>> tagBlockAndItem(
String tagName) {
return b -> b.tag(forgeBlockTag(tagName))
@ -41,7 +46,12 @@ public class AllTags {
}
public static enum AllItemTags {
CRUSHED_ORES, beacon_payment("", "forge"), ingots("", "forge"), nuggets("", "forge"), plates("", "forge");
CRUSHED_ORES,
CREATE_INGOTS,
beacon_payment("", "forge"),
ingots("", "forge"),
nuggets("", "forge"),
plates("", "forge");
public Tag<Item> tag;
@ -81,4 +91,11 @@ public class AllTags {
return tag.contains(block.getBlock());
}
}
public static void register() {
REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, prov -> prov.getBuilder(AllItemTags.beacon_payment.tag)
.add(AllItemTags.CREATE_INGOTS.tag));
REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, prov -> prov.getBuilder(AllItemTags.ingots.tag)
.add(AllItemTags.CREATE_INGOTS.tag));
}
}

View file

@ -57,6 +57,7 @@ public class Create {
AllBlocks.register();
AllItems.register();
AllTags.register();
AllPaletteBlocks.register();
AllEntityTypes.register();
AllTileEntities.register();