File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
modules/API/src/main/java/com/comphenix/protocol/utility Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 16
16
import com .comphenix .protocol .PacketType ;
17
17
import com .comphenix .protocol .events .PacketContainer ;
18
18
import com .comphenix .protocol .reflect .FuzzyReflection ;
19
+ import com .comphenix .protocol .reflect .fuzzy .FuzzyMethodContract ;
19
20
20
21
/**
21
22
* Static methods for accessing Minecraft methods.
@@ -43,7 +44,13 @@ public static Method getSendPacketMethod() {
43
44
Class <?> serverHandlerClass = MinecraftReflection .getPlayerConnectionClass ();
44
45
45
46
try {
46
- sendPacketMethod = FuzzyReflection .fromClass (serverHandlerClass ).getMethodByName ("sendPacket.*" );
47
+ sendPacketMethod = FuzzyReflection
48
+ .fromClass (serverHandlerClass )
49
+ .getMethod (FuzzyMethodContract .newBuilder ()
50
+ .nameRegex ("sendPacket.*" )
51
+ .returnTypeVoid ()
52
+ .parameterCount (1 )
53
+ .build ());
47
54
} catch (IllegalArgumentException e ) {
48
55
// We can't use the method below on Netty
49
56
if (MinecraftReflection .isUsingNetty ()) {
You can’t perform that action at this time.
0 commit comments