diff --git a/MMOItems-Dist/src/main/java/net/Indyuce/mmoitems/listener/reforging/RFGKeepUpgrades.java b/MMOItems-Dist/src/main/java/net/Indyuce/mmoitems/listener/reforging/RFGKeepUpgrades.java index 8cc6cc60..a3e67c13 100644 --- a/MMOItems-Dist/src/main/java/net/Indyuce/mmoitems/listener/reforging/RFGKeepUpgrades.java +++ b/MMOItems-Dist/src/main/java/net/Indyuce/mmoitems/listener/reforging/RFGKeepUpgrades.java @@ -16,13 +16,14 @@ public class RFGKeepUpgrades implements Listener { @EventHandler public void onReforge(MMOItemReforgeEvent event) { - if (!event.getOptions().shouldKeepUpgrades()) { return; } - //RFG// MMOItems.log("§8Reforge §4EFG§7 Keeping Upgrades"); + final UpgradeData upgrade = ((UpgradeData) event.getOldMMOItem().getData(ItemStats.UPGRADE)); + final UpgradeData newOne = ((UpgradeData) event.getNewMMOItem().getData(ItemStats.UPGRADE)); - UpgradeData upgrade = ((UpgradeData) event.getOldMMOItem().getData(ItemStats.UPGRADE)); - UpgradeData newOne = ((UpgradeData) event.getNewMMOItem().getData(ItemStats.UPGRADE)); - - if (upgrade == null || newOne == null) { return; } + if (!event.getOptions().shouldKeepUpgrades() + || upgrade == null + || newOne == null + || newOne.getMaxUpgrades() <= 0) + return; //UPGRD//MMOItems.log(" \u00a7e* \u00a77Existing Upgrade Detected");