Package net.minecraft.loot.functions
Class ApplyBonus
- java.lang.Object
-
- net.minecraft.loot.LootFunction
-
- net.minecraft.loot.functions.ApplyBonus
-
- All Implemented Interfaces:
java.util.function.BiFunction<ItemStack,LootContext,ItemStack>
,ILootFunction
,IParameterized
public class ApplyBonus extends LootFunction
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
ApplyBonus.BinomialWithBonusCountFormula
(package private) static interface
ApplyBonus.IFormula
(package private) static interface
ApplyBonus.IFormulaDeserializer
(package private) static class
ApplyBonus.OreDropsFormula
static class
ApplyBonus.Serializer
(package private) static class
ApplyBonus.UniformBonusCountFormula
-
Nested classes/interfaces inherited from class net.minecraft.loot.LootFunction
LootFunction.Builder<T extends LootFunction.Builder<T>>
-
Nested classes/interfaces inherited from interface net.minecraft.loot.functions.ILootFunction
ILootFunction.IBuilder
-
-
Field Summary
Fields Modifier and Type Field Description private Enchantment
enchantment
private ApplyBonus.IFormula
formula
private static java.util.Map<ResourceLocation,ApplyBonus.IFormulaDeserializer>
FORMULAS
-
Fields inherited from class net.minecraft.loot.LootFunction
predicates
-
-
Constructor Summary
Constructors Modifier Constructor Description private
ApplyBonus(ILootCondition[] p_i51246_1_, Enchantment p_i51246_2_, ApplyBonus.IFormula p_i51246_3_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LootFunction.Builder<?>
addBonusBinomialDistributionCount(Enchantment p_215870_0_, float p_215870_1_, int p_215870_2_)
static LootFunction.Builder<?>
addOreBonusCount(Enchantment p_215869_0_)
static LootFunction.Builder<?>
addUniformBonusCount(Enchantment p_215871_0_)
static LootFunction.Builder<?>
addUniformBonusCount(Enchantment p_215865_0_, int p_215865_1_)
java.util.Set<LootParameter<?>>
getReferencedContextParams()
LootFunctionType
getType()
ItemStack
run(ItemStack p_215859_1_, LootContext p_215859_2_)
-
Methods inherited from class net.minecraft.loot.LootFunction
apply, simpleBuilder, validate
-
-
-
-
Field Detail
-
FORMULAS
private static final java.util.Map<ResourceLocation,ApplyBonus.IFormulaDeserializer> FORMULAS
-
enchantment
private final Enchantment enchantment
-
formula
private final ApplyBonus.IFormula formula
-
-
Constructor Detail
-
ApplyBonus
private ApplyBonus(ILootCondition[] p_i51246_1_, Enchantment p_i51246_2_, ApplyBonus.IFormula p_i51246_3_)
-
-
Method Detail
-
getType
public LootFunctionType getType()
-
getReferencedContextParams
public java.util.Set<LootParameter<?>> getReferencedContextParams()
-
run
public ItemStack run(ItemStack p_215859_1_, LootContext p_215859_2_)
- Specified by:
run
in classLootFunction
-
addBonusBinomialDistributionCount
public static LootFunction.Builder<?> addBonusBinomialDistributionCount(Enchantment p_215870_0_, float p_215870_1_, int p_215870_2_)
-
addOreBonusCount
public static LootFunction.Builder<?> addOreBonusCount(Enchantment p_215869_0_)
-
addUniformBonusCount
public static LootFunction.Builder<?> addUniformBonusCount(Enchantment p_215871_0_)
-
addUniformBonusCount
public static LootFunction.Builder<?> addUniformBonusCount(Enchantment p_215865_0_, int p_215865_1_)
-
-