mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-11-28 05:35:28 +01:00
Added a small patch for Libigot.
This commit is contained in:
parent
310fd18e89
commit
d643690eef
@ -129,6 +129,9 @@ public class MinecraftReflection {
|
||||
Class<?> craftClass = craftServer.getClass();
|
||||
CRAFTBUKKIT_PACKAGE = getPackage(craftClass.getCanonicalName());
|
||||
|
||||
// Libigot patch
|
||||
handleLibigot();
|
||||
|
||||
// Next, do the same for CraftEntity.getHandle() in order to get the correct Minecraft package
|
||||
Class<?> craftEntity = getCraftEntityClass();
|
||||
Method getHandle = craftEntity.getMethod("getHandle");
|
||||
@ -165,6 +168,20 @@ public class MinecraftReflection {
|
||||
throw new IllegalStateException("Could not find Bukkit. Is it running?");
|
||||
}
|
||||
}
|
||||
|
||||
// Patch for Libigot
|
||||
private static void handleLibigot() {
|
||||
try {
|
||||
getCraftEntityClass();
|
||||
} catch (RuntimeException e) {
|
||||
// Try reverting the package to the old format
|
||||
craftbukkitPackage = null;
|
||||
CRAFTBUKKIT_PACKAGE = "org.bukkit.craftbukkit";
|
||||
|
||||
// This might fail too
|
||||
getCraftEntityClass();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Used during debugging and testing.
|
||||
|
Loading…
Reference in New Issue
Block a user