Find the correct send packet method.
Dieser Commit ist enthalten in:
Ursprung
7afc930592
Commit
f5e519eada
@ -43,8 +43,15 @@ public class MinecraftMethods {
|
|||||||
Class<?> serverHandlerClass = MinecraftReflection.getNetServerHandlerClass();
|
Class<?> serverHandlerClass = MinecraftReflection.getNetServerHandlerClass();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
sendPacketMethod = FuzzyReflection.fromObject(serverHandlerClass).getMethodByName("sendPacket.*");
|
sendPacketMethod = FuzzyReflection.fromClass(serverHandlerClass).getMethodByName("sendPacket.*");
|
||||||
} catch (IllegalArgumentException e) {
|
} 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(
|
Map<String, Method> netServer = getMethodList(
|
||||||
serverHandlerClass, MinecraftReflection.getPacketClass());
|
serverHandlerClass, MinecraftReflection.getPacketClass());
|
||||||
Map<String, Method> netHandler = getMethodList(
|
Map<String, Method> netHandler = getMethodList(
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren