Fixed a bug where version below 1.16 would fail to load

This commit is contained in:
ASangarin 2020-09-24 01:32:29 +02:00
parent fd93308ea3
commit f4a20057d0
2 changed files with 305 additions and 297 deletions

580
pom.xml
View File

@ -1,297 +1,297 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.Indyuce</groupId>
<artifactId>MMOItems</artifactId>
<version>6.2.0</version>
<name>MMOItems</name>
<description>A great item solution for your RPG server.</description>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.Indyuce</groupId>
<artifactId>MMOItems</artifactId>
<version>6.2.1</version>
<name>MMOItems</name>
<description>A great item solution for your RPG server.</description>
<properties>
<downloadSources>false</downloadSources>
<downloadJavadocs>false</downloadJavadocs>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<properties>
<downloadSources>false</downloadSources>
<downloadJavadocs>false</downloadJavadocs>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<distributionManagement>
<repository>
<id>nexus</id>
<name>Lumine Releases</name>
<url>http://mvn.lumine.io/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>nexus</id>
<name>Lumine Snapshots</name>
<url>http://mvn.lumine.io/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
<distributionManagement>
<repository>
<id>nexus</id>
<name>Lumine Releases</name>
<url>http://mvn.lumine.io/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>nexus</id>
<name>Lumine Snapshots</name>
<url>http://mvn.lumine.io/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
<build>
<finalName>${project.name}-${project.version}</finalName>
<resources>
<resource>
<filtering>true</filtering>
<directory>${basedir}/src/main/resources/</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<junitArtifactName>junit:junit</junitArtifactName>
<encoding>UTF-8</encoding>
<inputEncoding>UTF-8</inputEncoding>
<outputEncoding>UTF-8</outputEncoding>
<argLine>-ea -Dfile.encoding=UTF-8</argLine>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>mojang</id>
<url>https://libraries.minecraft.net/</url>
</repository>
<repository>
<id>sk89q-repo</id>
<url>https://maven.enginehub.org/repo/</url>
</repository>
<repository>
<id>inventive-repo</id>
<url>https://repo.inventivetalent.org/content/groups/public/</url>
</repository>
<repository>
<id>placeholderapi</id>
<url>http://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
</repositories>
<dependencies>
<build>
<finalName>${project.name}-${project.version}</finalName>
<resources>
<resource>
<filtering>true</filtering>
<directory>${basedir}/src/main/resources/</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<junitArtifactName>junit:junit</junitArtifactName>
<encoding>UTF-8</encoding>
<inputEncoding>UTF-8</inputEncoding>
<outputEncoding>UTF-8</outputEncoding>
<argLine>-ea -Dfile.encoding=UTF-8</argLine>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>mojang</id>
<url>https://libraries.minecraft.net/</url>
</repository>
<repository>
<id>sk89q-repo</id>
<url>https://maven.enginehub.org/repo/</url>
</repository>
<repository>
<id>inventive-repo</id>
<url>https://repo.inventivetalent.org/content/groups/public/</url>
</repository>
<repository>
<id>placeholderapi</id>
<url>http://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
</repositories>
<dependencies>
<!-- MMOs -->
<dependency>
<groupId>net.Indyuce</groupId>
<artifactId>MMOLib</artifactId>
<version>1.3</version>
<scope>system</scope>
<systemPath>${basedir}/lib/MMOLib.jar</systemPath>
</dependency>
<dependency>
<groupId>net.Indyuce</groupId>
<artifactId>mmocore</artifactId>
<version>1.4.2</version>
<scope>system</scope>
<systemPath>${basedir}/lib/MMOCore.jar</systemPath>
</dependency>
<!-- MMOs -->
<dependency>
<groupId>net.Indyuce</groupId>
<artifactId>MMOLib</artifactId>
<version>1.3</version>
<scope>system</scope>
<systemPath>${basedir}/lib/MMOLib.jar</systemPath>
</dependency>
<dependency>
<groupId>net.Indyuce</groupId>
<artifactId>mmocore</artifactId>
<version>1.4.2</version>
<scope>system</scope>
<systemPath>${basedir}/lib/MMOCore.jar</systemPath>
</dependency>
<!-- Minecraft -->
<dependency>
<groupId>com.mojang</groupId>
<artifactId>authlib</artifactId>
<version>1.5.21</version>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.12-R1-1.16-R2</version>
<scope>system</scope>
<systemPath>${basedir}/lib/spigot.jar</systemPath>
</dependency>
<!-- APIs -->
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>19.0.0</version>
</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>
<!-- Other Plugins -->
<dependency>
<groupId>com.github.Eniripsa96</groupId>
<artifactId>SkillAPI</artifactId>
<version>master-SNAPSHOT</version>
<scope>system</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>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>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>
<groupId>io.lumine.xikage</groupId>
<artifactId>MythicMobs</artifactId>
<version>4.8.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/MythicMobs.jar</systemPath>
</dependency>
<dependency>
<groupId>de.tobiyas</groupId>
<artifactId>RacesAndClasses</artifactId>
<version>1.2.6</version>
<scope>system</scope>
<systemPath>${basedir}/lib/RacesAndClasses.jar</systemPath>
</dependency>
<dependency>
<groupId>ru.endlesscode</groupId>
<artifactId>rpginventory</artifactId>
<version>2.3.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/RPGInventory.jar</systemPath>
</dependency>
<dependency>
<groupId>com.sainttx.holograms</groupId>
<artifactId>holograms</artifactId>
<version>2.9.1</version>
<scope>system</scope>
<systemPath>${basedir}/lib/Holograms.jar</systemPath>
</dependency>
<dependency>
<groupId>net.milkbowl</groupId>
<artifactId>vault</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>
<scope>system</scope>
<systemPath>${basedir}/lib/WorldEdit.jar</systemPath>
</dependency>
<dependency>
<groupId>net.citizensnpcs</groupId>
<artifactId>citizens</artifactId>
<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>
</dependencies>
<!-- Minecraft -->
<dependency>
<groupId>com.mojang</groupId>
<artifactId>authlib</artifactId>
<version>1.5.21</version>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.12-R1-1.16-R2</version>
<scope>system</scope>
<systemPath>${basedir}/lib/spigot.jar</systemPath>
</dependency>
<!-- APIs -->
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>19.0.0</version>
</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>
<!-- Other Plugins -->
<dependency>
<groupId>com.github.Eniripsa96</groupId>
<artifactId>SkillAPI</artifactId>
<version>master-SNAPSHOT</version>
<scope>system</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>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>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>
<groupId>io.lumine.xikage</groupId>
<artifactId>MythicMobs</artifactId>
<version>4.8.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/MythicMobs.jar</systemPath>
</dependency>
<dependency>
<groupId>de.tobiyas</groupId>
<artifactId>RacesAndClasses</artifactId>
<version>1.2.6</version>
<scope>system</scope>
<systemPath>${basedir}/lib/RacesAndClasses.jar</systemPath>
</dependency>
<dependency>
<groupId>ru.endlesscode</groupId>
<artifactId>rpginventory</artifactId>
<version>2.3.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/RPGInventory.jar</systemPath>
</dependency>
<dependency>
<groupId>com.sainttx.holograms</groupId>
<artifactId>holograms</artifactId>
<version>2.9.1</version>
<scope>system</scope>
<systemPath>${basedir}/lib/Holograms.jar</systemPath>
</dependency>
<dependency>
<groupId>net.milkbowl</groupId>
<artifactId>vault</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>
<scope>system</scope>
<systemPath>${basedir}/lib/WorldEdit.jar</systemPath>
</dependency>
<dependency>
<groupId>net.citizensnpcs</groupId>
<artifactId>citizens</artifactId>
<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>
</dependencies>
</project>

