Record Class LootTableHelper
java.lang.Object
java.lang.Record
net.darkhax.simplelootviewer.common.impl.data.LootTableHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncollectData(net.minecraft.core.RegistryAccess registries) Collects all data on loot tables and stores it in a usable format for our plugin.final booleanIndicates whether some other object is "equal to" this one.getCachedData(net.minecraft.core.RegistryAccess registries) Gets a cached version of the loot table data.final inthashCode()Returns a hash code value for this object.static NamenameTable(net.minecraft.resources.ResourceLocation tableKey, com.google.common.collect.ArrayListMultimap<net.minecraft.resources.ResourceLocation, net.minecraft.resources.ResourceLocation> blockTables, com.google.common.collect.ArrayListMultimap<net.minecraft.resources.ResourceLocation, net.minecraft.resources.ResourceLocation> entityTables) Creates a custom name for a loot table.static net.minecraft.network.chat.ComponentnameTableFromId(net.minecraft.resources.ResourceLocation tableKey) Creates a translatable name based on the ID of the loot table.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LootTableHelper
public LootTableHelper()Creates an instance of aLootTableHelperrecord class.
-
-
Method Details
-
getCachedData
public static com.google.common.collect.ArrayListMultimap<LootType,TableInfo> getCachedData(net.minecraft.core.RegistryAccess registries) Gets a cached version of the loot table data. The cache will be rebuilt if it is outdated.- Parameters:
registries- The current reloadable game registries. The loot table registry must be available.- Returns:
- A multimap of info sorted by type of loot table.
-
collectData
public static com.google.common.collect.ArrayListMultimap<LootType,TableInfo> collectData(net.minecraft.core.RegistryAccess registries) Collects all data on loot tables and stores it in a usable format for our plugin.- Parameters:
registries- The current reloadable game registries. The loot table registry must be available.- Returns:
- A multimap of table info sorted by type of loot table.
-
nameTable
public static Name nameTable(net.minecraft.resources.ResourceLocation tableKey, com.google.common.collect.ArrayListMultimap<net.minecraft.resources.ResourceLocation, net.minecraft.resources.ResourceLocation> blockTables, com.google.common.collect.ArrayListMultimap<net.minecraft.resources.ResourceLocation, net.minecraft.resources.ResourceLocation> entityTables) Creates a custom name for a loot table.- Parameters:
tableKey- The ID of the loot table.blockTables- A map of blocks that produce each loot table.entityTables- A map of entities that produce each loot table.- Returns:
- A name for the loot table.
-
nameTableFromId
public static net.minecraft.network.chat.Component nameTableFromId(net.minecraft.resources.ResourceLocation tableKey) Creates a translatable name based on the ID of the loot table. If the name is not translatable we will fall back to the ID of the table.- Parameters:
tableKey- The ID of the loot table.- Returns:
- The name of the table.
-
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.
-