public class LootContext
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
LootContext.Builder |
static class |
LootContext.EntityTarget |
static interface |
LootContext.IDynamicDropProvider |
Modifier and Type | Field and Description |
---|---|
private java.util.Set<ILootCondition> |
conditions |
private java.util.Map<ResourceLocation,LootContext.IDynamicDropProvider> |
field_216037_g |
private java.util.function.Function<ResourceLocation,ILootCondition> |
field_227499_f_ |
private java.util.function.Function<ResourceLocation,LootTable> |
lootTableManager |
private java.util.Set<LootTable> |
lootTables |
private float |
luck |
private java.util.Map<LootParameter<?>,java.lang.Object> |
parameters |
private java.util.Random |
random |
private ServerWorld |
world |
Modifier | Constructor and Description |
---|---|
private |
LootContext(java.util.Random rand,
float luckIn,
ServerWorld worldIn,
java.util.function.Function<ResourceLocation,LootTable> lootTableManagerIn,
java.util.function.Function<ResourceLocation,ILootCondition> p_i225885_5_,
java.util.Map<LootParameter<?>,java.lang.Object> parametersIn,
java.util.Map<ResourceLocation,LootContext.IDynamicDropProvider> conditionsIn) |
Modifier and Type | Method and Description |
---|---|
boolean |
addCondition(ILootCondition conditionIn) |
boolean |
addLootTable(LootTable lootTableIn) |
void |
generateDynamicDrop(ResourceLocation name,
java.util.function.Consumer<ItemStack> consumer) |
<T> T |
get(LootParameter<T> parameter) |
ILootCondition |
getLootCondition(ResourceLocation conditionId) |
int |
getLootingModifier() |
LootTable |
getLootTable(ResourceLocation tableId) |
float |
getLuck() |
java.util.Random |
getRandom() |
ServerWorld |
getWorld() |
boolean |
has(LootParameter<?> parameter) |
void |
removeCondition(ILootCondition conditionIn) |
void |
removeLootTable(LootTable lootTableIn) |
private final java.util.Random random
private final float luck
private final ServerWorld world
private final java.util.function.Function<ResourceLocation,LootTable> lootTableManager
private final java.util.Set<LootTable> lootTables
private final java.util.function.Function<ResourceLocation,ILootCondition> field_227499_f_
private final java.util.Set<ILootCondition> conditions
private final java.util.Map<LootParameter<?>,java.lang.Object> parameters
private final java.util.Map<ResourceLocation,LootContext.IDynamicDropProvider> field_216037_g
private LootContext(java.util.Random rand, float luckIn, ServerWorld worldIn, java.util.function.Function<ResourceLocation,LootTable> lootTableManagerIn, java.util.function.Function<ResourceLocation,ILootCondition> p_i225885_5_, java.util.Map<LootParameter<?>,java.lang.Object> parametersIn, java.util.Map<ResourceLocation,LootContext.IDynamicDropProvider> conditionsIn)
public boolean has(LootParameter<?> parameter)
public void generateDynamicDrop(ResourceLocation name, java.util.function.Consumer<ItemStack> consumer)
@Nullable public <T> T get(LootParameter<T> parameter)
public boolean addLootTable(LootTable lootTableIn)
public void removeLootTable(LootTable lootTableIn)
public boolean addCondition(ILootCondition conditionIn)
public void removeCondition(ILootCondition conditionIn)
public LootTable getLootTable(ResourceLocation tableId)
public ILootCondition getLootCondition(ResourceLocation conditionId)
public java.util.Random getRandom()
public float getLuck()
public ServerWorld getWorld()
public int getLootingModifier()