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

    Constructors
    Constructor
    Description
    WrappedReloadListener(net.minecraft.resources.ResourceLocation id, net.minecraft.server.packs.resources.PreparableReloadListener reloadListener)
    Creates an instance of a WrappedReloadListener record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    net.minecraft.resources.ResourceLocation
     
    final int
    Returns a hash code value for this object.
    net.minecraft.resources.ResourceLocation
    id()
    Returns the value of the id record 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.PreparableReloadListener
    Returns the value of the reloadListener record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.fabricmc.fabric.api.resource.IdentifiableResourceReloadListener

    getFabricDependencies

    Methods 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 a WrappedReloadListener record class.
      Parameters:
      id - the value for the id record component
      reloadListener - the value for the reloadListener record component
  • Method Details

    • getFabricId

      public net.minecraft.resources.ResourceLocation getFabricId()
      Specified by:
      getFabricId in interface net.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:
      reload in interface net.minecraft.server.packs.resources.PreparableReloadListener
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public net.minecraft.resources.ResourceLocation id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • reloadListener

      public net.minecraft.server.packs.resources.PreparableReloadListener reloadListener()
      Returns the value of the reloadListener record component.
      Returns:
      the value of the reloadListener record component