mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2025-01-05 22:07:34 +01:00
Fix exp multiplier for grindstone, when use item with Intellect or Wisdom on mainhand
This commit is contained in:
parent
585a012880
commit
af8d946882
@ -7,6 +7,7 @@ import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
|
||||
import com.willfp.ecoenchants.enchantments.util.EnchantChecks;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class Wisdom extends EcoEnchant {
|
||||
@ -32,6 +33,10 @@ public class Wisdom extends EcoEnchant {
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.getOpenInventory().getTopInventory().getType() == InventoryType.GRINDSTONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
int level = EnchantChecks.getMainhandLevel(player, this);
|
||||
|
||||
event.getExpChangeEvent().setAmount((int) Math.ceil(event.getExpChangeEvent().getAmount() * (1 + (level * this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "bonus-per-point")))));
|
||||
|
@ -7,6 +7,7 @@ import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
|
||||
import com.willfp.ecoenchants.enchantments.util.EnchantChecks;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class Intellect extends EcoEnchant {
|
||||
@ -38,6 +39,10 @@ public class Intellect extends EcoEnchant {
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.getOpenInventory().getTopInventory().getType() == InventoryType.GRINDSTONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.getExpChangeEvent().setAmount((int) Math.ceil(event.getExpChangeEvent().getAmount() * (1 + (level * this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "bonus-per-point")))));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user