Package net.minecraft.loot
Class LootTable
- java.lang.Object
-
- net.minecraft.loot.LootTable
-
public class LootTable extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LootTable.Builder
static class
LootTable.Serializer
-
Field Summary
Fields Modifier and Type Field Description private java.util.function.BiFunction<ItemStack,LootContext,ItemStack>
compositeFunction
static LootParameterSet
DEFAULT_PARAM_SET
static LootTable
EMPTY
private ILootFunction[]
functions
private boolean
isFrozen
private static org.apache.logging.log4j.Logger
LOGGER
private ResourceLocation
lootTableId
private LootParameterSet
paramSet
private java.util.List<LootPool>
pools
-
Constructor Summary
Constructors Modifier Constructor Description private
LootTable(LootParameterSet p_i51265_1_, LootPool[] p_i51265_2_, ILootFunction[] p_i51265_3_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addPool(LootPool pool)
private void
checkFrozen()
static java.util.function.Consumer<ItemStack>
createStackSplitter(java.util.function.Consumer<ItemStack> p_216124_0_)
void
fill(IInventory p_216118_1_, LootContext p_216118_2_)
void
freeze()
private java.util.List<java.lang.Integer>
getAvailableSlots(IInventory p_186459_1_, java.util.Random p_186459_2_)
ResourceLocation
getLootTableId()
LootParameterSet
getParamSet()
LootPool
getPool(java.lang.String name)
java.util.List<ItemStack>
getRandomItems(LootContext p_216113_1_)
void
getRandomItems(LootContext p_216120_1_, java.util.function.Consumer<ItemStack> p_216120_2_)
Deprecated.void
getRandomItemsRaw(LootContext p_216114_1_, java.util.function.Consumer<ItemStack> p_216114_2_)
boolean
isFrozen()
static LootTable.Builder
lootTable()
LootPool
removePool(java.lang.String name)
void
setLootTableId(ResourceLocation id)
private void
shuffleAndSplitItems(java.util.List<ItemStack> p_186463_1_, int p_186463_2_, java.util.Random p_186463_3_)
void
validate(ValidationTracker p_227506_1_)
-
-
-
Field Detail
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER
-
EMPTY
public static final LootTable EMPTY
-
DEFAULT_PARAM_SET
public static final LootParameterSet DEFAULT_PARAM_SET
-
paramSet
private final LootParameterSet paramSet
-
pools
private final java.util.List<LootPool> pools
-
functions
private final ILootFunction[] functions
-
compositeFunction
private final java.util.function.BiFunction<ItemStack,LootContext,ItemStack> compositeFunction
-
isFrozen
private boolean isFrozen
-
lootTableId
private ResourceLocation lootTableId
-
-
Constructor Detail
-
LootTable
private LootTable(LootParameterSet p_i51265_1_, LootPool[] p_i51265_2_, ILootFunction[] p_i51265_3_)
-
-
Method Detail
-
createStackSplitter
public static java.util.function.Consumer<ItemStack> createStackSplitter(java.util.function.Consumer<ItemStack> p_216124_0_)
-
getRandomItemsRaw
public void getRandomItemsRaw(LootContext p_216114_1_, java.util.function.Consumer<ItemStack> p_216114_2_)
-
getRandomItems
@Deprecated public void getRandomItems(LootContext p_216120_1_, java.util.function.Consumer<ItemStack> p_216120_2_)
Deprecated.
-
getRandomItems
public java.util.List<ItemStack> getRandomItems(LootContext p_216113_1_)
-
getParamSet
public LootParameterSet getParamSet()
-
validate
public void validate(ValidationTracker p_227506_1_)
-
fill
public void fill(IInventory p_216118_1_, LootContext p_216118_2_)
-
shuffleAndSplitItems
private void shuffleAndSplitItems(java.util.List<ItemStack> p_186463_1_, int p_186463_2_, java.util.Random p_186463_3_)
-
getAvailableSlots
private java.util.List<java.lang.Integer> getAvailableSlots(IInventory p_186459_1_, java.util.Random p_186459_2_)
-
lootTable
public static LootTable.Builder lootTable()
-
freeze
public void freeze()
-
isFrozen
public boolean isFrozen()
-
checkFrozen
private void checkFrozen()
-
setLootTableId
public void setLootTableId(ResourceLocation id)
-
getLootTableId
public ResourceLocation getLootTableId()
-
getPool
public LootPool getPool(java.lang.String name)
-
removePool
public LootPool removePool(java.lang.String name)
-
addPool
public void addPool(LootPool pool)
-
-