Class MappedRegistryMixin<T>
java.lang.Object
net.fabricmc.fabric.mixin.registry.sync.MappedRegistryMixin<T>
- All Implemented Interfaces:
com.mojang.serialization.Keyable, Iterable<T>, FabricRegistry, ListenableRegistry<T>, RemappableRegistry, net.minecraft.core.HolderGetter<T>, net.minecraft.core.HolderLookup<T>, net.minecraft.core.HolderLookup.RegistryLookup<T>, net.minecraft.core.HolderOwner<T>, net.minecraft.core.IdMap<T>, net.minecraft.core.Registry<T>, net.minecraft.core.WritableRegistry<T>, net.neoforged.neoforge.registries.IRegistryExtension<T>
public abstract class MappedRegistryMixin<T>
extends Object
implements net.minecraft.core.WritableRegistry<T>, RemappableRegistry, ListenableRegistry<T>, FabricRegistry
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.core.HolderLookup
net.minecraft.core.HolderLookup.Provider, net.minecraft.core.HolderLookup.RegistryLookup<T>Nested classes/interfaces inherited from interface net.minecraft.core.HolderLookup.RegistryLookup
net.minecraft.core.HolderLookup.RegistryLookup.Delegate<T>Nested classes/interfaces inherited from interface net.minecraft.core.Registry
net.minecraft.core.Registry.PendingTags<T>Nested classes/interfaces inherited from interface RemappableRegistry
RemappableRegistry.RemapMode -
Field Summary
Fields inherited from interface net.minecraft.core.IdMap
DEFAULT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAlias(net.minecraft.resources.Identifier old, net.minecraft.resources.Identifier newId) Adds an alias for an entry in this registry.abstract booleancontainsKey(net.minecraft.resources.Identifier id) getResourceKey(T entry) abstract @Nullable TgetValue(@Nullable net.minecraft.resources.Identifier id) abstract net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> key()voidremap(it.unimi.dsi.fastutil.objects.Object2IntMap<net.minecraft.resources.Identifier> remoteIndexedEntries, RemappableRegistry.RemapMode mode) abstract StringtoString()voidunmap()protected abstract voidMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.core.HolderGetter
get, get, getOrThrow, getOrThrow, getRandomElementOfMethods inherited from interface net.minecraft.core.HolderLookup
listElementIds, listElements, listTagIds, listTagsMethods inherited from interface net.minecraft.core.HolderLookup.RegistryLookup
filterElements, filterFeatures, getData, registryLifecycleMethods inherited from interface net.minecraft.core.HolderOwner
canSerializeInMethods inherited from interface net.minecraft.core.IdMap
byId, byIdOrThrow, getIdOrThrow, sizeMethods inherited from interface net.neoforged.neoforge.registries.IRegistryExtension
addCallback, addCallback, containsValue, doesSync, getDataMap, getId, getId, getKeyOrNull, getMaxId, resolve, resolveMethods inherited from interface Iterable
forEach, iterator, spliteratorMethods inherited from interface net.minecraft.core.Registry
asHolderIdMap, byNameCodec, componentLookup, containsKey, createIntrusiveHolder, entrySet, freeze, get, get, getAny, getId, getKey, getOptional, getOptional, getRandom, getTagOrEmpty, getTags, getValue, getValueOrThrow, holderByNameCodec, keys, keySet, prepareTagReload, registrationInfo, registryKeySet, stream, wrapAsHolderMethods inherited from interface net.minecraft.core.WritableRegistry
bindTags, createRegistrationLookup, isEmpty, register
-
Constructor Details
-
MappedRegistryMixin
public MappedRegistryMixin()
-
-
Method Details
-
getResourceKey
-
getValue
-
key
-
containsKey
public abstract boolean containsKey(net.minecraft.resources.Identifier id) - Specified by:
containsKeyin interfacenet.minecraft.core.Registry<T>
-
toString
-
validateWrite
protected abstract void validateWrite() -
fabric_getAddObjectEvent
- Specified by:
fabric_getAddObjectEventin interfaceListenableRegistry<T>
-
fabric_getRemapEvent
- Specified by:
fabric_getRemapEventin interfaceListenableRegistry<T>
-
remap
public void remap(it.unimi.dsi.fastutil.objects.Object2IntMap<net.minecraft.resources.Identifier> remoteIndexedEntries, RemappableRegistry.RemapMode mode) throws RemapException - Specified by:
remapin interfaceRemappableRegistry- Throws:
RemapException
-
unmap
- Specified by:
unmapin interfaceRemappableRegistry- Throws:
RemapException
-
addAlias
public void addAlias(net.minecraft.resources.Identifier old, net.minecraft.resources.Identifier newId) Description copied from interface:FabricRegistryAdds an alias for an entry in this registry. Once added, all queries to this registry that refer to theoldIdentifierwill be redirected towardsnewId. This is useful if a mod wants to change an ID without breaking compatibility with existing worlds.- Specified by:
addAliasin interfaceFabricRegistry- Specified by:
addAliasin interfacenet.neoforged.neoforge.registries.IRegistryExtension<T>- Parameters:
old- theIdentifierthat will become an alias fornewIdnewId- theIdentifierfor whicholdwill become an alias
-