Merge pull request #38

6.9.0
This commit is contained in:
Auxilor 2021-03-04 18:06:55 +00:00 committed by GitHub
commit 229ddf5924
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 5 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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;
}

View File

@ -24,3 +24,4 @@ general-config:
config:
health-per-level: 1 # Level * Health = Amount of health to heal
allow-not-fully-charged: false

View File

@ -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

View File

@ -1,2 +1,2 @@
version = 6.8.0
version = 6.9.0
plugin-name = EcoEnchants