From 376858dee24e1f79a6de4c9d45e1cd16a9cda8b6 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sat, 6 Feb 2021 10:25:09 +0000 Subject: [PATCH 1/6] Finally updated mmo extension --- .../java/com/willfp/ecoenchants/mmo/MMOMain.java | 12 ++++++++++++ .../ecoenchants/mmo/enchants/misc/Strengthening.java | 5 +++++ .../ecoenchants/mmo/enchants/stamina/Motivate.java | 1 + .../ecoenchants/mmo/structure/MMOEnchantment.java | 1 + settings.gradle | 2 +- 5 files changed, 20 insertions(+), 1 deletion(-) diff --git a/eco-extensions/mmo/src/main/java/com/willfp/ecoenchants/mmo/MMOMain.java b/eco-extensions/mmo/src/main/java/com/willfp/ecoenchants/mmo/MMOMain.java index 7dbeee6d..afbb9d0e 100644 --- a/eco-extensions/mmo/src/main/java/com/willfp/ecoenchants/mmo/MMOMain.java +++ b/eco-extensions/mmo/src/main/java/com/willfp/ecoenchants/mmo/MMOMain.java @@ -3,6 +3,18 @@ package com.willfp.ecoenchants.mmo; import com.willfp.eco.util.extensions.Extension; import com.willfp.eco.util.plugin.AbstractEcoPlugin; import com.willfp.ecoenchants.enchantments.EcoEnchant; +import com.willfp.ecoenchants.mmo.enchants.abilities.Discounted; +import com.willfp.ecoenchants.mmo.enchants.abilities.Recover; +import com.willfp.ecoenchants.mmo.enchants.mana.Augment; +import com.willfp.ecoenchants.mmo.enchants.mana.Drain; +import com.willfp.ecoenchants.mmo.enchants.mana.Elixir; +import com.willfp.ecoenchants.mmo.enchants.mana.Siphon; +import com.willfp.ecoenchants.mmo.enchants.mana.Spirituality; +import com.willfp.ecoenchants.mmo.enchants.misc.Strengthening; +import com.willfp.ecoenchants.mmo.enchants.stamina.Athletic; +import com.willfp.ecoenchants.mmo.enchants.stamina.Endurance; +import com.willfp.ecoenchants.mmo.enchants.stamina.Fortitude; +import com.willfp.ecoenchants.mmo.enchants.stamina.Motivate; import org.bukkit.Bukkit; import org.jetbrains.annotations.NotNull; diff --git a/eco-extensions/mmo/src/main/java/com/willfp/ecoenchants/mmo/enchants/misc/Strengthening.java b/eco-extensions/mmo/src/main/java/com/willfp/ecoenchants/mmo/enchants/misc/Strengthening.java index 91e93328..20f634ab 100644 --- a/eco-extensions/mmo/src/main/java/com/willfp/ecoenchants/mmo/enchants/misc/Strengthening.java +++ b/eco-extensions/mmo/src/main/java/com/willfp/ecoenchants/mmo/enchants/misc/Strengthening.java @@ -3,6 +3,11 @@ package com.willfp.ecoenchants.mmo.enchants.misc; import com.willfp.eco.util.events.armorequip.ArmorEquipEvent; import com.willfp.ecoenchants.enchantments.EcoEnchants; import com.willfp.ecoenchants.enchantments.meta.EnchantmentType; +import com.willfp.ecoenchants.mmo.structure.MMOEnchantment; +import net.mmogroup.mmolib.MMOLib; +import net.mmogroup.mmolib.api.player.MMOPlayerData; +import net.mmogroup.mmolib.api.stat.SharedStat; +import net.mmogroup.mmolib.api.stat.modifier.StatModifier; import org.bukkit.entity.Player; public class Strengthening extends MMOEnchantment { diff --git a/eco-extensions/mmo/src/main/java/com/willfp/ecoenchants/mmo/enchants/stamina/Motivate.java b/eco-extensions/mmo/src/main/java/com/willfp/ecoenchants/mmo/enchants/stamina/Motivate.java index 0efcdf78..c0895aff 100644 --- a/eco-extensions/mmo/src/main/java/com/willfp/ecoenchants/mmo/enchants/stamina/Motivate.java +++ b/eco-extensions/mmo/src/main/java/com/willfp/ecoenchants/mmo/enchants/stamina/Motivate.java @@ -5,6 +5,7 @@ import com.willfp.ecoenchants.enchantments.meta.EnchantmentType; import com.willfp.ecoenchants.mmo.integrations.mmo.MMOManager; import com.willfp.ecoenchants.mmo.structure.MMOEnchantment; import com.willfp.ecoenchants.proxy.proxies.CooldownProxy; +import com.willfp.ecoenchants.util.ProxyUtils; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.event.entity.EntityDamageByEntityEvent; diff --git a/eco-extensions/mmo/src/main/java/com/willfp/ecoenchants/mmo/structure/MMOEnchantment.java b/eco-extensions/mmo/src/main/java/com/willfp/ecoenchants/mmo/structure/MMOEnchantment.java index 148ce21c..9effe1c7 100644 --- a/eco-extensions/mmo/src/main/java/com/willfp/ecoenchants/mmo/structure/MMOEnchantment.java +++ b/eco-extensions/mmo/src/main/java/com/willfp/ecoenchants/mmo/structure/MMOEnchantment.java @@ -3,6 +3,7 @@ package com.willfp.ecoenchants.mmo.structure; import com.willfp.eco.util.optional.Prerequisite; import com.willfp.ecoenchants.enchantments.EcoEnchant; import com.willfp.ecoenchants.enchantments.meta.EnchantmentType; +import com.willfp.ecoenchants.mmo.MMOPrerequisites; public abstract class MMOEnchantment extends EcoEnchant implements MMOEnchant { protected MMOEnchantment(String key, EnchantmentType type, Prerequisite... prerequisites) { diff --git a/settings.gradle b/settings.gradle index 18340d94..4f36a7f9 100644 --- a/settings.gradle +++ b/settings.gradle @@ -17,7 +17,7 @@ include ':eco-extensions:biomes' include ':eco-extensions:effects' include ':eco-extensions:endershot' include ':eco-extensions:firewand' -//include ':eco-extensions:mmo' +include ':eco-extensions:mmo' include ':eco-extensions:precision' include ':eco-extensions:sprint-artifacts' include ':eco-extensions:summoning' From b02ef3a856c0c267ceab290725302ea347f2b436 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sat, 6 Feb 2021 10:25:52 +0000 Subject: [PATCH 2/6] Fixed elixir --- .../java/com/willfp/ecoenchants/mmo/enchants/mana/Elixir.java | 1 + 1 file changed, 1 insertion(+) diff --git a/eco-extensions/mmo/src/main/java/com/willfp/ecoenchants/mmo/enchants/mana/Elixir.java b/eco-extensions/mmo/src/main/java/com/willfp/ecoenchants/mmo/enchants/mana/Elixir.java index 052a5ed4..eb6575fc 100644 --- a/eco-extensions/mmo/src/main/java/com/willfp/ecoenchants/mmo/enchants/mana/Elixir.java +++ b/eco-extensions/mmo/src/main/java/com/willfp/ecoenchants/mmo/enchants/mana/Elixir.java @@ -5,6 +5,7 @@ import com.willfp.ecoenchants.enchantments.meta.EnchantmentType; import com.willfp.ecoenchants.mmo.integrations.mmo.MMOManager; import com.willfp.ecoenchants.mmo.structure.MMOEnchantment; import com.willfp.ecoenchants.proxy.proxies.CooldownProxy; +import com.willfp.ecoenchants.util.ProxyUtils; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.event.entity.EntityDamageByEntityEvent; From 487c9eb428dc7b94099f27116a27d43b507ffca3 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sat, 6 Feb 2021 10:26:21 +0000 Subject: [PATCH 3/6] Re-Excluded mmo from build --- settings.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle b/settings.gradle index 4f36a7f9..18340d94 100644 --- a/settings.gradle +++ b/settings.gradle @@ -17,7 +17,7 @@ include ':eco-extensions:biomes' include ':eco-extensions:effects' include ':eco-extensions:endershot' include ':eco-extensions:firewand' -include ':eco-extensions:mmo' +//include ':eco-extensions:mmo' include ':eco-extensions:precision' include ':eco-extensions:sprint-artifacts' include ':eco-extensions:summoning' From df7c2d23c9a8f8c093240a71cb1048e90b1dbebb Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sat, 6 Feb 2021 17:10:59 +0000 Subject: [PATCH 4/6] Changed fortune logic in infernal touch (Thanks Markster!) --- .../enchantments/ecoenchants/normal/InfernalTouch.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/InfernalTouch.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/InfernalTouch.java index d890b3bb..ccbf591a 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/InfernalTouch.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/InfernalTouch.java @@ -111,7 +111,7 @@ public class InfernalTouch extends EcoEnchant { experience += out.getSecond(); if (fortune > 0 && FORTUNE_MATERIALS.contains(itemStack.getType())) { - itemStack.setAmount((int) Math.ceil(1 / ((double) fortune + 2) + ((double) fortune + 1) / 2)); + itemStack.setAmount((int) Math.round((Math.random() * ((double) fortune - 1)) + 1.1)); experience++; } } From 1f2f56f0bd2349b98c75bc942258a3979793c79a Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sat, 6 Feb 2021 17:19:02 +0000 Subject: [PATCH 5/6] Added randomenchant bypasshardcap permission --- .../ecoenchants/command/commands/CommandRandomenchant.java | 5 +++++ eco-core/core-plugin/src/main/resources/plugin.yml | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/command/commands/CommandRandomenchant.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/command/commands/CommandRandomenchant.java index 0ce7078a..b016f950 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/command/commands/CommandRandomenchant.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/command/commands/CommandRandomenchant.java @@ -67,6 +67,11 @@ public class CommandRandomenchant extends AbstractCommand { } } } + if (this.getPlugin().getConfigYml().getBool("anvil.hard-cap.enabled") + && !player.hasPermission("ecoenchants.randomenchant.bypasshardcap") + && onItem.size() >= this.getPlugin().getConfigYml().getInt("anvil.hard-cap.cap")) { + conflicts = true; + } if (!conflicts) { enchant = ecoEnchant; } diff --git a/eco-core/core-plugin/src/main/resources/plugin.yml b/eco-core/core-plugin/src/main/resources/plugin.yml index 0594275c..eba43b72 100644 --- a/eco-core/core-plugin/src/main/resources/plugin.yml +++ b/eco-core/core-plugin/src/main/resources/plugin.yml @@ -48,6 +48,7 @@ permissions: ecoenchants.enchantinfo: true ecoenchants.ecodebug: true ecoenchants.randomenchant: true + ecoenchants.randomenchant.bypasshardcap: true ecoenchants.anvil.*: true ecoenchants.anvil.*: description: Allows all anvil permissions @@ -74,6 +75,9 @@ permissions: ecoenchants.randomenchant: description: Allows the use of /randomenchant to apply a random enchantment to an item default: op + ecoenchants.randomenchant.bypasshardcap: + description: Allows /randomenchant bypassing the anvil hard cap + default: op ecoenchants.anvil.bypasshardcap: description: Allows bypassing the anvil hard cap default: op From 06fbafdab82e6dbd376c0d791bd6a4b153c47581 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sat, 6 Feb 2021 17:19:12 +0000 Subject: [PATCH 6/6] Updated to 6.5.1 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 8cc9347f..b73a04c5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ -version = 6.5.0 +version = 6.5.1 plugin-name = EcoEnchants \ No newline at end of file