mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 03:49:14 +00:00
Add ItemStack context to Enchantment#getDamageBonus (#8635)
This commit is contained in:
1 parent
03c43cf3da
commit
4285c931e7
3 files changed
+49
-1
No files matched your search
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) Forge Development LLC and contributors
|
||||
* SPDX-License-Identifier: LGPL-2.1-only
|
||||
*/
|
||||
|
||||
package net.minecraftforge.common.extensions;
|
||||
|
||||
import net.minecraft.world.entity.MobType;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.enchantment.Enchantment;
|
||||
|
||||
public interface IForgeEnchantment
|
||||
{
|
||||
private Enchantment self()
|
||||
{
|
||||
return (Enchantment) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ItemStack aware version of {@link Enchantment#getDamageBonus(int, MobType)}
|
||||
* @param level the level of the enchantment
|
||||
* @param mobType the mob type being attacked
|
||||
* @param enchantedItem the item used for the attack
|
||||
* @return the damage bonus
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
default float getDamageBonus(int level, MobType mobType, ItemStack enchantedItem)
|
||||
{
|
||||
return self().getDamageBonus(level, mobType);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user