Class LootTable<T>
java.lang.Object
org.spongepowered.api.util.weighted.LootTable<T>
- Type Parameters:
T
- The entry type
Represents a pool of tables which are rolled sequentially when retrieving
entries.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds all tables from the givenLootTable
to this LootTable's pool.void
addTable
(RandomObjectTable<T> table) Adds a table to the pool.void
Clears all tables from the pool.boolean
Gets a List of objects as retrieved from all pools.int
hashCode()
boolean
removeTable
(RandomObjectTable<T> table) Removes a table from the pool.tables()
Gets all tables in the pool.toString()
-
Constructor Details
-
LootTable
public LootTable()Creates a newLootTable
.
-
-
Method Details
-
addTable
Adds a table to the pool.- Parameters:
table
- The new table
-
addAll
Adds all tables from the givenLootTable
to this LootTable's pool.- Parameters:
other
- The other loot table
-
removeTable
Removes a table from the pool.- Parameters:
table
- The table to remove- Returns:
- If the pool contained the table
-
tables
Gets all tables in the pool.- Returns:
- The tables
-
clearPool
public void clearPool()Clears all tables from the pool. -
get
Gets a List of objects as retrieved from all pools.- Parameters:
rand
- The random object to use- Returns:
- The retrieved entries
-
equals
-
hashCode
public int hashCode() -
toString
-