mirror of
https://e.coding.net/circlecloud/YumCore.git
synced 2024-11-21 01:38:51 +00:00
feat: compatible 1.18
Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
parent
834f3d7d58
commit
1d1303b31c
2
pom.xml
2
pom.xml
@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>pw.yumc</groupId>
|
||||
<artifactId>YumCore</artifactId>
|
||||
<version>1.9.2</version>
|
||||
<version>1.9.3</version>
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
|
@ -78,9 +78,13 @@ public class C {
|
||||
Class<?> typePlayerConnection = subVersion < 17 ? Class.forName(a("PlayerConnection")) : Class.forName("net.minecraft.server.network.PlayerConnection");
|
||||
getHandle = typeCraftPlayer.getMethod("getHandle");
|
||||
playerConnection = subVersion < 17 ? typeNMSPlayer.getField("playerConnection") : typeNMSPlayer.getField("b");
|
||||
sendPacket = typePlayerConnection.getMethod("sendPacket", subVersion < 17 ?
|
||||
Class.forName(a("Packet")) :
|
||||
Class.forName("net.minecraft.network.protocol.Packet"));
|
||||
if (subVersion < 17) {
|
||||
sendPacket = typePlayerConnection.getMethod("sendPacket", Class.forName(a("Packet")));
|
||||
} else if (subVersion == 17) {
|
||||
sendPacket = typePlayerConnection.getMethod("sendPacket", Class.forName("net.minecraft.network.protocol.Packet"));
|
||||
} else {
|
||||
sendPacket = typePlayerConnection.getMethod("a", Class.forName("net.minecraft.network.protocol.Packet"));
|
||||
}
|
||||
init = true;
|
||||
} catch (Exception e) {
|
||||
Log.w("C 兼容性工具初始化失败 可能造成部分功能不可用!");
|
||||
|
Loading…
Reference in New Issue
Block a user