public final class ModernBetaRegistry<T>
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
protected |
ModernBetaRegistry(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(net.minecraft.util.ResourceLocation registryKey)
Checks if an entry tied to a registry key exists in the registry.
|
boolean |
contains(T value)
Checks if an entry exists in the registry.
|
T |
get(net.minecraft.util.ResourceLocation registryKey)
Gets the entry related to the given registry key.
|
java.util.List<java.util.Map.Entry<net.minecraft.util.ResourceLocation,T>> |
getEntries()
Gets a list of all registry entries, including keys and values, in the registry.
|
java.util.Set<java.util.Map.Entry<net.minecraft.util.ResourceLocation,T>> |
getEntrySet()
Gets a set of all registry entries.
|
java.util.List<net.minecraft.util.ResourceLocation> |
getKeys()
Gets a list if all registry keys in the registry.
|
T |
getOrElse(net.minecraft.util.ResourceLocation registryKey,
net.minecraft.util.ResourceLocation alternateKey)
Gets the entry related to the given registry key or an alternate entry based on the alternate registry key.
|
T |
getOrElse(net.minecraft.util.ResourceLocation registryKey,
T alternateValue)
Gets the entry related to the given registry key or an alternate entry.
|
java.util.Map.Entry<net.minecraft.util.ResourceLocation,T> |
getRandomEntry(java.util.Random random)
Gets a random registry entry from the registry.
|
java.util.List<T> |
getValues()
Gets a list of all entries in the registry.
|
void |
register(net.minecraft.util.ResourceLocation registryKey,
T entry)
Registers a new entry to the Modern Beta registry with the default priority.
|
void |
register(net.minecraft.util.ResourceLocation registryKey,
T entry,
int priority)
Registers a new entry to the Modern Beta registry with a given priority.
|
int |
setPriority(net.minecraft.util.ResourceLocation registryKey,
int priority)
Sets the priority of an entry in the registry and returns the previous priority.
|
net.minecraft.util.ResourceLocation |
validateOrElse(net.minecraft.util.ResourceLocation registryKey,
net.minecraft.util.ResourceLocation alternateKey)
Checks if the provided registry key exists in the registry.
|
public void register(net.minecraft.util.ResourceLocation registryKey,
T entry)
IllegalArgumentException if an entry with the same registry key already exists.registryKey - ResourceLocation denoting the entry's unique identifierentry - The entrypublic void register(net.minecraft.util.ResourceLocation registryKey,
T entry,
int priority)
IllegalArgumentException if an entry with the same registry key already exists.registryKey - ResourceLocation denoting the entry's unique identifierentry - The entrypriority - The entry's priority/ordering (minimum: 1). Lower priorities will place the entry earlier when the registry is utilized.public T get(net.minecraft.util.ResourceLocation registryKey)
NoSuchElementException if no entry is found.registryKey - ResourceLocation denoting the entry's unique identifierpublic T getOrElse(net.minecraft.util.ResourceLocation registryKey, net.minecraft.util.ResourceLocation alternateKey)
NoSuchElementException if neither the primary nor the alternate entry is found.registryKey - ResourceLocation denoting the entry's unique identifieralternateKey - ResourceLocation denoting the alternate entry's unique identifierpublic T getOrElse(net.minecraft.util.ResourceLocation registryKey, T alternateValue)
registryKey - ResourceLocation denoting the entry's unique identifieralternateValue - The alternate entrypublic net.minecraft.util.ResourceLocation validateOrElse(net.minecraft.util.ResourceLocation registryKey,
net.minecraft.util.ResourceLocation alternateKey)
registryKey - The registry key to use to check for an entry's existencealternateKey - The alternate registry key to return if the primary key's entry doesn't existpublic boolean contains(net.minecraft.util.ResourceLocation registryKey)
registryKey - The registry key to use to check for an entry's existencepublic boolean contains(T value)
value - The entry to check forpublic java.util.List<T> getValues()
public java.util.List<net.minecraft.util.ResourceLocation> getKeys()
public java.util.List<java.util.Map.Entry<net.minecraft.util.ResourceLocation,T>> getEntries()
public java.util.Set<java.util.Map.Entry<net.minecraft.util.ResourceLocation,T>> getEntrySet()
public java.util.Map.Entry<net.minecraft.util.ResourceLocation,T> getRandomEntry(java.util.Random random)
random - The random objectpublic int setPriority(net.minecraft.util.ResourceLocation registryKey,
int priority)
NoSuchElementException if no entry is found.registryKey - The registry key of the entry to modifypriority - The new integer priority