CommonLootModifiers
Holds a set of implementations of ILootModifier of common usage.
These can be used freely instead of rewriting the same code more than once. They are also guaranteed to behave correctly.
导入相关包
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
方法
add
Adds the given IItemStack to the drops.
Returns: An ILootModifier that carries out the operation. Return Type: ILootModifier
addAll
Adds all the given IItemStack to the drops.
Returns: An ILootModifier that carries out the operation. Return Type: ILootModifier
clearLoot
Clears the entire drop list.
Returns: An ILootModifier that carries out the operation. Return Type: ILootModifier
remove
Removes every instance of the targeted IIngredient from the drops.
Returns: An ILootModifier that carries out the operation. Return Type: ILootModifier
removeAll
Removes every instance of all the targeted IIngredients from the drops.
Returns: An ILootModifier that carries out the operation. Return Type: ILootModifier
replaceAllWith
Replaces every instance of the targeted IIngredients with their corresponding replacement IItemStack.
Returns: An ILootModifier that carries out the operation. Return Type: ILootModifier
replaceWith
Replaces every instance of the targeted IIngredient with the replacement IItemStack.
Returns: An ILootModifier that carries out the operation. Return Type: ILootModifier