ForgePatch/patches/minecraft/net/minecraft/tags/ITagCollectionSupplier.java...

53 lines
2.2 KiB
Diff

--- a/net/minecraft/tags/ITagCollectionSupplier.java
+++ b/net/minecraft/tags/ITagCollectionSupplier.java
@@ -8,7 +8,7 @@
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.registry.Registry;
-public interface ITagCollectionSupplier {
+public interface ITagCollectionSupplier extends net.minecraftforge.common.extensions.IForgeTagCollectionSupplier {
ITagCollectionSupplier field_242208_a = func_242209_a(ITagCollection.func_242205_c(), ITagCollection.func_242205_c(), ITagCollection.func_242205_c(), ITagCollection.func_242205_c());
ITagCollection<Block> func_241835_a();
@@ -22,6 +22,7 @@
default void func_242212_e() {
TagRegistryManager.func_242193_a(this);
Blocks.func_235419_a_();
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.TagsUpdatedEvent.VanillaTagTypes(this));
}
default void func_242210_a(PacketBuffer p_242210_1_) {
@@ -58,4 +59,32 @@
}
};
}
+
+ static ITagCollectionSupplier reinjectOptionalTags(ITagCollectionSupplier tagCollectionSupplier) {
+ ITagCollection<Block> blockTagCollection = BlockTags.field_199899_c.reinjectOptionalTags(tagCollectionSupplier.func_241835_a());
+ ITagCollection<Item> itemTagCollection = ItemTags.field_199906_c.reinjectOptionalTags(tagCollectionSupplier.func_241836_b());
+ ITagCollection<Fluid> fluidTagCollection = FluidTags.field_206961_c.reinjectOptionalTags(tagCollectionSupplier.func_241837_c());
+ ITagCollection<EntityType<?>> entityTypeTagCollection = EntityTypeTags.field_219766_c.reinjectOptionalTags(tagCollectionSupplier.func_241838_d());
+ return new ITagCollectionSupplier() {
+ @Override
+ public ITagCollection<Block> func_241835_a() {
+ return blockTagCollection;
+ }
+
+ @Override
+ public ITagCollection<Item> func_241836_b() {
+ return itemTagCollection;
+ }
+
+ @Override
+ public ITagCollection<Fluid> func_241837_c() {
+ return fluidTagCollection;
+ }
+
+ @Override
+ public ITagCollection<EntityType<?>> func_241838_d() {
+ return entityTypeTagCollection;
+ }
+ };
+ }
}