1
0
mirror of https://e.coding.net/circlecloud/YumCore.git synced 2024-11-22 01:48:50 +00:00

feat: 拦截类初始化报错

Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
502647092 2016-09-07 21:29:42 +08:00
parent 2da2ee24ac
commit 8251b2f5d4

View File

@ -52,7 +52,7 @@ public class C {
getHandle = typeCraftPlayer.getMethod("getHandle"); getHandle = typeCraftPlayer.getMethod("getHandle");
playerConnection = typeNMSPlayer.getField("playerConnection"); playerConnection = typeNMSPlayer.getField("playerConnection");
sendPacket = typePlayerConnection.getMethod("sendPacket", Class.forName(a("Packet"))); sendPacket = typePlayerConnection.getMethod("sendPacket", Class.forName(a("Packet")));
} catch (final Exception e) { } catch (final Throwable e) {
Log.warning(C.class.getSimpleName() + " 兼容性工具初始化失败 可能造成部分功能不可用!"); Log.warning(C.class.getSimpleName() + " 兼容性工具初始化失败 可能造成部分功能不可用!");
e.printStackTrace(); e.printStackTrace();
} }
@ -144,7 +144,8 @@ public class C {
} while (time > 0); } while (time > 0);
} }
}).start();; }).start();
;
} }
/** /**
@ -337,7 +338,11 @@ public class C {
Object packet = null; Object packet = null;
// Send if set // Send if set
if ((fadeInTime != -1) && (fadeOutTime != -1) && (stayTime != -1)) { if ((fadeInTime != -1) && (fadeOutTime != -1) && (stayTime != -1)) {
packet = packetTitle.getConstructor(packetActions, nmsIChatBaseComponent, Integer.TYPE, Integer.TYPE, Integer.TYPE).newInstance(actions[2], null, fadeInTime * 20, stayTime * 20, fadeOutTime * 20); packet = packetTitle.getConstructor(packetActions, nmsIChatBaseComponent, Integer.TYPE, Integer.TYPE, Integer.TYPE).newInstance(actions[2],
null,
fadeInTime * 20,
stayTime * 20,
fadeOutTime * 20);
sendPacket.invoke(connection, packet); sendPacket.invoke(connection, packet);
} }
// Send title // Send title