Archiviert
13
0

Fix a few errors with injection

Dieser Commit ist enthalten in:
Dan Mulloy 2015-01-01 13:53:46 -05:00
Ursprung 79da4f92a1
Commit a748a95197

Datei anzeigen

@ -600,7 +600,7 @@ class ChannelInjector extends ByteToMessageDecoder implements Injector {
*/ */
private void disconnect(String message) { private void disconnect(String message) {
// If we're logging in, we can only close the channel // If we're logging in, we can only close the channel
if (playerConnection == null || player instanceof Factory) { if (playerConnection == null || player.get() instanceof Factory) {
originalChannel.disconnect(); originalChannel.disconnect();
} else { } else {
// Call the disconnect method // Call the disconnect method
@ -632,7 +632,7 @@ class ChannelInjector extends ByteToMessageDecoder implements Injector {
private void invokeSendPacket(Object packet) { private void invokeSendPacket(Object packet) {
// Attempt to send the packet with NetworkMarker.handle(), or the PlayerConnection if its active // Attempt to send the packet with NetworkMarker.handle(), or the PlayerConnection if its active
try { try {
if (player instanceof Factory) { if (player.get() instanceof Factory) {
MinecraftMethods.getNetworkManagerHandleMethod().invoke(networkManager, packet, new GenericFutureListener[0]); MinecraftMethods.getNetworkManagerHandleMethod().invoke(networkManager, packet, new GenericFutureListener[0]);
} else { } else {
MinecraftMethods.getSendPacketMethod().invoke(getPlayerConnection(), packet); MinecraftMethods.getSendPacketMethod().invoke(getPlayerConnection(), packet);