public class LootContext extends Object
Modifier and Type | Class and Description |
---|---|
static class |
LootContext.Builder |
static interface |
LootContext.Dropper |
static class |
LootContext.EntityTarget |
Modifier and Type | Field and Description |
---|---|
private Set<LootTable> |
activeTables |
private Function<Identifier,LootCondition> |
conditionGetter |
private Set<LootCondition> |
conditions |
private Map<Identifier,LootContext.Dropper> |
drops |
private float |
luck |
private Map<LootContextParameter<?>,Object> |
parameters |
private Random |
random |
private Function<Identifier,LootTable> |
tableGetter |
private ServerWorld |
world |
Modifier | Constructor and Description |
---|---|
private |
LootContext(Random random,
float luck,
ServerWorld world,
Function<Identifier,LootTable> tableGetter,
Function<Identifier,LootCondition> conditionSetter,
Map<LootContextParameter<?>,Object> parameters,
Map<Identifier,LootContext.Dropper> drops) |
Modifier and Type | Method and Description |
---|---|
boolean |
addCondition(LootCondition condition) |
void |
drop(Identifier id,
Consumer<ItemStack> lootConsumer) |
<T> T |
get(LootContextParameter<T> parameter) |
LootCondition |
getCondition(Identifier id) |
float |
getLuck() |
Random |
getRandom() |
LootTable |
getSupplier(Identifier id) |
ServerWorld |
getWorld() |
boolean |
hasParameter(LootContextParameter<?> parameter) |
boolean |
markActive(LootTable table) |
void |
markInactive(LootTable table) |
void |
removeCondition(LootCondition condition) |
private final Random random
private final float luck
private final ServerWorld world
private final Function<Identifier,LootTable> tableGetter
private final Function<Identifier,LootCondition> conditionGetter
private final Set<LootCondition> conditions
private final Map<LootContextParameter<?>,Object> parameters
private final Map<Identifier,LootContext.Dropper> drops
private LootContext(Random random, float luck, ServerWorld world, Function<Identifier,LootTable> tableGetter, Function<Identifier,LootCondition> conditionSetter, Map<LootContextParameter<?>,Object> parameters, Map<Identifier,LootContext.Dropper> drops)
public boolean hasParameter(LootContextParameter<?> parameter)
public void drop(Identifier id, Consumer<ItemStack> lootConsumer)
@Nullable public <T> T get(LootContextParameter<T> parameter)
public boolean markActive(LootTable table)
public void markInactive(LootTable table)
public boolean addCondition(LootCondition condition)
public void removeCondition(LootCondition condition)
public LootTable getSupplier(Identifier id)
public LootCondition getCondition(Identifier id)
public Random getRandom()
public float getLuck()
public ServerWorld getWorld()