Package net.minecraftforge.registries
Class ObjectHolderRegistry
java.lang.Object
net.minecraftforge.registries.ObjectHolderRegistry
Internal registry for tracking 
ObjectHolder references- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprivate static final record
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate static final org.apache.logging.log4j.Loggerprivate static final org.objectweb.asm.Typeprivate static final org.objectweb.asm.Typeprivate static final Set<Consumer<Predicate<ResourceLocation>>>private static final List<ObjectHolderRegistry.VanillaObjectHolderData>
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidExposed to allow modders to register their own notification handlers.static voidstatic voidapplyObjectHolders(Predicate<ResourceLocation> filter) static voidprivate static ResourceLocationgetRegistryName(Map<org.objectweb.asm.Type, ResourceLocation> classRegistryNames, @Nullable String registryName, org.objectweb.asm.Type targetClass, Object declaration) static booleanRemoved the specified handler from the notification list.private static voidscanClassForFields(Map<org.objectweb.asm.Type, String> classModIds, org.objectweb.asm.Type targetClass, ResourceLocation registryName, Class<?> registryClass, String value, Class<?> clazz, boolean extractFromExistingValues) private static voidscanTarget(Map<org.objectweb.asm.Type, String> classModIds, Map<org.objectweb.asm.Type, Class<?>> classCache, org.objectweb.asm.Type type, @Nullable String annotationTarget, @Nullable Class<?> registryClass, String registryName, String value, boolean isClass, boolean extractFromValue) 
- 
Field Details- 
LOGGERprivate static final org.apache.logging.log4j.Logger LOGGER
- 
objectHolders
- 
OBJECT_HOLDERprivate static final org.objectweb.asm.Type OBJECT_HOLDER
- 
MODprivate static final org.objectweb.asm.Type MOD
- 
VANILLA_OBJECT_HOLDERS
 
- 
- 
Constructor Details- 
ObjectHolderRegistrypublic ObjectHolderRegistry()
 
- 
- 
Method Details- 
addHandlerExposed to allow modders to register their own notification handlers. This runnable will be called after a registry snapshot has been injected and finalized. The internal list is backed by a HashSet so it is HIGHLY recommended you implement a proper equals and hashCode function to de-duplicate callers here. The default @ObjectHolder implementation uses the hashCode/equals for the field the annotation is on.
- 
removeHandlerRemoved the specified handler from the notification list. The internal list is backed by a hash set, and so proper hashCode and equals operations are required for success. The default @ObjectHolder implementation uses the hashCode/equals for the field the annotation is on.- Returns:
- true if handler was matched and removed.
 
- 
findObjectHolderspublic static void findObjectHolders()
- 
scanTargetprivate static void scanTarget(Map<org.objectweb.asm.Type, String> classModIds, Map<org.objectweb.asm.Type, Class<?>> classCache, org.objectweb.asm.Type type, @Nullable @Nullable String annotationTarget, @Nullable @Nullable Class<?> registryClass, String registryName, String value, boolean isClass, boolean extractFromValue) 
- 
scanClassForFields
- 
getRegistryNameprivate static ResourceLocation getRegistryName(Map<org.objectweb.asm.Type, ResourceLocation> classRegistryNames, @Nullable @Nullable String registryName, org.objectweb.asm.Type targetClass, Object declaration) 
- 
applyObjectHolderspublic static void applyObjectHolders()
- 
applyObjectHolders
 
-