Package net.minecraft.loot.function
Class ApplyBonusLootFunction
java.lang.Object
net.minecraft.loot.function.ConditionalLootFunction
net.minecraft.loot.function.ApplyBonusLootFunction
- All Implemented Interfaces:
BiFunction<ItemStack,LootContext,ItemStack>
,LootContextAware
,LootFunction
public class ApplyBonusLootFunction extends ConditionalLootFunction
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
ApplyBonusLootFunction.BinomialWithBonusCount
(package private) static interface
ApplyBonusLootFunction.Formula
(package private) static interface
ApplyBonusLootFunction.FormulaFactory
(package private) static class
ApplyBonusLootFunction.OreDrops
static class
ApplyBonusLootFunction.Serializer
(package private) static class
ApplyBonusLootFunction.UniformBonusCount
Nested classes/interfaces inherited from class net.minecraft.loot.function.ConditionalLootFunction
ConditionalLootFunction.Builder<T extends ConditionalLootFunction.Builder<T>>, ConditionalLootFunction.Joiner
-
Field Summary
Fields Modifier and Type Field Description private Enchantment
enchantment
private static Map<Identifier,ApplyBonusLootFunction.FormulaFactory>
FACTORIES
private ApplyBonusLootFunction.Formula
formula
Fields inherited from class net.minecraft.loot.function.ConditionalLootFunction
conditions
-
Constructor Summary
Constructors Modifier Constructor Description private
ApplyBonusLootFunction(LootCondition[] conditions, Enchantment enchantment, ApplyBonusLootFunction.Formula formula)
-
Method Summary
Modifier and Type Method Description static ConditionalLootFunction.Builder<?>
binomialWithBonusCount(Enchantment enchantment, float probability, int extra)
Set<LootContextParameter<?>>
getRequiredParameters()
LootFunctionType
getType()
static ConditionalLootFunction.Builder<?>
oreDrops(Enchantment enchantment)
ItemStack
process(ItemStack stack, LootContext context)
static ConditionalLootFunction.Builder<?>
uniformBonusCount(Enchantment enchantment)
static ConditionalLootFunction.Builder<?>
uniformBonusCount(Enchantment enchantment, int bonusMultiplier)
Methods inherited from class net.minecraft.loot.function.ConditionalLootFunction
apply, builder, validate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.function.BiFunction
andThen
-
Field Details
-
FACTORIES
-
enchantment
-
formula
-
-
Constructor Details
-
ApplyBonusLootFunction
private ApplyBonusLootFunction(LootCondition[] conditions, Enchantment enchantment, ApplyBonusLootFunction.Formula formula)
-
-
Method Details
-
getType
-
getRequiredParameters
-
process
- Specified by:
process
in classConditionalLootFunction
-
binomialWithBonusCount
public static ConditionalLootFunction.Builder<?> binomialWithBonusCount(Enchantment enchantment, float probability, int extra) -
oreDrops
-
uniformBonusCount
-
uniformBonusCount
public static ConditionalLootFunction.Builder<?> uniformBonusCount(Enchantment enchantment, int bonusMultiplier)
-