Fix PS support

Fixes #1825
This commit is contained in:
KennyTV 2020-06-25 12:39:49 +02:00
parent 6761489ebf
commit d86ac64ac9
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B

View File

@ -17,6 +17,7 @@ import us.myles.ViaVersion.bukkit.util.NMSUtil;
import java.lang.reflect.Method;
//TODO maybe clean this up a bit 👀
public class ClassGenerator {
private static HandlerConstructor constructor = new BasicHandlerConstructor();
private static String psPackage;
@ -30,6 +31,7 @@ public class ClassGenerator {
if (ViaVersionPlugin.getInstance().isCompatSpigotBuild() || ViaVersionPlugin.getInstance().isProtocolSupport()) {
try {
ClassPool pool = ClassPool.getDefault();
pool.insertClassPath(new LoaderClassPath(Bukkit.class.getClassLoader()));
for (Plugin p : Bukkit.getPluginManager().getPlugins()) {
pool.insertClassPath(new LoaderClassPath(p.getClass().getClassLoader()));
}