mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-22 15:05:18 +01:00
Added disable-on-players option for Razor, Bladed and Force enchantments
This commit is contained in:
parent
4e1fefdb3a
commit
966ab49af1
@ -4,6 +4,7 @@ import com.willfp.ecoenchants.enchantments.EcoEnchant;
|
||||
import com.willfp.ecoenchants.enchantments.EcoEnchants;
|
||||
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Trident;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@ -21,6 +22,7 @@ public class Bladed extends EcoEnchant {
|
||||
@NotNull final Trident trident,
|
||||
final int level,
|
||||
@NotNull final EntityDamageByEntityEvent event) {
|
||||
if (victim instanceof Player && this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "disable-on-players")) return;
|
||||
double baseDamage = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "base-multiplier");
|
||||
double damage = event.getDamage();
|
||||
double multiplier = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "multiplier");
|
||||
|
@ -5,6 +5,7 @@ import com.willfp.ecoenchants.enchantments.EcoEnchants;
|
||||
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@ -21,6 +22,7 @@ public class Force extends EcoEnchant {
|
||||
@NotNull final Arrow arrow,
|
||||
final int level,
|
||||
@NotNull final EntityDamageByEntityEvent event) {
|
||||
if (victim instanceof Player && this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "disable-on-players")) return;
|
||||
double damage = event.getDamage();
|
||||
double multiplier = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "multiplier");
|
||||
double bonus = (multiplier * (level + 6)) + 1;
|
||||
|
@ -20,6 +20,7 @@ public class Razor extends EcoEnchant {
|
||||
@NotNull final LivingEntity victim,
|
||||
final int level,
|
||||
@NotNull final EntityDamageByEntityEvent event) {
|
||||
if (victim instanceof Player && this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "disable-on-players")) return;
|
||||
double perLevelMultiplier = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "multiplier");
|
||||
double baseDamage = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "base-damage");
|
||||
double extra = (level * perLevelMultiplier) + baseDamage;
|
||||
|
@ -31,6 +31,7 @@ general-config:
|
||||
maximum-level: 5
|
||||
|
||||
config:
|
||||
disable-on-players: false # Should this enchantment only boost damage on mobs
|
||||
base-multiplier: 1.5 # Percent more damage to do as base
|
||||
multiplier: 0.5 # 1 + (Level * Multiplier) is multiplied with the damage
|
||||
# To explain, Bladed V would be 4x more damage: 1.5 + (5*0.5)
|
||||
|
@ -30,4 +30,5 @@ general-config:
|
||||
maximum-level: 8
|
||||
|
||||
config:
|
||||
disable-on-players: false # Should this enchantment only boost damage on mobs
|
||||
multiplier: 0.25 # Formula is (multiplier * (level + 6) + 1)*damage | Default functions as power 5 + level, eg force 2 = power 7
|
@ -32,6 +32,7 @@ general-config:
|
||||
maximum-level: 8
|
||||
|
||||
config:
|
||||
disable-on-players: false # Should this enchantment only boost damage on mobs
|
||||
multiplier: 0.3 # Vanilla sharpness is 0.5*level + 0.5 extra damage. Razor formula is multiplier*level + base extra damage.
|
||||
base-damage: 10 # Vanilla Smite 5/BOA 5 extra damage is 12.5
|
||||
decrease-if-cooldown: true
|
Loading…
Reference in New Issue
Block a user