Remove Apache Commons

This commit is contained in:
BuildTools 2019-03-01 16:54:51 -05:00
parent af7e00ceec
commit 94252df8cf
2 changed files with 6 additions and 11 deletions

View File

@ -13,13 +13,13 @@
package me.blackvein.quests.util;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.LinkedHashMap;
import java.util.Map;
import me.blackvein.quests.Quester;
import me.blackvein.quests.Quests;
import org.apache.commons.lang3.reflect.MethodUtils;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
@ -190,10 +190,13 @@ public class LocaleQuery {
*/
public String queryByType(Material material) throws IllegalArgumentException{
try {
Object item = MethodUtils.invokeExactStaticMethod(craftMagicNumbers,"getItem", material);
Object item = null;
Method m = craftMagicNumbers.getDeclaredMethod("getItem", material.getClass());
m.setAccessible(true);
item = m.invoke(craftMagicNumbers, material);
if (item == null) {
throw new IllegalArgumentException(material.name() + " material could not be queried!");
}
}
String name = (String) itemClazz.getMethod("getName").invoke(item);
return name;
} catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) {

View File

@ -28,14 +28,6 @@
<module>dist</module>
</modules>
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.8.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>dre-repo</id>