Class DatapackRegistryProvider.RegistryBuilder<T>
java.lang.Object
com.github.minecraftschurlimods.arsmagicalegacy.api.data.DatapackRegistryProvider.RegistryBuilder<T>
- Enclosing class:
- DatapackRegistryProvider
-
Constructor Summary
ConstructorsConstructorDescriptionRegistryBuilder(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> registryKey, String modId) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidgather()protected final <S> @NotNull net.minecraft.core.HolderGetter<S>getLookup(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<S>> registryKey) Get theHolderGetterfor the registry of the givenResourceKey.protected final <S> net.minecraft.core.Holder.Reference<S>holder(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<S>> registryKey, String name) protected final <S> net.minecraft.core.Holder.Reference<S>holder(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<S>> registryKey, net.minecraft.resources.ResourceLocation key) protected final <S> net.minecraft.core.Holder.Reference<S>holder(net.minecraft.resources.ResourceKey<S> key) Get theHolderfor the givenResourceKey.protected final <S> Optional<net.minecraft.core.Holder.Reference<S>>optionalHolder(net.minecraft.resources.ResourceKey<S> key) protected final <S> Optional<net.minecraft.core.HolderSet.Named<S>>optionalTag(net.minecraft.tags.TagKey<S> tagKey) protected final net.minecraft.core.Holder.Reference<T>Get theHolderfor the given name from this builders current registry and modId.protected final net.minecraft.core.Holder.Reference<T>ownHolder(net.minecraft.resources.ResourceLocation id) Get theHolderfor the givenResourceLocationfrom this builders current registry.protected final voidRegisters a value to the datapack registry.protected final voidRegisters a value to the datapack registry.protected final voidRegisters a value to the datapack registry.protected final <S> net.minecraft.core.HolderSet.Named<S>tag(net.minecraft.tags.TagKey<S> tagKey) Get theHolderSetfor the givenTagKey.
-
Constructor Details
-
RegistryBuilder
-
-
Method Details
-
gather
protected abstract void gather() -
tag
protected final <S> net.minecraft.core.HolderSet.Named<S> tag(net.minecraft.tags.TagKey<S> tagKey) Get theHolderSetfor the givenTagKey.- Type Parameters:
S- The type of theHolderSet.- Parameters:
tagKey- TheTagKeyto get theHolderSetfor.- Returns:
- The
HolderSetfor the givenTagKey.
-
optionalTag
protected final <S> Optional<net.minecraft.core.HolderSet.Named<S>> optionalTag(net.minecraft.tags.TagKey<S> tagKey) - Type Parameters:
S- The type of theHolderSet.- Parameters:
tagKey- TheTagKeyto get theHolderSetfor.- Returns:
- The
HolderSetfor the givenTagKey.
-
holder
protected final <S> net.minecraft.core.Holder.Reference<S> holder(net.minecraft.resources.ResourceKey<S> key) Get theHolderfor the givenResourceKey.- Type Parameters:
S- The type of theHolder.- Parameters:
key- TheResourceKeyto get theHolderfor.- Returns:
- The
Holderfor the givenResourceKey.
-
holder
protected final <S> net.minecraft.core.Holder.Reference<S> holder(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<S>> registryKey, net.minecraft.resources.ResourceLocation key) -
holder
protected final <S> net.minecraft.core.Holder.Reference<S> holder(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<S>> registryKey, String name) -
optionalHolder
protected final <S> Optional<net.minecraft.core.Holder.Reference<S>> optionalHolder(net.minecraft.resources.ResourceKey<S> key) - Type Parameters:
S- The type of theHolder.- Parameters:
key- TheResourceKeyto get theHolderfor.- Returns:
- The
Holderfor the givenResourceKey.
-
ownHolder
protected final net.minecraft.core.Holder.Reference<T> ownHolder(net.minecraft.resources.ResourceLocation id) Get theHolderfor the givenResourceLocationfrom this builders current registry.- Parameters:
id- TheResourceLocationto get theHolderfor.- Returns:
- The
Holderfor the givenResourceLocation.
-
ownHolder
Get theHolderfor the given name from this builders current registry and modId.- Parameters:
name- The name to get theHolderfor.- Returns:
- The
Holderfor the givenResourceLocation.
-
getLookup
@NotNull protected final <S> @NotNull net.minecraft.core.HolderGetter<S> getLookup(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<S>> registryKey) Get theHolderGetterfor the registry of the givenResourceKey.- Type Parameters:
S- The type of the registry.- Parameters:
registryKey- TheResourceKeyof the registry to get theHolderGetterfor.- Returns:
- The
HolderGetterfor the registry of the givenResourceKey.
-
register
Registers a value to the datapack registry.- Parameters:
name- The name of the value.value- The value.
-
register
Registers a value to the datapack registry.- Parameters:
id- The id of the value.value- The value.
-
register
Registers a value to the datapack registry.- Parameters:
id- The id of the value.value- The value.
-