mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-12-26 20:27:38 +01:00
commit
229ddf5924
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -24,3 +24,4 @@ general-config:
|
||||
|
||||
config:
|
||||
health-per-level: 1 # Level * Health = Amount of health to heal
|
||||
allow-not-fully-charged: false
|
||||
|
@ -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
|
@ -1,2 +1,2 @@
|
||||
version = 6.8.0
|
||||
version = 6.9.0
|
||||
plugin-name = EcoEnchants
|
Loading…
Reference in New Issue
Block a user