Archiviert
13
0

Find the correct send packet method.

Dieser Commit ist enthalten in:
Kristian S. Stangeland 2013-12-05 08:08:13 +01:00
Ursprung 7afc930592
Commit f5e519eada

Datei anzeigen

@ -41,10 +41,17 @@ public class MinecraftMethods {
public static Method getSendPacketMethod() {
if (sendPacketMethod == null) {
Class<?> serverHandlerClass = MinecraftReflection.getNetServerHandlerClass();
try {
sendPacketMethod = FuzzyReflection.fromObject(serverHandlerClass).getMethodByName("sendPacket.*");
sendPacketMethod = FuzzyReflection.fromClass(serverHandlerClass).getMethodByName("sendPacket.*");
} catch (IllegalArgumentException e) {
// We can't use the method below on Netty
if (MinecraftReflection.isUsingNetty()) {
sendPacketMethod = FuzzyReflection.fromClass(serverHandlerClass).
getMethodByParameters("sendPacket", MinecraftReflection.getPacketClass());
return sendPacketMethod;
}
Map<String, Method> netServer = getMethodList(
serverHandlerClass, MinecraftReflection.getPacketClass());
Map<String, Method> netHandler = getMethodList(