mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-25 22:44:32 +00:00
Remove forge optional tags in favor of Vanilla's new system. (#7246)
This commit is contained in:
1 parent
132cc3659d
commit
edca0c7293
7 files changed
+31
-136
No files matched your search
@@ -22,10 +22,6 @@ package net.minecraftforge.common.extensions;
|
||||
import net.minecraft.data.TagsProvider;
|
||||
import net.minecraft.tags.ITag;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
||||
//TODO, Tag removal support.
|
||||
public interface IForgeTagBuilder<T>
|
||||
@@ -53,25 +49,13 @@ public interface IForgeTagBuilder<T>
|
||||
return getBuilder();
|
||||
}
|
||||
|
||||
default TagsProvider.Builder<T> addOptional(final ResourceLocation... locations)
|
||||
default TagsProvider.Builder<T> addOptional(final ResourceLocation location)
|
||||
{
|
||||
return addOptional(Arrays.asList(locations));
|
||||
return getBuilder().add(new ITag.OptionalItemEntry(location));
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
default TagsProvider.Builder<T> addOptional(final Collection<ResourceLocation> locations)
|
||||
default TagsProvider.Builder<T> addOptionalTag(final ResourceLocation location)
|
||||
{
|
||||
return getBuilder().add(ForgeHooks.makeOptionalTag(true, locations));
|
||||
}
|
||||
|
||||
default TagsProvider.Builder<T> addOptionalTag(final ResourceLocation... locations)
|
||||
{
|
||||
return addOptionalTag(Arrays.asList(locations));
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
default TagsProvider.Builder<T> addOptionalTag(final Collection<ResourceLocation> locations)
|
||||
{
|
||||
return getBuilder().add(ForgeHooks.makeOptionalTag(false, locations));
|
||||
return getBuilder().add(new ITag.OptionalTagEntry(location));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user