public class ClearableRegistry<T> extends MutableRegistry<T>
Modifier and Type | Field and Description |
---|---|
private IntIdentityHashBiMap<T> |
ids |
private boolean |
isDelegated |
private java.util.Set<ResourceLocation> |
keys |
private java.util.Map<ResourceLocation,java.util.Set<T>> |
known |
private static org.apache.logging.log4j.Logger |
LOGGER |
private com.google.common.collect.BiMap<ResourceLocation,T> |
map |
private ResourceLocation |
name |
private int |
nextId |
private static org.apache.logging.log4j.Marker |
REGISTRY |
private java.util.List<T> |
values |
ACTIVITY, BIOME, BIOME_SOURCE_TYPE, BLOCK, BLOCK_ENTITY_TYPE, BLOCK_PLACER_TYPE, BLOCK_STATE_PROVIDER_TYPE, CARVER, CHUNK_GENERATOR_TYPE, CHUNK_STATUS, CUSTOM_STAT, DECORATOR, DIMENSION_TYPE, EFFECTS, ENCHANTMENT, ENTITY_TYPE, FEATURE, FLUID, FOLIAGE_PLACER_TYPE, ITEM, MEMORY_MODULE_TYPE, MENU, MOTIVE, PARTICLE_TYPE, POINT_OF_INTEREST_TYPE, POTION, RECIPE_SERIALIZER, RECIPE_TYPE, RULE_TEST, SCHEDULE, SENSOR_TYPE, SOUND_EVENT, STATS, STRUCTURE_FEATURE, STRUCTURE_PIECE, STRUCTURE_POOL_ELEMENT, STRUCTURE_PROCESSOR, SURFACE_BUILDER, TREE_DECORATOR_TYPE, VILLAGER_PROFESSION, VILLAGER_TYPE
Constructor and Description |
---|
ClearableRegistry(ResourceLocation name) |
ClearableRegistry(ResourceLocation name,
java.lang.Class<T> superType) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(ResourceLocation key) |
T |
getByValue(int id) |
private RegistryDelegate<T> |
getDelegate(T thing) |
int |
getId(T value) |
ResourceLocation |
getKey(T value) |
int |
getNextId() |
T |
getOrDefault(ResourceLocation key) |
T |
getRandom(java.util.Random random) |
java.util.Optional<T> |
getValue(ResourceLocation key) |
boolean |
isEmpty() |
java.util.Iterator<T> |
iterator() |
java.util.Set<ResourceLocation> |
keySet() |
<V extends T> |
register(int id,
ResourceLocation key,
V value) |
<V extends T> |
register(ResourceLocation key,
V value) |
register, register, register, stream
private static final org.apache.logging.log4j.Logger LOGGER
private static final org.apache.logging.log4j.Marker REGISTRY
private final IntIdentityHashBiMap<T> ids
private final com.google.common.collect.BiMap<ResourceLocation,T> map
private final java.util.Set<ResourceLocation> keys
private java.util.List<T> values
private java.util.Map<ResourceLocation,java.util.Set<T>> known
private final ResourceLocation name
private final boolean isDelegated
private int nextId
public ClearableRegistry(ResourceLocation name)
public ClearableRegistry(ResourceLocation name, java.lang.Class<T> superType)
@Nullable public ResourceLocation getKey(T value)
@Nullable public T getByValue(int id)
public java.util.Iterator<T> iterator()
@Nullable public T getOrDefault(ResourceLocation key)
getOrDefault
in class Registry<T>
public <V extends T> V register(int id, ResourceLocation key, V value)
register
in class MutableRegistry<T>
private RegistryDelegate<T> getDelegate(T thing)
public <V extends T> V register(ResourceLocation key, V value)
register
in class MutableRegistry<T>
public java.util.Set<ResourceLocation> keySet()
public boolean isEmpty()
isEmpty
in class MutableRegistry<T>
@Nullable public T getRandom(java.util.Random random)
public boolean containsKey(ResourceLocation key)
containsKey
in class Registry<T>
public void clear()
public int getNextId()
public java.util.Optional<T> getValue(ResourceLocation key)