From a84e83ab9e6cc12deefe7a8c901aa79dfcdb8c21 Mon Sep 17 00:00:00 2001 From: chyzman Date: Thu, 4 Mar 2021 12:59:10 -0500 Subject: [PATCH] nerfed leeching made succession scaleable made pentashot scaleable updated to 6.9.0 funny number --- .../enchantments/ecoenchants/normal/Leeching.java | 7 +++++++ .../enchantments/ecoenchants/normal/Succession.java | 4 ++-- .../enchantments/ecoenchants/special/Pentashot.java | 2 +- .../src/main/resources/enchants/normal/leeching.yml | 1 + .../src/main/resources/enchants/normal/succession.yml | 2 +- gradle.properties | 2 +- 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Leeching.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Leeching.java index 87032344..8609d508 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Leeching.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Leeching.java @@ -1,10 +1,12 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.normal; +import com.willfp.eco.util.PlayerUtils; import com.willfp.ecoenchants.enchantments.EcoEnchant; import com.willfp.ecoenchants.enchantments.EcoEnchants; import com.willfp.ecoenchants.enchantments.meta.EnchantmentType; import org.bukkit.attribute.Attribute; import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.jetbrains.annotations.NotNull; @@ -20,6 +22,11 @@ public class Leeching extends EcoEnchant { @NotNull final LivingEntity victim, final int level, @NotNull final EntityDamageByEntityEvent event) { + if (attacker instanceof Player + && PlayerUtils.getAttackCooldown((Player) attacker) != 1.0f + && !this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "allow-not-fully-charged")) { + return; + } double multiplier = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "health-per-level"); double amountToHeal = level * multiplier; double newHealth = attacker.getHealth() + amountToHeal; diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Succession.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Succession.java index f3610f98..a7ec427d 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Succession.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Succession.java @@ -25,11 +25,11 @@ public class Succession extends EcoEnchant { @NotNull final Arrow arrow, final int level, @NotNull final EntityShootBowEvent event) { - int number = this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "extra-arrows"); + int number = this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "extra-arrows-per-level"); boolean fire = EnchantChecks.mainhand(shooter, Enchantment.ARROW_FIRE); - for (int i = 1; i <= number; i++) { + for (int i = 1; i <= level*number; i++) { this.getPlugin().getScheduler().runLater(() -> { Arrow arrow1 = shooter.launchProjectile(Arrow.class, event.getProjectile().getVelocity()); arrow1.setPickupStatus(AbstractArrow.PickupStatus.DISALLOWED); diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Pentashot.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Pentashot.java index 90cd0fbd..ca8f8d63 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Pentashot.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Pentashot.java @@ -24,7 +24,7 @@ public class Pentashot extends EcoEnchant { @NotNull final Arrow arrow, final int level, @NotNull final EntityShootBowEvent event) { - for (int i = -2; i <= 2; i += 1) { + for (int i = -level; i <= level; i += 1) { if (i == 0) { continue; } diff --git a/eco-core/core-plugin/src/main/resources/enchants/normal/leeching.yml b/eco-core/core-plugin/src/main/resources/enchants/normal/leeching.yml index de3a8375..abbd0c64 100644 --- a/eco-core/core-plugin/src/main/resources/enchants/normal/leeching.yml +++ b/eco-core/core-plugin/src/main/resources/enchants/normal/leeching.yml @@ -24,3 +24,4 @@ general-config: config: health-per-level: 1 # Level * Health = Amount of health to heal + allow-not-fully-charged: false diff --git a/eco-core/core-plugin/src/main/resources/enchants/normal/succession.yml b/eco-core/core-plugin/src/main/resources/enchants/normal/succession.yml index 433aa0fe..0f0179b3 100644 --- a/eco-core/core-plugin/src/main/resources/enchants/normal/succession.yml +++ b/eco-core/core-plugin/src/main/resources/enchants/normal/succession.yml @@ -23,5 +23,5 @@ general-config: - buckshot config: - extra-arrows: 2 + extra-arrows-per-level: 1 per-arrow-damage: true #If set to false, then it will only take 1 durability \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 63dff8dd..9ba29b89 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ -version = 6.8.0 +version = 6.9.0 plugin-name = EcoEnchants \ No newline at end of file