Archiviert
13
0

Added a small patch for Libigot.

Dieser Commit ist enthalten in:
Kristian S. Stangeland 2013-03-21 02:10:30 +01:00
Ursprung 310fd18e89
Commit d643690eef

Datei anzeigen

@ -129,6 +129,9 @@ public class MinecraftReflection {
Class<?> craftClass = craftServer.getClass(); Class<?> craftClass = craftServer.getClass();
CRAFTBUKKIT_PACKAGE = getPackage(craftClass.getCanonicalName()); CRAFTBUKKIT_PACKAGE = getPackage(craftClass.getCanonicalName());
// Libigot patch
handleLibigot();
// Next, do the same for CraftEntity.getHandle() in order to get the correct Minecraft package // Next, do the same for CraftEntity.getHandle() in order to get the correct Minecraft package
Class<?> craftEntity = getCraftEntityClass(); Class<?> craftEntity = getCraftEntityClass();
Method getHandle = craftEntity.getMethod("getHandle"); Method getHandle = craftEntity.getMethod("getHandle");
@ -166,6 +169,20 @@ public class MinecraftReflection {
} }
} }
// 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. * Used during debugging and testing.
* @param minecraftPackage - the current Minecraft package. * @param minecraftPackage - the current Minecraft package.