From 61388bb14d78fc7f39624bd00b3a7a11491f9a99 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Fri, 5 Mar 2021 19:41:37 +0000 Subject: [PATCH] Improved Prosperity and Thrive --- .../ecoenchants/enchantments/ecoenchants/normal/Thrive.java | 6 ++---- .../enchantments/ecoenchants/special/Prosperity.java | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Thrive.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Thrive.java index e56b8eda..5dfb13f2 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Thrive.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Thrive.java @@ -10,8 +10,6 @@ import org.bukkit.attribute.AttributeInstance; import org.bukkit.attribute.AttributeModifier; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; import java.util.UUID; @@ -44,14 +42,14 @@ public class Thrive extends EcoEnchant { if (player.getHealth() >= inst.getValue()) { this.getPlugin().getScheduler().runLater(() -> { - player.addPotionEffect(new PotionEffect(PotionEffectType.HEAL, 1, 255, false, false, false)); + player.setHealth(player.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()); }, 1); } if (points > 0) { inst.addModifier( new AttributeModifier( - UUID.nameUUIDFromBytes("prosperity".getBytes()), + UUID.nameUUIDFromBytes("thrive".getBytes()), this.getKey().getKey(), this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "health-per-point") * points, AttributeModifier.Operation.ADD_NUMBER diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Prosperity.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Prosperity.java index b140d99e..bad9541a 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Prosperity.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Prosperity.java @@ -10,8 +10,6 @@ import org.bukkit.attribute.AttributeInstance; import org.bukkit.attribute.AttributeModifier; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; import java.util.UUID; @@ -44,7 +42,7 @@ public class Prosperity extends EcoEnchant { if (player.getHealth() >= inst.getValue()) { this.getPlugin().getScheduler().runLater(() -> { - player.addPotionEffect(new PotionEffect(PotionEffectType.HEAL, 1, 255, false, false, false)); + player.setHealth(player.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()); }, 1); }