Record Class PoolTarget
java.lang.Object
java.lang.Record
net.darkhax.bookshelf.common.api.data.loot.PoolTarget
- Record Components:
table- The id of the loot table to target.index- The index of the pool within the loot table. This is usually based on the order pools appear in the JSON data.hash- A hash of the pools JSON data. This can be obtained using the bookshelf debug command in a development environment.
public record PoolTarget(net.minecraft.resources.ResourceLocation table, int index, int hash)
extends Record
Represents a specific loot pool target within a loot table. This class also provides predefined constants for some of
the commonly modified loot pools.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PoolTargetstatic final PoolTargetstatic final PoolTargetstatic final PoolTargetstatic final PoolTargetstatic final PoolTargetstatic final PoolTargetstatic final PoolTargetstatic final PoolTargetstatic final PoolTargetstatic final PoolTargetstatic final PoolTargetstatic final PoolTargetstatic final PoolTargetstatic final PoolTargetstatic final PoolTargetstatic final PoolTargetstatic final PoolTargetstatic final PoolTarget -
Constructor Summary
ConstructorsConstructorDescriptionPoolTarget(net.minecraft.resources.ResourceLocation table, int index, int hash) Creates an instance of aPoolTargetrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.inthash()Returns the value of thehashrecord component.final inthashCode()Returns a hash code value for this object.intindex()Returns the value of theindexrecord component.static PoolTargetof(net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable> table, int index, int hash) net.minecraft.resources.ResourceLocationtable()Returns the value of thetablerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
MINESHAFT_RARE
-
MINESHAFT_UNCOMMON
-
MINESHAFT_COMMON
-
SIMPLE_DUNGEON_RARE
-
SIMPLE_DUNGEON_UNCOMMON
-
SIMPLE_DUNGEON_COMMON
-
CAT_GIFT
-
FISHING
-
FISHING_FISH
-
FISHING_JUNK
-
FISHING_TREASURE
-
PIGLIN_BARTERING
-
SNIFFER_DIGGING
-
ARCHAEOLOGY_PYRAMID
-
ARCHAEOLOGY_DESERT_WELL
-
ARCHAEOLOGY_OCEAN_RUIN_COLD
-
ARCHAEOLOGY_OCEAN_RUIN_WARM
-
ARCHAEOLOGY_TRAIL_RUINS_COMMON
-
ARCHAEOLOGY_TRAIL_RUINS_RARE
-
-
Constructor Details
-
PoolTarget
public PoolTarget(net.minecraft.resources.ResourceLocation table, int index, int hash) Creates an instance of aPoolTargetrecord class.
-
-
Method Details
-
of
public static PoolTarget of(net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable> table, int index, int hash) -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
table
public net.minecraft.resources.ResourceLocation table()Returns the value of thetablerecord component.- Returns:
- the value of the
tablerecord component
-
index
public int index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-
hash
public int hash()Returns the value of thehashrecord component.- Returns:
- the value of the
hashrecord component
-