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 classLootTable.Builderstatic classLootTable.Serializer
-
Field Summary
Fields Modifier and Type Field Description private java.util.function.BiFunction<ItemStack,LootContext,ItemStack>compositeFunctionstatic LootParameterSetDEFAULT_PARAM_SETstatic LootTableEMPTYprivate ILootFunction[]functionsprivate booleanisFrozenprivate static org.apache.logging.log4j.LoggerLOGGERprivate ResourceLocationlootTableIdprivate LootParameterSetparamSetprivate java.util.List<LootPool>pools
-
Constructor Summary
Constructors Modifier Constructor Description privateLootTable(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 voidaddPool(LootPool pool)private voidcheckFrozen()static java.util.function.Consumer<ItemStack>createStackSplitter(java.util.function.Consumer<ItemStack> p_216124_0_)voidfill(IInventory p_216118_1_, LootContext p_216118_2_)voidfreeze()private java.util.List<java.lang.Integer>getAvailableSlots(IInventory p_186459_1_, java.util.Random p_186459_2_)ResourceLocationgetLootTableId()LootParameterSetgetParamSet()LootPoolgetPool(java.lang.String name)java.util.List<ItemStack>getRandomItems(LootContext p_216113_1_)voidgetRandomItems(LootContext p_216120_1_, java.util.function.Consumer<ItemStack> p_216120_2_)Deprecated.voidgetRandomItemsRaw(LootContext p_216114_1_, java.util.function.Consumer<ItemStack> p_216114_2_)booleanisFrozen()static LootTable.BuilderlootTable()LootPoolremovePool(java.lang.String name)voidsetLootTableId(ResourceLocation id)private voidshuffleAndSplitItems(java.util.List<ItemStack> p_186463_1_, int p_186463_2_, java.util.Random p_186463_3_)voidvalidate(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)
-
-