Record Class LootProviderContext

java.lang.Object
java.lang.Record
net.rebel459.unified.impl.util.LootProviderContext
All Implemented Interfaces:
net.minecraft.data.loot.LootTableSubProvider.Context, net.minecraft.data.worldgen.BootstrapContextAccess, net.neoforged.neoforge.common.extensions.BootstrapContextAccessExtension, net.neoforged.neoforge.common.extensions.LootTableSubProviderContextExtension

public record LootProviderContext(net.minecraft.core.HolderLookup.Provider registries) extends Record implements net.minecraft.data.loot.LootTableSubProvider.Context
  • Constructor Summary

    Constructors
    Constructor
    Description
    LootProviderContext(net.minecraft.core.HolderLookup.Provider registries)
    Creates an instance of a LootProviderContext record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.core.Holder.Reference<net.minecraft.world.level.storage.loot.LootTable>
    accept(net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable> key, net.minecraft.world.level.storage.loot.LootTable.Builder value)
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    <S> Stream<net.minecraft.core.Holder.Reference<S>>
    listContextElements(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<? extends S>> key)
     
    <S> net.minecraft.core.HolderGetter<S>
    lookup(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<? extends S>> key)
     
    net.minecraft.core.HolderLookup.Provider
    Returns the value of the registries record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

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

    Methods inherited from interface net.neoforged.neoforge.common.extensions.BootstrapContextAccessExtension

    holderLookup

    Methods inherited from interface net.neoforged.neoforge.common.extensions.LootTableSubProviderContextExtension

    withConditions
  • Constructor Details

    • LootProviderContext

      public LootProviderContext(net.minecraft.core.HolderLookup.Provider registries)
      Creates an instance of a LootProviderContext record class.
      Parameters:
      registries - the value for the registries record component
  • Method Details

    • accept

      public net.minecraft.core.Holder.Reference<net.minecraft.world.level.storage.loot.LootTable> accept(net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable> key, net.minecraft.world.level.storage.loot.LootTable.Builder value)
      Specified by:
      accept in interface net.minecraft.data.loot.LootTableSubProvider.Context
    • lookup

      public <S> net.minecraft.core.HolderGetter<S> lookup(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<? extends S>> key)
      Specified by:
      lookup in interface net.minecraft.data.worldgen.BootstrapContextAccess
    • listContextElements

      public <S> Stream<net.minecraft.core.Holder.Reference<S>> listContextElements(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<? extends S>> key)
      Specified by:
      listContextElements in interface net.minecraft.data.worldgen.BootstrapContextAccess
    • 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.
    • registries

      public net.minecraft.core.HolderLookup.Provider registries()
      Returns the value of the registries record component.
      Returns:
      the value of the registries record component