diff --git a/src/main/java/owmii/powah/handler/ITags.java b/src/main/java/owmii/powah/handler/ITags.java index 5077bbc9..d2966174 100644 --- a/src/main/java/owmii/powah/handler/ITags.java +++ b/src/main/java/owmii/powah/handler/ITags.java @@ -9,6 +9,12 @@ public class ITags { public static class Blocks { + // Remove non-dry ice if Forge handles them in the future + public static final Tags.IOptionalNamedTag ICES = tag("ices"); + public static final Tags.IOptionalNamedTag ICES_ICE = tag("ices/ice"); + public static final Tags.IOptionalNamedTag ICES_PACKED = tag("ices/packed"); + public static final Tags.IOptionalNamedTag ICES_BLUE = tag("ices/blue"); + public static final Tags.IOptionalNamedTag ICES_DRY = tag("ices/dry"); public static final Tags.IOptionalNamedTag URANINITE_ORE = tag("ores/uraninite"); public static final Tags.IOptionalNamedTag URANINITE_ORE_POOR = tag("ores/uraninite_poor"); public static final Tags.IOptionalNamedTag URANINITE_ORE_DENSE = tag("ores/uraninite_dense"); @@ -20,6 +26,12 @@ private static Tags.IOptionalNamedTag tag(String name) { } public static class Items { + // Remove non-dry ice if Forge handles them in the future + public static final Tags.IOptionalNamedTag ICES = tag("ices"); + public static final Tags.IOptionalNamedTag ICES_ICE = tag("ices/ice"); + public static final Tags.IOptionalNamedTag ICES_PACKED = tag("ices/packed"); + public static final Tags.IOptionalNamedTag ICES_BLUE = tag("ices/blue"); + public static final Tags.IOptionalNamedTag ICES_DRY = tag("ices/dry"); public static final Tags.IOptionalNamedTag URANINITE_ORE = tag("ores/uraninite"); public static final Tags.IOptionalNamedTag URANINITE_ORE_POOR = tag("ores/uraninite_poor"); public static final Tags.IOptionalNamedTag URANINITE_ORE_DENSE = tag("ores/uraninite_dense"); diff --git a/src/main/java/owmii/powah/handler/event/DataEvents.java b/src/main/java/owmii/powah/handler/event/DataEvents.java index 2ae9b9e4..7ff8b647 100644 --- a/src/main/java/owmii/powah/handler/event/DataEvents.java +++ b/src/main/java/owmii/powah/handler/event/DataEvents.java @@ -4,14 +4,15 @@ import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.GatherDataEvent; +import owmii.powah.Powah; @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) public class DataEvents { @SubscribeEvent public static void gatherData(GatherDataEvent event) { DataGenerator generator = event.getGenerator(); - TagsProvider.Blocks bp = new TagsProvider.Blocks(generator); + TagsProvider.Blocks bp = new TagsProvider.Blocks(generator, Powah.MOD_ID, event.getExistingFileHelper()); generator.addProvider(bp); - generator.addProvider(new TagsProvider.Items(generator, bp)); + generator.addProvider(new TagsProvider.Items(generator, bp, Powah.MOD_ID, event.getExistingFileHelper())); } } diff --git a/src/main/java/owmii/powah/handler/event/TagsProvider.java b/src/main/java/owmii/powah/handler/event/TagsProvider.java index e3322ac6..4c5d0ed9 100644 --- a/src/main/java/owmii/powah/handler/event/TagsProvider.java +++ b/src/main/java/owmii/powah/handler/event/TagsProvider.java @@ -12,12 +12,20 @@ public class TagsProvider { public static class Blocks extends BlockTagsProvider { - public Blocks(DataGenerator generatorIn) { - super(generatorIn); + public Blocks(DataGenerator generatorIn, String modId, net.minecraftforge.common.data.ExistingFileHelper existingFileHelper) { + super(generatorIn, modId, existingFileHelper); } @Override protected void registerTags() { + // Remove non-dry ice if Forge handles them in the future + getOrCreateBuilder(ITags.Blocks.ICES).addTag(ITags.Blocks.ICES_ICE).addTag(ITags.Blocks.ICES_PACKED).addTag(ITags.Blocks.ICES_BLUE); + getOrCreateBuilder(ITags.Blocks.ICES_ICE).add(net.minecraft.block.Blocks.ICE); + getOrCreateBuilder(ITags.Blocks.ICES_PACKED).add(net.minecraft.block.Blocks.PACKED_ICE); + getOrCreateBuilder(ITags.Blocks.ICES_BLUE).add(net.minecraft.block.Blocks.BLUE_ICE); + getOrCreateBuilder(ITags.Blocks.ICES).addTag(ITags.Blocks.ICES_DRY); + getOrCreateBuilder(ITags.Blocks.ICES_DRY).add(Blcks.DRY_ICE); + getOrCreateBuilder(ORES).add(Blcks.URANINITE_ORE).add(Blcks.URANINITE_ORE_POOR).add(Blcks.URANINITE_ORE_DENSE); getOrCreateBuilder(ITags.Blocks.URANINITE_ORE).add(Blcks.URANINITE_ORE); getOrCreateBuilder(ITags.Blocks.URANINITE_ORE_POOR).add(Blcks.URANINITE_ORE_POOR); @@ -29,12 +37,20 @@ protected void registerTags() { } public static class Items extends ItemTagsProvider { - public Items(DataGenerator dataGenerator, BlockTagsProvider blockTagProvider) { - super(dataGenerator, blockTagProvider); + public Items(DataGenerator dataGenerator, BlockTagsProvider blockTagProvider, String modId, net.minecraftforge.common.data.ExistingFileHelper existingFileHelper) { + super(dataGenerator, blockTagProvider, modId, existingFileHelper); } @Override protected void registerTags() { + // Remove non-dry ice if Forge handles them in the future + getOrCreateBuilder(ITags.Items.ICES).addTag(ITags.Items.ICES_ICE).addTag(ITags.Items.ICES_PACKED).addTag(ITags.Items.ICES_BLUE); + getOrCreateBuilder(ITags.Items.ICES_ICE).add(net.minecraft.item.Items.ICE); + getOrCreateBuilder(ITags.Items.ICES_PACKED).add(net.minecraft.item.Items.PACKED_ICE); + getOrCreateBuilder(ITags.Items.ICES_BLUE).add(net.minecraft.item.Items.BLUE_ICE); + getOrCreateBuilder(ITags.Items.ICES).addTag(ITags.Items.ICES_DRY); + getOrCreateBuilder(ITags.Items.ICES_DRY).add(Blcks.DRY_ICE.asItem()); + getOrCreateBuilder(Tags.Items.ORES).add(Blcks.URANINITE_ORE.asItem()).add(Blcks.URANINITE_ORE_POOR.asItem()).add(Blcks.URANINITE_ORE_DENSE.asItem()); getOrCreateBuilder(ITags.Items.URANINITE_ORE).add(Blcks.URANINITE_ORE.asItem()); getOrCreateBuilder(ITags.Items.URANINITE_ORE_POOR).add(Blcks.URANINITE_ORE_POOR.asItem());