Local repo for jar libs

This commit is contained in:
Indyuce 2021-06-12 14:06:54 +02:00
parent 710ea129ec
commit ab7b1bf5cf
35 changed files with 486 additions and 321 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

437
pom.xml
View File

@ -49,6 +49,7 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<repositories> <repositories>
<repository> <repository>
<id>lumine-repo</id> <id>lumine-repo</id>
@ -66,37 +67,70 @@
<id>inventive-repo</id> <id>inventive-repo</id>
<url>https://repo.inventivetalent.org/content/groups/public/</url> <url>https://repo.inventivetalent.org/content/groups/public/</url>
</repository> </repository>
<repository>
<id>placeholderapi</id>
<url>http://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
<repository> <repository>
<id>jitpack.io</id> <id>jitpack.io</id>
<url>https://jitpack.io</url> <url>https://jitpack.io</url>
</repository> </repository>
<repository>
<id>placeholderapi</id>
<url>http://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
<!-- Repository used to fetch all Spigot builds -->
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<!-- Local reposity used to save external libraries with no repos -->
<repository>
<id>local-repo</id>
<url>file://${project.basedir}/local-repo</url>
</repository>
</repositories> </repositories>
<dependencies> <dependencies>
<!-- Minecraft --> <!-- Minecraft -->
<dependency> <dependency>
<groupId>com.mojang</groupId> <groupId>com.mojang</groupId>
<artifactId>authlib</artifactId> <artifactId>authlib</artifactId>
<version>1.5.21</version> <version>1.5.21</version>
</dependency> </dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>amalgam</version>
<scope>system</scope>
<systemPath>${basedir}/lib/spigot.jar</systemPath>
</dependency>
<!-- MMOs -->
<!-- USING THIS FOR INTERNAL TESTING -->
<!-- <dependency> -->
<!-- <groupId>io.lumine</groupId> -->
<!-- <artifactId>MythicLib</artifactId> -->
<!-- <version>1.0. 0</version> -->
<!-- <scope>system</scope> -->
<!-- <systemPath>${basedir}/lib/MythicLib.jar</systemPath> -->
<!-- </dependency> -->
<!-- <dependency> <groupId>net.Indyuce</groupId> <artifactId>MMOLib</artifactId>
<version>1.7.3</version> <scope>system</scope> <systemPath>${basedir}/lib/MMOLib.jar</systemPath>
</dependency> -->
<!-- Handled via repositories -->
<dependency> <dependency>
<groupId>net.Indyuce</groupId> <groupId>net.Indyuce</groupId>
<artifactId>MMOCore</artifactId> <artifactId>MMOCore</artifactId>
<version>1.7.1</version> <version>1.7.1</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>io.lumine</groupId>
<artifactId>LumineUtils</artifactId>
<version>1.16.1-20210326.031037-28</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency> <dependency>
<groupId>io.lumine</groupId> <groupId>io.lumine</groupId>
<artifactId>MythicLib</artifactId> <artifactId>MythicLib</artifactId>
@ -104,45 +138,19 @@
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- USING THIS FOR INTERNAL TESTING -->
<!-- <dependency>-->
<!-- <groupId>io.lumine</groupId>-->
<!-- <artifactId>MythicLib</artifactId>-->
<!-- <version>1.0. 0</version>-->
<!-- <scope>system</scope>-->
<!-- <systemPath>${basedir}/lib/MythicLib.jar</systemPath>-->
<!-- </dependency>-->
<!--
<dependency> <dependency>
<groupId>net.Indyuce</groupId> <groupId>io.lumine</groupId>
<artifactId>MMOLib</artifactId> <artifactId>MythicEnchants</artifactId>
<version>1.7.3</version> <version>0.0.1-SNAPSHOT</version>
<scope>system</scope> <scope>provided</scope>
<systemPath>${basedir}/lib/MMOLib.jar</systemPath>
</dependency> </dependency>
-->
<!-- APIs -->
<dependency> <dependency>
<groupId>org.jetbrains</groupId> <groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId> <artifactId>annotations</artifactId>
<version>19.0.0</version> <version>19.0.0</version>
</dependency> </dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
<scope>system</scope>
<systemPath>${basedir}/lib/GoogleGSON.jar</systemPath>
</dependency>
<dependency>
<groupId>com.github.klyser8.iridescent</groupId>
<artifactId>Iridescent</artifactId>
<version>1.2.1</version>
<scope>system</scope>
<systemPath>${basedir}/lib/Iridescent.jar</systemPath>
</dependency>
<dependency> <dependency>
<groupId>com.github.RednedEpic</groupId> <groupId>com.github.RednedEpic</groupId>
<artifactId>PhatLoots</artifactId> <artifactId>PhatLoots</artifactId>
@ -150,186 +158,211 @@
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- Other Plugins -->
<dependency> <dependency>
<groupId>com.github.Eniripsa96</groupId> <groupId>com.github.MilkBowl</groupId>
<artifactId>SkillAPI</artifactId> <artifactId>VaultAPI</artifactId>
<version>master-SNAPSHOT</version> <version>1.7</version>
<scope>system</scope> <scope>provided</scope>
<systemPath>${basedir}/lib/SkillAPI.jar</systemPath>
</dependency>
<dependency>
<groupId>n3kas</groupId>
<artifactId>ae.api</artifactId>
<version>5.7.6</version>
<scope>system</scope>
<systemPath>${basedir}/lib/AE-API.jar</systemPath>
</dependency>
<dependency>
<groupId>org.black_ixx</groupId>
<artifactId>BossShop</artifactId>
<version>2.0.9</version>
<scope>system</scope>
<systemPath>${basedir}/lib/BossShopPro.jar</systemPath>
</dependency>
<dependency>
<groupId>io.lumine</groupId>
<artifactId>MythicEnchants</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.bekvon.bukkit</groupId>
<artifactId>Residence</artifactId>
<version>4.8.7.2</version>
<scope>system</scope>
<systemPath>${basedir}/lib/Residence.jar</systemPath>
</dependency>
<dependency>
<groupId>com.Zrips</groupId>
<artifactId>CMI</artifactId>
<version>8.6.5.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/CMI.jar</systemPath>
</dependency>
<dependency>
<groupId>com.herocraftonline</groupId>
<artifactId>heroes</artifactId>
<version>1.9.3</version>
<scope>system</scope>
<systemPath>${basedir}/lib/Heroes.jar</systemPath>
</dependency>
<dependency>
<groupId>com.gmail.nossr50</groupId>
<artifactId>mcMMO</artifactId>
<version>2.1.104</version>
<scope>system</scope>
<systemPath>${basedir}/lib/mcMMO.jar</systemPath>
</dependency>
<dependency>
<groupId>us.eunoians</groupId>
<artifactId>McRPG</artifactId>
<version>1.1.2</version>
<scope>system</scope>
<systemPath>${basedir}/lib/McRPG.jar</systemPath>
</dependency>
<dependency>
<groupId>me.baks</groupId>
<artifactId>rpl</artifactId>
<version>3.9.30</version>
<scope>system</scope>
<systemPath>${basedir}/lib/RPGPlayerLeveling.jar</systemPath>
</dependency>
<dependency>
<groupId>me.leothepro555</groupId>
<artifactId>skills</artifactId>
<version>12.3.5</version>
<scope>system</scope>
<systemPath>${basedir}/lib/Skills.jar</systemPath>
</dependency>
<dependency>
<groupId>org.skills.main</groupId>
<artifactId>SkillsPro</artifactId>
<version>18.9.0.1</version>
<scope>system</scope>
<systemPath>${basedir}/lib/SkillsPro.jar</systemPath>
</dependency>
<dependency>
<groupId>me.robin</groupId>
<artifactId>BattleLevels</artifactId>
<version>6.9.1</version>
<scope>system</scope>
<systemPath>${basedir}/lib/BattleLevels.jar</systemPath>
</dependency>
<dependency>
<groupId>com.evill4mer</groupId>
<artifactId>RealDualWield</artifactId>
<version>1.1.12</version>
<scope>system</scope>
<systemPath>${basedir}/lib/RealDualWield.jar</systemPath>
</dependency>
<dependency>
<groupId>me.arasple.mc</groupId>
<artifactId>TrHologram</artifactId>
<version>1.11</version>
<scope>system</scope>
<systemPath>${basedir}/lib/TrHologram.jar</systemPath>
</dependency>
<dependency>
<groupId>com.gmail.filoghost</groupId>
<artifactId>HolographicDisplays</artifactId>
<version>6.9.1</version>
<scope>system</scope>
<systemPath>${basedir}/lib/HolographicDisplays.jar</systemPath>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.lumine.xikage</groupId> <groupId>io.lumine.xikage</groupId>
<artifactId>MythicMobs</artifactId> <artifactId>MythicMobs</artifactId>
<version>4.8.0</version> <version>4.11.0-SNAPSHOT</version>
<scope>system</scope> <scope>provided</scope>
<systemPath>${basedir}/lib/MythicMobs.jar</systemPath>
</dependency> </dependency>
<!-- Spigot API -->
<dependency> <dependency>
<groupId>de.tobiyas</groupId> <groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.17-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-1.16.5</artifactId>
<version>dev</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-1.16.2</artifactId>
<version>dev</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-1.16.1</artifactId>
<version>dev</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-1.15</artifactId>
<version>dev</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-1.14</artifactId>
<version>dev</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<!-- Local Repo Dependencies -->
<dependency>
<groupId>net.Indyuce.mmoitems.lib</groupId>
<artifactId>SkillAPI</artifactId>
<version>3.108</version>
</dependency>
<dependency>
<groupId>net.Indyuce.mmoitems.lib</groupId>
<artifactId>WorldGuard</artifactId>
<version>7.0.2</version>
</dependency>
<dependency>
<groupId>net.Indyuce.mmoitems.lib</groupId>
<artifactId>GoogleGSON</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>net.Indyuce.mmoitems.lib</groupId>
<artifactId>AE-API</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>net.Indyuce.mmoitems.lib</groupId>
<artifactId>Iridescent</artifactId>
<version>1.2.2</version>
</dependency>
<dependency>
<groupId>net.Indyuce.mmoitems.lib</groupId>
<artifactId>BossShopPro</artifactId>
<version>2.0.9</version>
</dependency>
<dependency>
<groupId>net.Indyuce.mmoitems.lib</groupId>
<artifactId>Residence</artifactId>
<version>4.8.7.2</version>
</dependency>
<dependency>
<groupId>net.Indyuce.mmoitems.lib</groupId>
<artifactId>CMI</artifactId>
<version>8.6.5.0</version>
</dependency>
<dependency>
<groupId>net.Indyuce.mmoitems.lib</groupId>
<artifactId>Heroes</artifactId>
<version>1.9.3</version>
</dependency>
<dependency>
<groupId>net.Indyuce.mmoitems.lib</groupId>
<artifactId>mcMMO</artifactId>
<version>2.1.104</version>
</dependency>
<dependency>
<groupId>net.Indyuce.mmoitems.lib</groupId>
<artifactId>McRPG</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>net.Indyuce.mmoitems.lib</groupId>
<artifactId>RPGPlayerLeveling</artifactId>
<version>3.9.30</version>
</dependency>
<dependency>
<groupId>net.Indyuce.mmoitems.lib</groupId>
<artifactId>Skills</artifactId>
<version>12.3.5</version>
</dependency>
<dependency>
<groupId>net.Indyuce.mmoitems.lib</groupId>
<artifactId>SkillsPro</artifactId>
<version>18.9.0.1</version>
</dependency>
<dependency>
<groupId>net.Indyuce.mmoitems.lib</groupId>
<artifactId>GlowAPI</artifactId>
<version>1.4.8-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>net.Indyuce.mmoitems.lib</groupId>
<artifactId>BattleLevels</artifactId>
<version>6.9.1</version>
</dependency>
<dependency>
<groupId>net.Indyuce.mmoitems.lib</groupId>
<artifactId>RealDualWield</artifactId>
<version>1.1.12</version>
</dependency>
<dependency>
<groupId>net.Indyuce.mmoitems.lib</groupId>
<artifactId>TrHologram</artifactId>
<version>1.11</version>
</dependency>
<dependency>
<groupId>net.Indyuce.mmoitems.lib</groupId>
<artifactId>HolographicDisplays</artifactId>
<version>6.9.1</version>
</dependency>
<dependency>
<groupId>net.Indyuce.mmoitems.lib</groupId>
<artifactId>RacesAndClasses</artifactId> <artifactId>RacesAndClasses</artifactId>
<version>1.2.6</version> <version>1.2.6</version>
<scope>system</scope>
<systemPath>${basedir}/lib/RacesAndClasses.jar</systemPath>
</dependency> </dependency>
<dependency> <dependency>
<groupId>ru.endlesscode</groupId> <groupId>net.Indyuce.mmoitems.lib</groupId>
<artifactId>rpginventory</artifactId> <artifactId>RPGInventory</artifactId>
<version>2.3.0</version> <version>2.3.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/RPGInventory.jar</systemPath>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.sainttx.holograms</groupId> <groupId>net.Indyuce.mmoitems.lib</groupId>
<artifactId>holograms</artifactId> <artifactId>Holograms</artifactId>
<version>2.9.1</version> <version>2.9.1</version>
<scope>system</scope>
<systemPath>${basedir}/lib/Holograms.jar</systemPath>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.milkbowl</groupId> <groupId>net.Indyuce.mmoitems.lib</groupId>
<artifactId>vault</artifactId> <artifactId>WorldEdit</artifactId>
<version>1.7.2</version>
<scope>system</scope>
<systemPath>${basedir}/lib/Vault.jar</systemPath>
</dependency>
<dependency>
<groupId>com.sk89q.worldguard</groupId>
<artifactId>worldguard-bukkit</artifactId>
<version>7.0.1-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${basedir}/lib/WorldGuard.jar</systemPath>
</dependency>
<dependency>
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-bukkit</artifactId>
<version>7.2.0</version> <version>7.2.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/WorldEdit.jar</systemPath>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.citizensnpcs</groupId> <groupId>net.Indyuce.mmoitems.lib</groupId>
<artifactId>citizens</artifactId> <artifactId>Citizens</artifactId>
<version>2.0.25-SNAPSHOT</version> <version>2.0.25-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${basedir}/lib/Citizens.jar</systemPath>
</dependency>
<dependency>
<groupId>org.inventivetalent</groupId>
<artifactId>glowapi</artifactId>
<version>1.4.8-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${basedir}/lib/GlowAPI.jar</systemPath>
</dependency>
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.10.7</version>
<scope>system</scope>
<systemPath>${basedir}/lib/PlaceholderAPI.jar</systemPath>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -1,5 +1,23 @@
package net.Indyuce.mmoitems; package net.Indyuce.mmoitems;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import javax.annotation.Nullable;
import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener;
import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitRunnable;
import org.jetbrains.annotations.NotNull;
import io.lumine.mythic.lib.api.item.ItemTag; import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.item.NBTItem; import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.api.item.SupportedNBTTagValues; import io.lumine.mythic.lib.api.item.SupportedNBTTagValues;
@ -7,8 +25,12 @@ import io.lumine.mythic.lib.api.util.ui.FriendlyFeedbackCategory;
import io.lumine.mythic.lib.api.util.ui.FriendlyFeedbackMessage; import io.lumine.mythic.lib.api.util.ui.FriendlyFeedbackMessage;
import io.lumine.mythic.lib.api.util.ui.FriendlyFeedbackProvider; import io.lumine.mythic.lib.api.util.ui.FriendlyFeedbackProvider;
import io.lumine.mythic.lib.version.SpigotPlugin; import io.lumine.mythic.lib.version.SpigotPlugin;
import io.lumine.mythic.utils.plugin.LuminePlugin; import io.lumine.utils.plugin.LuminePlugin;
import net.Indyuce.mmoitems.api.*; import net.Indyuce.mmoitems.api.ClaseMuyImportante;
import net.Indyuce.mmoitems.api.ConfigFile;
import net.Indyuce.mmoitems.api.ItemTier;
import net.Indyuce.mmoitems.api.SoulboundInfo;
import net.Indyuce.mmoitems.api.Type;
import net.Indyuce.mmoitems.api.crafting.MMOItemUIFilter; import net.Indyuce.mmoitems.api.crafting.MMOItemUIFilter;
import net.Indyuce.mmoitems.api.item.mmoitem.MMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.MMOItem;
import net.Indyuce.mmoitems.api.item.template.MMOItemTemplate; import net.Indyuce.mmoitems.api.item.template.MMOItemTemplate;
@ -17,14 +39,28 @@ import net.Indyuce.mmoitems.api.util.MMOItemReforger;
import net.Indyuce.mmoitems.api.util.NumericStatFormula; import net.Indyuce.mmoitems.api.util.NumericStatFormula;
import net.Indyuce.mmoitems.api.util.message.FFPMMOItems; import net.Indyuce.mmoitems.api.util.message.FFPMMOItems;
import net.Indyuce.mmoitems.command.MMOItemsCommandTreeRoot; import net.Indyuce.mmoitems.command.MMOItemsCommandTreeRoot;
import net.Indyuce.mmoitems.comp.*; import net.Indyuce.mmoitems.comp.AdvancedEnchantmentsHook;
import net.Indyuce.mmoitems.comp.MMOItemsMetrics;
import net.Indyuce.mmoitems.comp.MMOItemsRewardTypes;
import net.Indyuce.mmoitems.comp.McMMONonRPGHook;
import net.Indyuce.mmoitems.comp.PhatLootsHook;
import net.Indyuce.mmoitems.comp.RealDualWieldHook;
import net.Indyuce.mmoitems.comp.WorldEditSupport;
import net.Indyuce.mmoitems.comp.eco.VaultSupport; import net.Indyuce.mmoitems.comp.eco.VaultSupport;
import net.Indyuce.mmoitems.comp.flags.DefaultFlags; import net.Indyuce.mmoitems.comp.flags.DefaultFlags;
import net.Indyuce.mmoitems.comp.flags.FlagPlugin; import net.Indyuce.mmoitems.comp.flags.FlagPlugin;
import net.Indyuce.mmoitems.comp.flags.ResidenceFlags; import net.Indyuce.mmoitems.comp.flags.ResidenceFlags;
import net.Indyuce.mmoitems.comp.flags.WorldGuardFlags; import net.Indyuce.mmoitems.comp.flags.WorldGuardFlags;
import net.Indyuce.mmoitems.comp.holograms.*; import net.Indyuce.mmoitems.comp.holograms.CMIPlugin;
import net.Indyuce.mmoitems.comp.inventory.*; import net.Indyuce.mmoitems.comp.holograms.HologramSupport;
import net.Indyuce.mmoitems.comp.holograms.HologramsPlugin;
import net.Indyuce.mmoitems.comp.holograms.HolographicDisplaysPlugin;
import net.Indyuce.mmoitems.comp.holograms.TrHologramPlugin;
import net.Indyuce.mmoitems.comp.inventory.DefaultPlayerInventory;
import net.Indyuce.mmoitems.comp.inventory.OrnamentPlayerInventory;
import net.Indyuce.mmoitems.comp.inventory.PlayerInventory;
import net.Indyuce.mmoitems.comp.inventory.PlayerInventoryHandler;
import net.Indyuce.mmoitems.comp.inventory.RPGInventoryHook;
import net.Indyuce.mmoitems.comp.itemglow.ItemGlowListener; import net.Indyuce.mmoitems.comp.itemglow.ItemGlowListener;
import net.Indyuce.mmoitems.comp.itemglow.NoGlowListener; import net.Indyuce.mmoitems.comp.itemglow.NoGlowListener;
import net.Indyuce.mmoitems.comp.mmocore.MMOCoreMMOLoader; import net.Indyuce.mmoitems.comp.mmocore.MMOCoreMMOLoader;
@ -42,25 +78,34 @@ import net.Indyuce.mmoitems.comp.rpg.McMMOHook;
import net.Indyuce.mmoitems.comp.rpg.RPGHandler; import net.Indyuce.mmoitems.comp.rpg.RPGHandler;
import net.Indyuce.mmoitems.gui.PluginInventory; import net.Indyuce.mmoitems.gui.PluginInventory;
import net.Indyuce.mmoitems.gui.listener.GuiListener; import net.Indyuce.mmoitems.gui.listener.GuiListener;
import net.Indyuce.mmoitems.listener.*; import net.Indyuce.mmoitems.listener.CraftingListener;
import net.Indyuce.mmoitems.manager.*; import net.Indyuce.mmoitems.listener.CustomBlockListener;
import org.apache.commons.lang.Validate; import net.Indyuce.mmoitems.listener.CustomSoundListener;
import org.bukkit.Bukkit; import net.Indyuce.mmoitems.listener.DisableInteractions;
import org.bukkit.ChatColor; import net.Indyuce.mmoitems.listener.DurabilityListener;
import org.bukkit.command.ConsoleCommandSender; import net.Indyuce.mmoitems.listener.ElementListener;
import org.bukkit.entity.Player; import net.Indyuce.mmoitems.listener.EquipListener;
import org.bukkit.event.HandlerList; import net.Indyuce.mmoitems.listener.ItemListener;
import org.bukkit.event.Listener; import net.Indyuce.mmoitems.listener.ItemUse;
import org.bukkit.inventory.ItemStack; import net.Indyuce.mmoitems.listener.PlayerListener;
import org.bukkit.scheduler.BukkitRunnable; import net.Indyuce.mmoitems.manager.AbilityManager;
import org.jetbrains.annotations.NotNull; import net.Indyuce.mmoitems.manager.BlockManager;
import net.Indyuce.mmoitems.manager.ConfigManager;
import javax.annotation.Nullable; import net.Indyuce.mmoitems.manager.CraftingManager;
import java.io.File; import net.Indyuce.mmoitems.manager.DropTableManager;
import java.util.ArrayList; import net.Indyuce.mmoitems.manager.EntityManager;
import java.util.List; import net.Indyuce.mmoitems.manager.ItemManager;
import java.util.logging.Level; import net.Indyuce.mmoitems.manager.LayoutManager;
import net.Indyuce.mmoitems.manager.LoreFormatManager;
import net.Indyuce.mmoitems.manager.PluginUpdateManager;
import net.Indyuce.mmoitems.manager.RecipeManager;
import net.Indyuce.mmoitems.manager.SetManager;
import net.Indyuce.mmoitems.manager.StatManager;
import net.Indyuce.mmoitems.manager.TemplateManager;
import net.Indyuce.mmoitems.manager.TierManager;
import net.Indyuce.mmoitems.manager.TypeManager;
import net.Indyuce.mmoitems.manager.UpgradeManager;
import net.Indyuce.mmoitems.manager.WorldGenManager;
public class MMOItems extends LuminePlugin { public class MMOItems extends LuminePlugin {
public static MMOItems plugin; public static MMOItems plugin;
@ -137,6 +182,7 @@ public class MMOItems extends LuminePlugin {
mythicEnchantsSupport = new MythicEnchantsSupport(); mythicEnchantsSupport = new MythicEnchantsSupport();
} }
@Override @Override
public void enable() { public void enable() {
@ -207,7 +253,8 @@ public class MMOItems extends LuminePlugin {
Bukkit.getPluginManager().registerEvents(new ElementListener(), this); Bukkit.getPluginManager().registerEvents(new ElementListener(), this);
Bukkit.getPluginManager().registerEvents(new CustomBlockListener(), this); Bukkit.getPluginManager().registerEvents(new CustomBlockListener(), this);
if (Bukkit.getPluginManager().getPlugin("PhatLoots") != null) { if (Bukkit.getPluginManager().getPlugin("PhatLoots") != null) {
Bukkit.getPluginManager().registerEvents(new PhatLootsHook(), this); } Bukkit.getPluginManager().registerEvents(new PhatLootsHook(), this);
}
MMOItemUIFilter.register(); MMOItemUIFilter.register();
Bukkit.getScheduler().runTaskTimer(this, () -> Bukkit.getOnlinePlayers().forEach(player -> PlayerData.get(player).updateStats()), 100, 20); Bukkit.getScheduler().runTaskTimer(this, () -> Bukkit.getOnlinePlayers().forEach(player -> PlayerData.get(player).updateStats()), 100, 20);
@ -234,8 +281,8 @@ public class MMOItems extends LuminePlugin {
Bukkit.getPluginManager().registerEvents(new McMMONonRPGHook(), this); Bukkit.getPluginManager().registerEvents(new McMMONonRPGHook(), this);
/* /*
* Registers Player Inventories. Each of these add locations of items to search for * Registers Player Inventories. Each of these add locations of items to
* when doing inventory updates. * search for when doing inventory updates.
*/ */
registerPlayerInventory(new DefaultPlayerInventory()); registerPlayerInventory(new DefaultPlayerInventory());
if (Bukkit.getPluginManager().getPlugin("RPGInventory") != null) { if (Bukkit.getPluginManager().getPlugin("RPGInventory") != null) {
@ -290,10 +337,17 @@ public class MMOItems extends LuminePlugin {
if (Bukkit.getPluginManager().getPlugin("BossShopPro") != null) { if (Bukkit.getPluginManager().getPlugin("BossShopPro") != null) {
getLogger().log(Level.INFO, "Hooked onto BossShopPro"); getLogger().log(Level.INFO, "Hooked onto BossShopPro");
(new BukkitRunnable() { public void run() { (new BukkitRunnable() {
//noinspection ProhibitedExceptionCaught public void run() {
try { new MMOItemsRewardTypes().register(); } catch (NullPointerException ignored) { getLogger().log(Level.INFO, "Could not Hook onto BossShopPro"); } } // noinspection ProhibitedExceptionCaught
}).runTaskLater(this, 1L); } try {
new MMOItemsRewardTypes().register();
} catch (NullPointerException ignored) {
getLogger().log(Level.INFO, "Could not Hook onto BossShopPro");
}
}
}).runTaskLater(this, 1L);
}
// compatibility with /reload // compatibility with /reload
Bukkit.getScheduler().runTask(this, () -> Bukkit.getOnlinePlayers().forEach(PlayerData::load)); Bukkit.getScheduler().runTask(this, () -> Bukkit.getOnlinePlayers().forEach(PlayerData::load));
@ -323,8 +377,8 @@ public class MMOItems extends LuminePlugin {
getCommand("mmoitems").setTabCompleter(mmoitemsCommand); getCommand("mmoitems").setTabCompleter(mmoitemsCommand);
// update item command DISABLED // update item command DISABLED
//getCommand("updateitem").setExecutor(new UpdateItemCommand()); // getCommand("updateitem").setExecutor(new UpdateItemCommand());
//getCommand("updateitem").setTabCompleter(new UpdateItemCompletion()); // getCommand("updateitem").setTabCompleter(new UpdateItemCompletion());
} }
@Override @Override
@ -429,11 +483,12 @@ public class MMOItems extends LuminePlugin {
* Default instance is DefaultPlayerInventory in comp.inventory * Default instance is DefaultPlayerInventory in comp.inventory
* *
* @param value The player inventory subclass * @param value The player inventory subclass
* @deprecated Rather than setting this to the only inventory MMOItems will * @deprecated Rather than setting this to the only inventory MMOItems
* search equipment within, you must add your inventory to the * will search equipment within, you must add your
* handler with <code>getInventory().Register()</code>. This method * inventory to the handler with
* will clear all other PlayerInventories for now, as to keep * <code>getInventory().Register()</code>. This method
* backwards compatibility. * will clear all other PlayerInventories for now, as to
* keep backwards compatibility.
*/ */
@Deprecated @Deprecated
public void setPlayerInventory(PlayerInventory value) { public void setPlayerInventory(PlayerInventory value) {
@ -496,7 +551,8 @@ public class MMOItems extends LuminePlugin {
public HologramSupport getHolograms() { public HologramSupport getHolograms() {
return hologramSupport; return hologramSupport;
} }
public EquipListener getEquipListener(){
public EquipListener getEquipListener() {
return equipListener; return equipListener;
} }
@ -520,7 +576,7 @@ public class MMOItems extends LuminePlugin {
return vaultSupport != null && vaultSupport.getPermissions() != null; return vaultSupport != null && vaultSupport.getPermissions() != null;
} }
public MythicEnchantsSupport getMythicEnchantsSupport(){ public MythicEnchantsSupport getMythicEnchantsSupport() {
return this.mythicEnchantsSupport; return this.mythicEnchantsSupport;
} }
@ -536,11 +592,14 @@ public class MMOItems extends LuminePlugin {
return stringInputParsers; return stringInputParsers;
} }
//region Easy-Access API // region Easy-Access API
/** /**
* Decide by which system will the RPG Requirements of the player will be checked. * Decide by which system will the RPG Requirements of the player will be
* <p></p> * checked.
* For example, required level, is that vanilla XP levels, MMOCore levels, McMMO Leves or what? * <p>
* </p>
* For example, required level, is that vanilla XP levels, MMOCore levels,
* McMMO Leves or what?
*/ */
public void findRpgPlugin() { public void findRpgPlugin() {
if (rpgPlugin != null) if (rpgPlugin != null)
@ -562,7 +621,8 @@ public class MMOItems extends LuminePlugin {
return; return;
} else { } else {
print(null, "Preferred RPGPlayer provider $r{0}$b is not installed!", "RPG Provider", preferred); } print(null, "Preferred RPGPlayer provider $r{0}$b is not installed!", "RPG Provider", preferred);
}
} catch (IllegalArgumentException ignored) { } catch (IllegalArgumentException ignored) {
@ -570,7 +630,9 @@ public class MMOItems extends LuminePlugin {
FriendlyFeedbackProvider ffp = new FriendlyFeedbackProvider(FFPMMOItems.get()); FriendlyFeedbackProvider ffp = new FriendlyFeedbackProvider(FFPMMOItems.get());
ffp.activatePrefix(true, "RPG Provider"); ffp.activatePrefix(true, "RPG Provider");
ffp.log(FriendlyFeedbackCategory.ERROR, "Invalid RPG Provider '$u{0}$b' --- These are the supported ones:", preferred); ffp.log(FriendlyFeedbackCategory.ERROR, "Invalid RPG Provider '$u{0}$b' --- These are the supported ones:", preferred);
for (RPGHandler.PluginEnum pgrep : RPGHandler.PluginEnum.values()) { ffp.log(FriendlyFeedbackCategory.ERROR, " $r+ $b{0}", pgrep.getName()); } for (RPGHandler.PluginEnum pgrep : RPGHandler.PluginEnum.values()) {
ffp.log(FriendlyFeedbackCategory.ERROR, " $r+ $b{0}", pgrep.getName());
}
ffp.sendTo(FriendlyFeedbackCategory.ERROR, getConsole()); ffp.sendTo(FriendlyFeedbackCategory.ERROR, getConsole());
} }
} }
@ -600,12 +662,17 @@ public class MMOItems extends LuminePlugin {
* 'level-item' option. The item will pick a random tier if the * 'level-item' option. The item will pick a random tier if the
* template has the 'tiered' option * template has the 'tiered' option
*/ */
@Nullable public MMOItem getMMOItem(@Nullable Type type, @Nullable String id, @NotNull PlayerData player) { @Nullable
if (type == null || id == null) { return null; } public MMOItem getMMOItem(@Nullable Type type, @Nullable String id, @NotNull PlayerData player) {
if (type == null || id == null) {
return null;
}
// Valid template? // Valid template?
MMOItemTemplate found = getTemplates().getTemplate(type, id); MMOItemTemplate found = getTemplates().getTemplate(type, id);
if (found == null) { return null; } if (found == null) {
return null;
}
// Build if found // Build if found
return found.newBuilder(player.getRPG()).build(); return found.newBuilder(player.getRPG()).build();
@ -617,12 +684,17 @@ public class MMOItems extends LuminePlugin {
* 'level-item' option. The item will pick a random tier if the * 'level-item' option. The item will pick a random tier if the
* template has the 'tiered' option * template has the 'tiered' option
*/ */
@Nullable public ItemStack getItem(@Nullable Type type, @Nullable String id, @NotNull PlayerData player) { @Nullable
if (type == null || id == null) { return null; } public ItemStack getItem(@Nullable Type type, @Nullable String id, @NotNull PlayerData player) {
if (type == null || id == null) {
return null;
}
// Valid MMOItem? // Valid MMOItem?
MMOItem m = getMMOItem(type, id, player); MMOItem m = getMMOItem(type, id, player);
if (m == null) { return null; } if (m == null) {
return null;
}
// Build if found // Build if found
return m.newBuilder().build(); return m.newBuilder().build();
@ -634,12 +706,17 @@ public class MMOItems extends LuminePlugin {
* @return Generates an item given an item template with a * @return Generates an item given an item template with a
* specific item level and item tier * specific item level and item tier
*/ */
@Nullable public MMOItem getMMOItem(@Nullable Type type, @Nullable String id, int itemLevel, @Nullable ItemTier itemTier) { @Nullable
if (type == null || id == null) { return null; } public MMOItem getMMOItem(@Nullable Type type, @Nullable String id, int itemLevel, @Nullable ItemTier itemTier) {
if (type == null || id == null) {
return null;
}
// Valid template? // Valid template?
MMOItemTemplate found = getTemplates().getTemplate(type, id); MMOItemTemplate found = getTemplates().getTemplate(type, id);
if (found == null) { return null; } if (found == null) {
return null;
}
// Build if found // Build if found
return found.newBuilder(itemLevel, itemTier).build(); return found.newBuilder(itemLevel, itemTier).build();
@ -651,12 +728,17 @@ public class MMOItems extends LuminePlugin {
* @return Generates an item given an item template with a * @return Generates an item given an item template with a
* specific item level and item tier * specific item level and item tier
*/ */
@Nullable public ItemStack getItem(@Nullable Type type, @Nullable String id, int itemLevel, @Nullable ItemTier itemTier) { @Nullable
if (type == null || id == null) { return null; } public ItemStack getItem(@Nullable Type type, @Nullable String id, int itemLevel, @Nullable ItemTier itemTier) {
if (type == null || id == null) {
return null;
}
// Valid MMOItem? // Valid MMOItem?
MMOItem m = getMMOItem(type, id, itemLevel, itemTier); MMOItem m = getMMOItem(type, id, itemLevel, itemTier);
if (m == null) { return null; } if (m == null) {
return null;
}
// Build if found // Build if found
return m.newBuilder().build(); return m.newBuilder().build();
@ -666,15 +748,21 @@ public class MMOItems extends LuminePlugin {
* @return Generates an item given an item template. The item level will be * @return Generates an item given an item template. The item level will be
* 0 and the item will have no item tier unless one is specified in * 0 and the item will have no item tier unless one is specified in
* the base item data. * the base item data.
* <p></p> * <p>
* </p>
* Will return <code>null</code> if such MMOItem does not exist. * Will return <code>null</code> if such MMOItem does not exist.
*/ */
@Nullable public MMOItem getMMOItem(@Nullable Type type, @Nullable String id) { @Nullable
if (type == null || id == null) { return null; } public MMOItem getMMOItem(@Nullable Type type, @Nullable String id) {
if (type == null || id == null) {
return null;
}
// Valid template? // Valid template?
MMOItemTemplate found = getTemplates().getTemplate(type, id); MMOItemTemplate found = getTemplates().getTemplate(type, id);
if (found == null) { return null; } if (found == null) {
return null;
}
// Build if found // Build if found
return found.newBuilder(0, null).build(); return found.newBuilder(0, null).build();
@ -684,39 +772,52 @@ public class MMOItems extends LuminePlugin {
* @return Generates an item given an item template. The item level will be * @return Generates an item given an item template. The item level will be
* 0 and the item will have no item tier unless one is specified in * 0 and the item will have no item tier unless one is specified in
* the base item data. * the base item data.
* <p></p> * <p>
* </p>
* Will return <code>null</code> if such MMOItem does not exist. * Will return <code>null</code> if such MMOItem does not exist.
*/ */
@Nullable public ItemStack getItem(@Nullable String type, @Nullable String id) { @Nullable
if (type == null || id == null) { return null; } public ItemStack getItem(@Nullable String type, @Nullable String id) {
if (type == null || id == null) {
return null;
}
return getItem(getType(type), id); return getItem(getType(type), id);
} }
/** /**
* @return Generates an item given an item template. The item level will be * @return Generates an item given an item template. The item level will be
* 0 and the item will have no item tier unless one is specified in * 0 and the item will have no item tier unless one is specified in
* the base item data. * the base item data.
* <p></p> * <p>
* </p>
* Will return <code>null</code> if such MMOItem does not exist. * Will return <code>null</code> if such MMOItem does not exist.
*/ */
@Nullable public ItemStack getItem(@Nullable Type type, @Nullable String id) { @Nullable
if (type == null || id == null) { return null; } public ItemStack getItem(@Nullable Type type, @Nullable String id) {
if (type == null || id == null) {
return null;
}
// Valid MMOItem? // Valid MMOItem?
MMOItem m = getMMOItem(type, id); MMOItem m = getMMOItem(type, id);
if (m == null) { return null; } if (m == null) {
return null;
}
// Build if found // Build if found
return m.newBuilder().build(); return m.newBuilder().build();
} }
/** /**
* @param nbtItem The NBTItem you are testing * @param nbtItem The NBTItem you are testing
* @return The MMOItem Type of this item, if it is a MMOItem * @return The MMOItem Type of this item, if it is a MMOItem
*/ */
@Nullable public Type getType(@Nullable NBTItem nbtItem) { @Nullable
if (nbtItem == null || !nbtItem.hasType()) { return null; } public Type getType(@Nullable NBTItem nbtItem) {
if (nbtItem == null || !nbtItem.hasType()) {
return null;
}
// Try that one instead // Try that one instead
return getType(nbtItem.getType()); return getType(nbtItem.getType());
@ -726,11 +827,16 @@ public class MMOItems extends LuminePlugin {
* @param nbtItem The NBTItem you are testing * @param nbtItem The NBTItem you are testing
* @return The MMOItem ID of this item, if it is a MMOItem * @return The MMOItem ID of this item, if it is a MMOItem
*/ */
@Nullable public String getID(@Nullable NBTItem nbtItem) { @Nullable
if (nbtItem == null || !nbtItem.hasType()) { return null; } public String getID(@Nullable NBTItem nbtItem) {
if (nbtItem == null || !nbtItem.hasType()) {
return null;
}
ItemTag type = ItemTag.getTagAtPath("MMOITEMS_ITEM_ID", nbtItem, SupportedNBTTagValues.STRING); ItemTag type = ItemTag.getTagAtPath("MMOITEMS_ITEM_ID", nbtItem, SupportedNBTTagValues.STRING);
if (type == null) { return null; } if (type == null) {
return null;
}
return (String) type.getValue(); return (String) type.getValue();
} }
@ -741,39 +847,52 @@ public class MMOItems extends LuminePlugin {
* *
* @return A type if such exists. * @return A type if such exists.
*/ */
@Nullable public Type getType(@Nullable String type) { @Nullable
if (type == null) { return null; } public Type getType(@Nullable String type) {
if (type == null) {
return null;
}
return getTypes().get(type); return getTypes().get(type);
} }
/** /**
* Logs something into the console with a cool [MMOItems] prefix :) * Logs something into the console with a cool [MMOItems] prefix :)
* <p></p> * <p>
* Parses color codes. <b>Mostly for DEV testing</b>. these may removed any release. * </p>
* Parses color codes. <b>Mostly for DEV testing</b>. these may removed any
* release.
* *
* @author Gunging * @author Gunging
*/ */
public static void log(@Nullable String message) { public static void log(@Nullable String message) {
if (message == null) { message = "< null >"; } if (message == null) {
//String prefix = "\u00a78[" + ChatColor.YELLOW + "MMOItems\u00a78] \u00a77"; message = "< null >";
}
// String prefix = "\u00a78[" + ChatColor.YELLOW + "MMOItems\u00a78]
// \u00a77";
String prefix = ""; String prefix = "";
plugin.getServer().getConsoleSender().sendMessage(prefix + message); plugin.getServer().getConsoleSender().sendMessage(prefix + message);
} }
/** /**
* Easily log something using the FriendlyFeedbackProvider, nice! * Easily log something using the FriendlyFeedbackProvider, nice!
* <p></p> * <p>
* </p>
* Use a null level to use the normal console sender. * Use a null level to use the normal console sender.
* *
* @author Gunging * @author Gunging
*/ */
public static void print(@Nullable Level level, @Nullable String message, @Nullable String prefix, @NotNull String... replaces) { public static void print(@Nullable Level level, @Nullable String message, @Nullable String prefix, @NotNull String... replaces) {
if (message == null) { message = "< null >"; } if (message == null) {
if (level != null) { MMOItems.plugin.getLogger().log(level, FriendlyFeedbackProvider.quickForConsole(FFPMMOItems.get(), message, replaces)); message = "< null >";
}
if (level != null) {
MMOItems.plugin.getLogger().log(level, FriendlyFeedbackProvider.quickForConsole(FFPMMOItems.get(), message, replaces));
} else { } else {
FriendlyFeedbackMessage p = new FriendlyFeedbackMessage("", prefix); FriendlyFeedbackMessage p = new FriendlyFeedbackMessage("", prefix);
FriendlyFeedbackMessage r = FriendlyFeedbackProvider.generateMessage(p, message, replaces); FriendlyFeedbackMessage r = FriendlyFeedbackProvider.generateMessage(p, message, replaces);
getConsole().sendMessage(r.forConsole(FFPMMOItems.get())); } getConsole().sendMessage(r.forConsole(FFPMMOItems.get()));
}
} }
/** /**
@ -781,7 +900,10 @@ public class MMOItems extends LuminePlugin {
* *
* @author Gunging * @author Gunging
*/ */
@NotNull public static ConsoleCommandSender getConsole() { return plugin.getServer().getConsoleSender(); } @NotNull
public static ConsoleCommandSender getConsole() {
return plugin.getServer().getConsoleSender();
}
/** /**
* @param item The item stack you are testing. * @param item The item stack you are testing.
@ -791,7 +913,9 @@ public class MMOItems extends LuminePlugin {
* @return If the given item is the desired MMOItem * @return If the given item is the desired MMOItem
*/ */
public static boolean isMMOItem(@Nullable ItemStack item, @NotNull String type, @NotNull String id) { public static boolean isMMOItem(@Nullable ItemStack item, @NotNull String type, @NotNull String id) {
if (item == null) { return false; } if (item == null) {
return false;
}
// Make it into an NBT Item // Make it into an NBT Item
NBTItem asNBT = NBTItem.get(item); NBTItem asNBT = NBTItem.get(item);
@ -800,13 +924,17 @@ public class MMOItems extends LuminePlugin {
String itemID = MMOItems.plugin.getID(asNBT); String itemID = MMOItems.plugin.getID(asNBT);
// Not a MMOItem // Not a MMOItem
if (itemID == null) { return false; } if (itemID == null) {
return false;
}
// ID matches? // ID matches?
if (!itemID.equals(id)) { return false; } if (!itemID.equals(id)) {
return false;
}
// If the type matches too, we are set. // If the type matches too, we are set.
return asNBT.getType().equals(type); return asNBT.getType().equals(type);
} }
//endregion // endregion
} }

View File

@ -1,5 +1,24 @@
package net.Indyuce.mmoitems.stat; package net.Indyuce.mmoitems.stat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import org.apache.commons.lang.Validate;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import io.lumine.mythic.lib.api.item.ItemTag; import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.item.SupportedNBTTagValues; import io.lumine.mythic.lib.api.item.SupportedNBTTagValues;
import io.lumine.mythic.lib.api.util.AltChar; import io.lumine.mythic.lib.api.util.AltChar;
@ -8,6 +27,7 @@ import io.lumine.mythic.lib.api.util.ui.FriendlyFeedbackProvider;
import io.lumine.mythic.lib.api.util.ui.PlusMinusPercent; import io.lumine.mythic.lib.api.util.ui.PlusMinusPercent;
import io.lumine.mythic.lib.api.util.ui.SilentNumbers; import io.lumine.mythic.lib.api.util.ui.SilentNumbers;
import io.lumine.mythicenchants.MythicEnchants; import io.lumine.mythicenchants.MythicEnchants;
import io.lumine.utils.plugin.LuminePlugin;
import net.Indyuce.mmoitems.ItemStats; import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems; import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.MMOUtils; import net.Indyuce.mmoitems.MMOUtils;
@ -26,23 +46,6 @@ import net.Indyuce.mmoitems.stat.data.type.UpgradeInfo;
import net.Indyuce.mmoitems.stat.type.ItemStat; import net.Indyuce.mmoitems.stat.type.ItemStat;
import net.Indyuce.mmoitems.stat.type.StatHistory; import net.Indyuce.mmoitems.stat.type.StatHistory;
import net.Indyuce.mmoitems.stat.type.Upgradable; import net.Indyuce.mmoitems.stat.type.Upgradable;
import org.apache.commons.lang.Validate;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Optional;
import java.util.Set;
public class Enchants extends ItemStat implements Upgradable { public class Enchants extends ItemStat implements Upgradable {
public Enchants() { public Enchants() {
@ -425,7 +428,8 @@ public class Enchants extends ItemStat implements Upgradable {
if (enchant == null) { if (enchant == null) {
if (MMOItems.plugin.getMythicEnchantsSupport() != null) { if (MMOItems.plugin.getMythicEnchantsSupport() != null) {
enchant = Enchantment.getByKey(new NamespacedKey(MythicEnchants.inst(), key)); LuminePlugin enchants = MythicEnchants.inst();
enchant = Enchantment.getByKey(new NamespacedKey((Plugin) MythicEnchants.inst(), key));
if (enchant != null) if (enchant != null)
return enchant; return enchant;
} }