Record Class WrappedReloadListener
java.lang.Object
java.lang.Record
net.darkhax.bookshelf.impl.resources.WrappedReloadListener
- All Implemented Interfaces:
net.fabricmc.fabric.api.resource.IdentifiableResourceReloadListener,net.minecraft.server.packs.resources.PreparableReloadListener
public record WrappedReloadListener(net.minecraft.resources.ResourceLocation id, net.minecraft.server.packs.resources.PreparableReloadListener reloadListener)
extends Record
implements net.fabricmc.fabric.api.resource.IdentifiableResourceReloadListener
Fabric requires modded reload listeners to implement their IdentifiableResourceReloadListener interface. This
implementation simply wraps a vanilla compliant reload listener to make it compliant with the Fabric API.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
net.minecraft.server.packs.resources.PreparableReloadListener.PreparationBarrier -
Constructor Summary
ConstructorsConstructorDescriptionWrappedReloadListener(net.minecraft.resources.ResourceLocation id, net.minecraft.server.packs.resources.PreparableReloadListener reloadListener) Creates an instance of aWrappedReloadListenerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.net.minecraft.resources.ResourceLocationfinal inthashCode()Returns a hash code value for this object.net.minecraft.resources.ResourceLocationid()Returns the value of theidrecord component.reload(net.minecraft.server.packs.resources.PreparableReloadListener.PreparationBarrier preparationBarrier, net.minecraft.server.packs.resources.ResourceManager resourceManager, net.minecraft.util.profiling.ProfilerFiller profilerFiller, net.minecraft.util.profiling.ProfilerFiller profilerFiller2, Executor executor, Executor executor2) net.minecraft.server.packs.resources.PreparableReloadListenerReturns the value of thereloadListenerrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.fabricmc.fabric.api.resource.IdentifiableResourceReloadListener
getFabricDependenciesMethods inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
getName
-
Constructor Details
-
WrappedReloadListener
public WrappedReloadListener(net.minecraft.resources.ResourceLocation id, net.minecraft.server.packs.resources.PreparableReloadListener reloadListener) Creates an instance of aWrappedReloadListenerrecord class.- Parameters:
id- the value for theidrecord componentreloadListener- the value for thereloadListenerrecord component
-
-
Method Details
-
getFabricId
public net.minecraft.resources.ResourceLocation getFabricId()- Specified by:
getFabricIdin interfacenet.fabricmc.fabric.api.resource.IdentifiableResourceReloadListener
-
reload
public CompletableFuture<Void> reload(net.minecraft.server.packs.resources.PreparableReloadListener.PreparationBarrier preparationBarrier, net.minecraft.server.packs.resources.ResourceManager resourceManager, net.minecraft.util.profiling.ProfilerFiller profilerFiller, net.minecraft.util.profiling.ProfilerFiller profilerFiller2, Executor executor, Executor executor2) - Specified by:
reloadin interfacenet.minecraft.server.packs.resources.PreparableReloadListener
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
id
public net.minecraft.resources.ResourceLocation id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
reloadListener
public net.minecraft.server.packs.resources.PreparableReloadListener reloadListener()Returns the value of thereloadListenerrecord component.- Returns:
- the value of the
reloadListenerrecord component
-