View File

@ -5,6 +5,7 @@ import org.bukkit.NamespacedKey;
import org.bukkit.entity.Player;
import net.Indyuce.mmoitems.MMOItems;
import net.mmogroup.mmolib.MMOLib;
public class RecipeBookUtil {
private static boolean amounts = false;
@ -25,15 +26,22 @@ public class RecipeBookUtil {
public static void refresh(Player player) {
if(!enabled) return;
for (NamespacedKey key : player.getDiscoveredRecipes())
if (key.getNamespace().equals("mmoitems")
&& !MMOItems.plugin.getRecipes().getNamespacedKeys().contains(key))
player.undiscoverRecipe(key);
if (MMOLib.plugin.getVersion().isStrictlyHigher(1, 16)) {
for (NamespacedKey key : player.getDiscoveredRecipes())
if (key.getNamespace().equals("mmoitems")
&& !MMOItems.plugin.getRecipes().getNamespacedKeys().contains(key))
player.undiscoverRecipe(key);
for (NamespacedKey recipe : MMOItems.plugin.getRecipes().getNamespacedKeys())
if (!player.hasDiscoveredRecipe(recipe))
player.discoverRecipe(recipe);
return;
}
for (NamespacedKey recipe : MMOItems.plugin.getRecipes().getNamespacedKeys())
if (!player.hasDiscoveredRecipe(recipe))
player.discoverRecipe(recipe);
player.discoverRecipe(recipe);
}
public static void refreshOnline() {