Class CraftTweakerTagRegistry
java.lang.Object
com.blamejared.crafttweaker.api.tag.CraftTweakerTagRegistry
@ZenRegister(loaders={"crafttweaker","tags"})
public final class CraftTweakerTagRegistry
extends Object
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescription<T> ITagManager<?>addManager(ITagManager<?> manager) Adds a newITagManagerto the registry.<T> ITagManager<?>addManager(Class<? extends ITagManager<?>> cls) Adds a newITagManagerto the registry.voidBinds the given results to the registry.voidbind(List<net.minecraft.tags.TagManager.LoadResult<?>> results, CraftTweakerTagRegistry.BindContext context) Binds the given results to the registry.voidbind(Map<net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>>, net.minecraft.tags.TagNetworkSerialization.NetworkPayload> tags) Binds the given map to the registry.voidbind(Map<net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>>, net.minecraft.tags.TagNetworkSerialization.NetworkPayload> tags, CraftTweakerTagRegistry.BindContext context) Binds the given map to the registry.voidbind(net.minecraft.tags.TagManager tagManager) Binds the givenTagManagerto the registry.<T> Optional<KnownTagManager<T>>findKnownManager(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> key) Finds aKnownTagManagerfor the givenResourceKey<T> Optional<ITagManager<?>>findManager(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> key) Finds aITagManagerfor the givenResourceKeybooleanisKnownManager(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>> key) Checks if the givenResourceKeyis aKnownTagManagerbooleanisKnownManager(net.minecraft.resources.ResourceLocation tagFolder) Checks if the given tagFolder corresponds to aKnownTagManagerbooleanisServerOnly(net.minecraft.resources.ResourceLocation tagFolder) Collection<net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>>>Gets allKnownTagManager's<T> KnownTagManager<T>knownTagManager(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> key) Gets theKnownTagManagercorresponding to the givenResourceKeymakeTagFolder(net.minecraft.resources.ResourceKey<?> key) managers()Gets all registeredITagManager's<T> ITagManager<?>tagManager(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> key) Gets theITagManagercorresponding to the givenResourceKey<T extends ITagManager<?>>
TtagManager(net.minecraft.resources.ResourceLocation registryLocation) Gets theITagManagercorresponding to the givenResourceLocation<T> Optional<? extends ITagManager<?>>tagManagerFromFolder(net.minecraft.resources.ResourceLocation tagFolder) Tries to get aITagManagerfrom the given tag folder.
-
Field Details
-
GLOBAL_NAME
- See Also:
-
INSTANCE
-
-
Method Details
-
addManager
Adds a newITagManagerto the registry.- Parameters:
cls- The class of theITagManagerto add.- Returns:
- The
ITagManagerthat was added.
-
addManager
Adds a newITagManagerto the registry.- Parameters:
manager- TheITagManagerto add.- Returns:
- The
ITagManagerthat was added.
-
managers
Gets all registeredITagManager's- Returns:
- All registered
ITagManager's
-
knownManagers
public Collection<net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>>> knownManagers()Gets allKnownTagManager's- Returns:
- All registered
KnownTagManager
-
findManager
public <T> Optional<ITagManager<?>> findManager(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> key) Finds aITagManagerfor the givenResourceKey- Parameters:
key- The key to find.- Returns:
- An optional
ITagManagerif found, an empty optional otherwise.
-
findKnownManager
public <T> Optional<KnownTagManager<T>> findKnownManager(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> key) Finds aKnownTagManagerfor the givenResourceKey- Parameters:
key- The key to find.- Returns:
- An optional
KnownTagManagerif found, an empty optional otherwise.
-
tagManagerFromFolder
public <T> Optional<? extends ITagManager<?>> tagManagerFromFolder(net.minecraft.resources.ResourceLocation tagFolder) Tries to get aITagManagerfrom the given tag folder.- Parameters:
tagFolder- The tag folder to get the manager of.- Returns:
- An optional
ITagManagerif found, an empty optional otherwise.
-
isServerOnly
public boolean isServerOnly(net.minecraft.resources.ResourceLocation tagFolder) -
isKnownManager
public boolean isKnownManager(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>> key) Checks if the givenResourceKeyis aKnownTagManager- Parameters:
key- The key of the manager to look for.- Returns:
- True if there is a
KnownTagManagerfor the given key.
-
isKnownManager
public boolean isKnownManager(net.minecraft.resources.ResourceLocation tagFolder) Checks if the given tagFolder corresponds to aKnownTagManager- Parameters:
tagFolder- The tag folder of the manager to look for.- Returns:
- True if there is a
KnownTagManagerfor the given folder.
-
tagManager
public <T> ITagManager<?> tagManager(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> key) Gets theITagManagercorresponding to the givenResourceKey- Parameters:
key- The key to look for.- Returns:
- The
ITagManagerfor the given key.
-
knownTagManager
public <T> KnownTagManager<T> knownTagManager(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> key) Gets theKnownTagManagercorresponding to the givenResourceKey- Parameters:
key- The key to look for.- Returns:
- The
KnownTagManagerfor the given key.
-
tagManager
public <T extends ITagManager<?>> T tagManager(net.minecraft.resources.ResourceLocation registryLocation) Gets theITagManagercorresponding to the givenResourceLocation- Parameters:
registryLocation- The location to look for.- Returns:
- The
ITagManagerfor the given location.
-
bind
public void bind(net.minecraft.tags.TagManager tagManager) Binds the givenTagManagerto the registry.Note: This will clear all registered managers.
- Parameters:
tagManager- TheTagManagerto bind.
-
bind
public void bind(Map<net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>>, net.minecraft.tags.TagNetworkSerialization.NetworkPayload> tags) Binds the given map to the registry.Note: This will clear all registered managers.
- Parameters:
tags- The map to bind.
-
bind
public void bind(Map<net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>>, net.minecraft.tags.TagNetworkSerialization.NetworkPayload> tags, CraftTweakerTagRegistry.BindContext context) Binds the given map to the registry.Note: This will clear all registered managers.
- Parameters:
tags- The map to bind.context- The bind context.
-
bind
Binds the given results to the registry.Note: This will clear all registered managers.
- Parameters:
results- The results to bind.
-
bind
public void bind(List<net.minecraft.tags.TagManager.LoadResult<?>> results, CraftTweakerTagRegistry.BindContext context) Binds the given results to the registry.Note: This will clear all registered managers.
- Parameters:
results- The results to bind.context- The bind context.
-
makeTagFolder
-