1
0
mirror of https://e.coding.net/circlecloud/YumCore.git synced 2024-11-24 02:08:48 +00:00

全版本兼容”

This commit is contained in:
xjboss 2019-03-12 16:31:27 +00:00
parent 4f8b43bdb9
commit e26d5490be

View File

@ -55,9 +55,7 @@ public class C {
version=getNMSVersion();
titlePAB=false;
try {
try {
cauldron1710 = version.equals("v1_7_R4") && Package.getPackage("net.minecraftforge.cauldron") != null;
}catch (Exception e){}
cauldron1710 = version.equals("v1_7_R4") && Package.getPackage("net.minecraftforge.cauldron") != null;
if(cauldron1710) {
try{
Class.forName("cc.uraniummc.Uranium");
@ -79,7 +77,7 @@ public class C {
packetType = Class.forName(a("PacketPlayOutChat"));
}
Arrays.stream(packetType.getConstructors()).forEach(c -> {
if (c.getParameterTypes().length == 2) {
if (c.getParameterTypes().length == 2&&!c.getParameterTypes()[1].getName().equals("boolean")) {
packetTypeConstructor = c;
}
});
@ -97,7 +95,11 @@ public class C {
nmsChatMessageTypeClassValueOf = nmsChatMessageTypeClass.getDeclaredMethod("valueOf", String.class);
}
} catch (Exception e) {
packetTypeConstructor = packetType.getConstructor(String.class);
try {
packetTypeConstructor = packetType.getConstructor(String.class);
}catch (Exception e2){
packetTypeConstructor = packetType.getConstructor(nmsIChatBaseComponent);
}
}
Class<?> typeCraftPlayer = Class.forName(b("entity.CraftPlayer"));
getHandle = typeCraftPlayer.getMethod("getHandle");