mirror of
https://e.coding.net/circlecloud/YumCore.git
synced 2024-11-24 02:08:48 +00:00
全版本兼容”
This commit is contained in:
parent
4f8b43bdb9
commit
e26d5490be
@ -55,9 +55,7 @@ public class C {
|
|||||||
version=getNMSVersion();
|
version=getNMSVersion();
|
||||||
titlePAB=false;
|
titlePAB=false;
|
||||||
try {
|
try {
|
||||||
try {
|
cauldron1710 = version.equals("v1_7_R4") && Package.getPackage("net.minecraftforge.cauldron") != null;
|
||||||
cauldron1710 = version.equals("v1_7_R4") && Package.getPackage("net.minecraftforge.cauldron") != null;
|
|
||||||
}catch (Exception e){}
|
|
||||||
if(cauldron1710) {
|
if(cauldron1710) {
|
||||||
try{
|
try{
|
||||||
Class.forName("cc.uraniummc.Uranium");
|
Class.forName("cc.uraniummc.Uranium");
|
||||||
@ -79,7 +77,7 @@ public class C {
|
|||||||
packetType = Class.forName(a("PacketPlayOutChat"));
|
packetType = Class.forName(a("PacketPlayOutChat"));
|
||||||
}
|
}
|
||||||
Arrays.stream(packetType.getConstructors()).forEach(c -> {
|
Arrays.stream(packetType.getConstructors()).forEach(c -> {
|
||||||
if (c.getParameterTypes().length == 2) {
|
if (c.getParameterTypes().length == 2&&!c.getParameterTypes()[1].getName().equals("boolean")) {
|
||||||
packetTypeConstructor = c;
|
packetTypeConstructor = c;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -97,7 +95,11 @@ public class C {
|
|||||||
nmsChatMessageTypeClassValueOf = nmsChatMessageTypeClass.getDeclaredMethod("valueOf", String.class);
|
nmsChatMessageTypeClassValueOf = nmsChatMessageTypeClass.getDeclaredMethod("valueOf", String.class);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} 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"));
|
Class<?> typeCraftPlayer = Class.forName(b("entity.CraftPlayer"));
|
||||||
getHandle = typeCraftPlayer.getMethod("getHandle");
|
getHandle = typeCraftPlayer.getMethod("getHandle");
|
||||||
|
Loading…
Reference in New Issue
Block a user