public class SimpleRegistry<T> extends MutableRegistry<T>
Modifier and Type | Class and Description |
---|---|
static class |
SimpleRegistry.Entry<T> |
Modifier and Type | Field and Description |
---|---|
private it.unimi.dsi.fastutil.objects.ObjectList<T> |
byId |
private com.mojang.serialization.Lifecycle |
elementsLifecycle |
private com.google.common.collect.BiMap<RegistryKey<T>,T> |
keyStorage |
private java.util.Map<T,com.mojang.serialization.Lifecycle> |
lifecycles |
protected static org.apache.logging.log4j.Logger |
LOGGER |
private int |
nextId |
protected java.lang.Object[] |
randomCache |
private com.google.common.collect.BiMap<ResourceLocation,T> |
storage |
private it.unimi.dsi.fastutil.objects.Object2IntMap<T> |
toId |
ACTIVITY, ACTIVITY_REGISTRY, ATTRIBUTE, ATTRIBUTE_REGISTRY, BIOME_REGISTRY, BIOME_SOURCE, BIOME_SOURCE_REGISTRY, BLOCK, BLOCK_ENTITY_TYPE, BLOCK_ENTITY_TYPE_REGISTRY, BLOCK_PLACER_TYPE_REGISTRY, BLOCK_PLACER_TYPES, BLOCK_REGISTRY, BLOCK_STATE_PROVIDER_TYPE_REGISTRY, BLOCKSTATE_PROVIDER_TYPES, CARVER, CARVER_REGISTRY, CHUNK_GENERATOR, CHUNK_GENERATOR_REGISTRY, CHUNK_STATUS, CHUNK_STATUS_REGISTRY, CONFIGURED_CARVER_REGISTRY, CONFIGURED_FEATURE_REGISTRY, CONFIGURED_STRUCTURE_FEATURE_REGISTRY, CONFIGURED_SURFACE_BUILDER_REGISTRY, CUSTOM_STAT, CUSTOM_STAT_REGISTRY, DECORATOR, DECORATOR_REGISTRY, DIMENSION_REGISTRY, DIMENSION_TYPE_REGISTRY, ENCHANTMENT, ENCHANTMENT_REGISTRY, ENTITY_TYPE, ENTITY_TYPE_REGISTRY, FEATURE, FEATURE_REGISTRY, FEATURE_SIZE_TYPE_REGISTRY, FEATURE_SIZE_TYPES, FLUID, FLUID_REGISTRY, FOLIAGE_PLACER_TYPE_REGISTRY, FOLIAGE_PLACER_TYPES, ITEM, ITEM_REGISTRY, LEVEL_STEM_REGISTRY, LOOT_CONDITION_TYPE, LOOT_ENTRY_REGISTRY, LOOT_FUNCTION_REGISTRY, LOOT_FUNCTION_TYPE, LOOT_ITEM_REGISTRY, LOOT_POOL_ENTRY_TYPE, MEMORY_MODULE_TYPE, MEMORY_MODULE_TYPE_REGISTRY, MENU, MENU_REGISTRY, MOB_EFFECT, MOB_EFFECT_REGISTRY, MOTIVE, MOTIVE_REGISTRY, NOISE_GENERATOR_SETTINGS_REGISTRY, PARTICLE_TYPE, PARTICLE_TYPE_REGISTRY, POINT_OF_INTEREST_TYPE, POINT_OF_INTEREST_TYPE_REGISTRY, POS_RULE_TEST, POS_RULE_TEST_REGISTRY, POTION, POTION_REGISTRY, PROCESSOR_LIST_REGISTRY, RECIPE_SERIALIZER, RECIPE_SERIALIZER_REGISTRY, RECIPE_TYPE, RECIPE_TYPE_REGISTRY, REGISTRY, ROOT_REGISTRY_NAME, RULE_TEST, RULE_TEST_REGISTRY, SCHEDULE, SCHEDULE_REGISTRY, SENSOR_TYPE, SENSOR_TYPE_REGISTRY, SOUND_EVENT, SOUND_EVENT_REGISTRY, STAT_TYPE, STAT_TYPE_REGISTRY, STRUCTURE_FEATURE, STRUCTURE_FEATURE_REGISTRY, STRUCTURE_PIECE, STRUCTURE_PIECE_REGISTRY, STRUCTURE_POOL_ELEMENT, STRUCTURE_POOL_ELEMENT_REGISTRY, STRUCTURE_PROCESSOR, STRUCTURE_PROCESSOR_REGISTRY, SURFACE_BUILDER, SURFACE_BUILDER_REGISTRY, TEMPLATE_POOL_REGISTRY, TREE_DECORATOR_TYPE_REGISTRY, TREE_DECORATOR_TYPES, TRUNK_PLACER_TYPE_REGISTRY, TRUNK_PLACER_TYPES, VILLAGER_PROFESSION, VILLAGER_PROFESSION_REGISTRY, VILLAGER_TYPE, VILLAGER_TYPE_REGISTRY, WRITABLE_REGISTRY
Constructor and Description |
---|
SimpleRegistry(RegistryKey<? extends Registry<T>> p_i232509_1_,
com.mojang.serialization.Lifecycle p_i232509_2_) |
Modifier and Type | Method and Description |
---|---|
T |
byId(int p_148745_1_) |
boolean |
containsKey(ResourceLocation p_212607_1_) |
static <T> com.mojang.serialization.Codec<SimpleRegistry<T>> |
dataPackCodec(RegistryKey<? extends Registry<T>> p_241744_0_,
com.mojang.serialization.Lifecycle p_241744_1_,
com.mojang.serialization.Codec<T> p_241744_2_) |
static <T> com.mojang.serialization.Codec<SimpleRegistry<T>> |
directCodec(RegistryKey<? extends Registry<T>> p_241745_0_,
com.mojang.serialization.Lifecycle p_241745_1_,
com.mojang.serialization.Codec<T> p_241745_2_) |
com.mojang.serialization.Lifecycle |
elementsLifecycle() |
java.util.Set<java.util.Map.Entry<RegistryKey<T>,T>> |
entrySet() |
T |
get(RegistryKey<T> p_230516_1_) |
T |
get(ResourceLocation p_82594_1_) |
int |
getId(T p_148757_1_) |
ResourceLocation |
getKey(T p_177774_1_) |
T |
getRandom(java.util.Random p_186801_1_) |
java.util.Optional<RegistryKey<T>> |
getResourceKey(T p_230519_1_) |
java.util.Iterator<T> |
iterator() |
java.util.Set<ResourceLocation> |
keySet() |
com.mojang.serialization.Lifecycle |
lifecycle(T p_241876_1_) |
static <T> com.mojang.serialization.Codec<SimpleRegistry<T>> |
networkCodec(RegistryKey<? extends Registry<T>> p_243539_0_,
com.mojang.serialization.Lifecycle p_243539_1_,
com.mojang.serialization.Codec<T> p_243539_2_) |
<V extends T> |
register(RegistryKey<T> p_218381_1_,
V p_218381_2_,
com.mojang.serialization.Lifecycle p_218381_3_) |
<V extends T> |
registerMapping(int p_218382_1_,
RegistryKey<T> p_218382_2_,
V p_218382_3_,
com.mojang.serialization.Lifecycle p_218382_4_) |
private <V extends T> |
registerMapping(int p_243537_1_,
RegistryKey<T> p_243537_2_,
V p_243537_3_,
com.mojang.serialization.Lifecycle p_243537_4_,
boolean p_243537_5_) |
<V extends T> |
registerOrOverride(java.util.OptionalInt p_241874_1_,
RegistryKey<T> p_241874_2_,
V p_241874_3_,
com.mojang.serialization.Lifecycle p_241874_4_) |
static <T> com.mojang.serialization.MapCodec<SimpleRegistry.Entry<T>> |
withNameAndId(RegistryKey<? extends Registry<T>> p_243541_0_,
com.mojang.serialization.MapCodec<T> p_243541_1_) |
checkRegistry, decode, encode, getOptional, getOptional, getOrThrow, key, keys, register, register, registerMapping, stream, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
checkRange, comapFlatMap, compoundList, deprecated, dispatch, dispatch, dispatchMap, dispatchMap, dispatchStable, doubleRange, either, fieldOf, flatComapMap, flatXmap, floatRange, intRange, list, listOf, mapEither, mapPair, mapResult, of, of, of, of, optionalField, optionalFieldOf, optionalFieldOf, optionalFieldOf, optionalFieldOf, orElse, orElse, orElse, orElseGet, orElseGet, orElseGet, pair, partialDispatch, promotePartial, simpleMap, stable, unboundedMap, unit, unit, withLifecycle, xmap
comap, empty, encodeStart, error, flatComap
protected static final org.apache.logging.log4j.Logger LOGGER
private final it.unimi.dsi.fastutil.objects.ObjectList<T> byId
private final it.unimi.dsi.fastutil.objects.Object2IntMap<T> toId
private final com.google.common.collect.BiMap<ResourceLocation,T> storage
private final com.google.common.collect.BiMap<RegistryKey<T>,T> keyStorage
private final java.util.Map<T,com.mojang.serialization.Lifecycle> lifecycles
private com.mojang.serialization.Lifecycle elementsLifecycle
protected java.lang.Object[] randomCache
private int nextId
public SimpleRegistry(RegistryKey<? extends Registry<T>> p_i232509_1_, com.mojang.serialization.Lifecycle p_i232509_2_)
public static <T> com.mojang.serialization.MapCodec<SimpleRegistry.Entry<T>> withNameAndId(RegistryKey<? extends Registry<T>> p_243541_0_, com.mojang.serialization.MapCodec<T> p_243541_1_)
public <V extends T> V registerMapping(int p_218382_1_, RegistryKey<T> p_218382_2_, V p_218382_3_, com.mojang.serialization.Lifecycle p_218382_4_)
registerMapping
in class MutableRegistry<T>
private <V extends T> V registerMapping(int p_243537_1_, RegistryKey<T> p_243537_2_, V p_243537_3_, com.mojang.serialization.Lifecycle p_243537_4_, boolean p_243537_5_)
public <V extends T> V register(RegistryKey<T> p_218381_1_, V p_218381_2_, com.mojang.serialization.Lifecycle p_218381_3_)
register
in class MutableRegistry<T>
public <V extends T> V registerOrOverride(java.util.OptionalInt p_241874_1_, RegistryKey<T> p_241874_2_, V p_241874_3_, com.mojang.serialization.Lifecycle p_241874_4_)
registerOrOverride
in class MutableRegistry<T>
@Nullable public ResourceLocation getKey(T p_177774_1_)
public java.util.Optional<RegistryKey<T>> getResourceKey(T p_230519_1_)
getResourceKey
in class Registry<T>
public int getId(@Nullable T p_148757_1_)
@Nullable public T get(@Nullable RegistryKey<T> p_230516_1_)
@Nullable public T byId(int p_148745_1_)
public com.mojang.serialization.Lifecycle lifecycle(T p_241876_1_)
public com.mojang.serialization.Lifecycle elementsLifecycle()
elementsLifecycle
in class Registry<T>
public java.util.Iterator<T> iterator()
@Nullable public T get(@Nullable ResourceLocation p_82594_1_)
public java.util.Set<ResourceLocation> keySet()
public java.util.Set<java.util.Map.Entry<RegistryKey<T>,T>> entrySet()
@Nullable public T getRandom(java.util.Random p_186801_1_)
public boolean containsKey(ResourceLocation p_212607_1_)
containsKey
in class Registry<T>
public static <T> com.mojang.serialization.Codec<SimpleRegistry<T>> networkCodec(RegistryKey<? extends Registry<T>> p_243539_0_, com.mojang.serialization.Lifecycle p_243539_1_, com.mojang.serialization.Codec<T> p_243539_2_)
public static <T> com.mojang.serialization.Codec<SimpleRegistry<T>> dataPackCodec(RegistryKey<? extends Registry<T>> p_241744_0_, com.mojang.serialization.Lifecycle p_241744_1_, com.mojang.serialization.Codec<T> p_241744_2_)
public static <T> com.mojang.serialization.Codec<SimpleRegistry<T>> directCodec(RegistryKey<? extends Registry<T>> p_241745_0_, com.mojang.serialization.Lifecycle p_241745_1_, com.mojang.serialization.Codec<T> p_241745_2_)