Record Class DummyRegistry<T>
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.dummy.DummyRegistry<T>
- All Implemented Interfaces:
com.mojang.serialization.Keyable
,Iterable<T>
,net.minecraft.core.HolderOwner<T>
,net.minecraft.core.IdMap<T>
,net.minecraft.core.Registry<T>
-
Field Summary
Fields inherited from interface net.minecraft.core.IdMap
DEFAULT
-
Constructor Summary
ConstructorDescriptionDummyRegistry
(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> registryKey, net.minecraft.resources.ResourceLocation defaultId, T defaultValue) Creates an instance of aDummyRegistry
record class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.core.HolderLookup.RegistryLookup<T>
asLookup()
void
byId
(int p_122651_) boolean
containsKey
(net.minecraft.resources.ResourceKey<T> p_175475_) boolean
containsKey
(net.minecraft.resources.ResourceLocation p_123011_) net.minecraft.core.Holder.Reference<T>
createIntrusiveHolder
(T p_206068_) net.minecraft.resources.ResourceLocation
Returns the value of thedefaultId
record component.Returns the value of thedefaultValue
record component.entrySet()
final boolean
Indicates whether some other object is "equal to" this one.net.minecraft.core.Registry<T>
freeze()
get
(@Nullable net.minecraft.resources.ResourceLocation p_123002_) getHolder
(int p_206051_) int
@Nullable net.minecraft.resources.ResourceLocation
net.minecraft.core.HolderSet.Named<T>
getOrCreateTag
(net.minecraft.tags.TagKey<T> p_206045_) getRandom
(net.minecraft.util.RandomSource p_235781_) getResourceKey
(T p_123008_) Stream<com.mojang.datafixers.util.Pair<net.minecraft.tags.TagKey<T>,
net.minecraft.core.HolderSet.Named<T>>> getTags()
final int
hashCode()
Returns a hash code value for this object.net.minecraft.core.HolderOwner<T>
holders()
iterator()
net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>>
key()
Set<net.minecraft.resources.ResourceLocation>
keySet()
com.mojang.serialization.Lifecycle
net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>>
Returns the value of theregistryKey
record component.com.mojang.serialization.Lifecycle
void
int
size()
final String
toString()
Returns a string representation of this record class.net.minecraft.core.Holder<T>
wrapAsHolder
(T p_263382_) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.core.HolderOwner
canSerializeIn
Methods inherited from interface net.minecraft.core.IdMap
byIdOrThrow
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface net.minecraft.core.Registry
asHolderIdMap, asTagAddingLookup, byNameCodec, getHolderOrThrow, getOptional, getOptional, getOrThrow, getTagOrEmpty, holderByNameCodec, keys, stream
-
Constructor Details
-
DummyRegistry
public DummyRegistry(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> registryKey, net.minecraft.resources.ResourceLocation defaultId, T defaultValue) Creates an instance of aDummyRegistry
record class.- Parameters:
registryKey
- the value for theregistryKey
record componentdefaultId
- the value for thedefaultId
record componentdefaultValue
- the value for thedefaultValue
record component
-
-
Method Details
-
key
- Specified by:
key
in interfacenet.minecraft.core.Registry<T>
-
getKey
- Specified by:
getKey
in interfacenet.minecraft.core.Registry<T>
-
getResourceKey
- Specified by:
getResourceKey
in interfacenet.minecraft.core.Registry<T>
-
getId
-
byId
- Specified by:
byId
in interfacenet.minecraft.core.IdMap<T>
-
size
public int size()- Specified by:
size
in interfacenet.minecraft.core.IdMap<T>
-
get
- Specified by:
get
in interfacenet.minecraft.core.Registry<T>
-
get
- Specified by:
get
in interfacenet.minecraft.core.Registry<T>
-
lifecycle
- Specified by:
lifecycle
in interfacenet.minecraft.core.Registry<T>
-
registryLifecycle
public com.mojang.serialization.Lifecycle registryLifecycle()- Specified by:
registryLifecycle
in interfacenet.minecraft.core.Registry<T>
-
keySet
- Specified by:
keySet
in interfacenet.minecraft.core.Registry<T>
-
entrySet
- Specified by:
entrySet
in interfacenet.minecraft.core.Registry<T>
-
registryKeySet
- Specified by:
registryKeySet
in interfacenet.minecraft.core.Registry<T>
-
getRandom
public Optional<net.minecraft.core.Holder.Reference<T>> getRandom(net.minecraft.util.RandomSource p_235781_) - Specified by:
getRandom
in interfacenet.minecraft.core.Registry<T>
-
containsKey
public boolean containsKey(net.minecraft.resources.ResourceLocation p_123011_) - Specified by:
containsKey
in interfacenet.minecraft.core.Registry<T>
-
containsKey
- Specified by:
containsKey
in interfacenet.minecraft.core.Registry<T>
-
freeze
- Specified by:
freeze
in interfacenet.minecraft.core.Registry<T>
-
createIntrusiveHolder
- Specified by:
createIntrusiveHolder
in interfacenet.minecraft.core.Registry<T>
-
getHolder
- Specified by:
getHolder
in interfacenet.minecraft.core.Registry<T>
-
getHolder
public Optional<net.minecraft.core.Holder.Reference<T>> getHolder(net.minecraft.resources.ResourceKey<T> p_206050_) - Specified by:
getHolder
in interfacenet.minecraft.core.Registry<T>
-
wrapAsHolder
- Specified by:
wrapAsHolder
in interfacenet.minecraft.core.Registry<T>
-
holders
- Specified by:
holders
in interfacenet.minecraft.core.Registry<T>
-
getTag
public Optional<net.minecraft.core.HolderSet.Named<T>> getTag(net.minecraft.tags.TagKey<T> p_206052_) - Specified by:
getTag
in interfacenet.minecraft.core.Registry<T>
-
getOrCreateTag
- Specified by:
getOrCreateTag
in interfacenet.minecraft.core.Registry<T>
-
getTags
public Stream<com.mojang.datafixers.util.Pair<net.minecraft.tags.TagKey<T>,net.minecraft.core.HolderSet.Named<T>>> getTags()- Specified by:
getTags
in interfacenet.minecraft.core.Registry<T>
-
getTagNames
- Specified by:
getTagNames
in interfacenet.minecraft.core.Registry<T>
-
resetTags
public void resetTags()- Specified by:
resetTags
in interfacenet.minecraft.core.Registry<T>
-
bindTags
public void bindTags(Map<net.minecraft.tags.TagKey<T>, List<net.minecraft.core.Holder<T>>> p_205997_) - Specified by:
bindTags
in interfacenet.minecraft.core.Registry<T>
-
holderOwner
- Specified by:
holderOwner
in interfacenet.minecraft.core.Registry<T>
-
asLookup
- Specified by:
asLookup
in interfacenet.minecraft.core.Registry<T>
-
iterator
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
registryKey
Returns the value of theregistryKey
record component.- Returns:
- the value of the
registryKey
record component
-
defaultId
public net.minecraft.resources.ResourceLocation defaultId()Returns the value of thedefaultId
record component.- Returns:
- the value of the
defaultId
record component
-
defaultValue
Returns the value of thedefaultValue
record component.- Returns:
- the value of the
defaultValue
record component
-