From 7ad364917f0cd1712c9d59c470ce33b08c894b9e Mon Sep 17 00:00:00 2001 From: wizjany Date: Thu, 14 Feb 2019 18:07:07 -0500 Subject: [PATCH] Ignore synthetic classes when loading BukkitImplAdapter. (cherry picked from commit 319f2efe43946efd5affd4535ca2cb98604ac9af) --- .../com/sk89q/worldedit/bukkit/adapter/BukkitImplLoader.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplLoader.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplLoader.java index 9d65cf46b..db82a2abb 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplLoader.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplLoader.java @@ -93,7 +93,7 @@ public class BukkitImplLoader { try { Enumeration entries = jar.entries(); while (entries.hasMoreElements()) { - JarEntry jarEntry = (JarEntry) entries.nextElement(); + JarEntry jarEntry = entries.nextElement(); String className = jarEntry.getName().replaceAll("[/\\\\]+", "."); @@ -157,6 +157,7 @@ public class BukkitImplLoader { for (String className : adapterCandidates) { try { Class cls = Class.forName(className); + if (cls.isSynthetic()) continue; if (BukkitImplAdapter.class.isAssignableFrom(cls)) { return (BukkitImplAdapter) cls.newInstance(); } else {