Record Class RegistryInfoLookupImpl
java.lang.Object
java.lang.Record
top.qwertycxz.loadabledialog.RegistryInfoLookupImpl
- Record Components:
info- the map of registry keys to registry info, which is used for looking up registries when loading dialogs
- All Implemented Interfaces:
net.minecraft.resources.RegistryOps.RegistryInfoLookup
@NullMarked
public record RegistryInfoLookupImpl(Map<? extends net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>>, ? extends net.minecraft.resources.RegistryOps.RegistryInfo<?>> info)
extends Record
implements net.minecraft.resources.RegistryOps.RegistryInfoLookup
Main class of the mod
For the instance of this class, it is just a thin wrapper around a map of registry keys to registry info, which is used for looking up registries when loading dialogs.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Set<net.minecraft.server.level.ServerPlayer> A set of players whose client is not up-to-date with the server, so we should not send them dialogs. -
Constructor Summary
ConstructorsConstructorDescriptionRegistryInfoLookupImpl(Map<? extends net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>>, ? extends net.minecraft.resources.RegistryOps.RegistryInfo<?>> info) Creates an instance of aRegistryInfoLookupImplrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Map<? extends net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>>, ? extends net.minecraft.resources.RegistryOps.RegistryInfo<?>> info()Returns the value of theinforecord component.static net.minecraft.core.RegistryAccess.FrozenloadDialog(net.minecraft.core.RegistryAccess.Frozen layer, net.minecraft.core.HolderLookup.Provider access, net.minecraft.server.packs.resources.ResourceManager manager) Loads dialogs from the resource manager and returns a frozen registry access containing the dialog registry.<U> Optional<net.minecraft.resources.RegistryOps.RegistryInfo<U>> lookup(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<? extends U>> key) Creates a new registry info lookup with the given mapfinal StringtoString()Returns a string representation of this record class.
-
Field Details
-
STALE_PLAYERS
A set of players whose client is not up-to-date with the server, so we should not send them dialogs.
-
-
Constructor Details
-
RegistryInfoLookupImpl
public RegistryInfoLookupImpl(Map<? extends net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>>, ? extends net.minecraft.resources.RegistryOps.RegistryInfo<?>> info) Creates an instance of aRegistryInfoLookupImplrecord class.- Parameters:
info- the value for theinforecord component
-
-
Method Details
-
lookup
public <U> Optional<net.minecraft.resources.RegistryOps.RegistryInfo<U>> lookup(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<? extends U>> key) Creates a new registry info lookup with the given map- Specified by:
lookupin interfacenet.minecraft.resources.RegistryOps.RegistryInfoLookup- Parameters:
key- the map of registry keys to registry info- Returns:
- the registry info lookup
-
loadDialog
public static net.minecraft.core.RegistryAccess.Frozen loadDialog(net.minecraft.core.RegistryAccess.Frozen layer, net.minecraft.core.HolderLookup.Provider access, net.minecraft.server.packs.resources.ResourceManager manager) Loads dialogs from the resource manager and returns a frozen registry access containing the dialog registry.- Parameters:
layer- layern, the frozen registry access layer where the dialog registry will be addedaccess- layers0 ~ n-1, the provider of registry lookups as the base for dialog loadingmanager- the resource manager to load dialog JSONs from- Returns:
- modified layer
n, a frozen registry access containing the dialog registry
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
info
-