mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2025-01-24 09:11:27 +01:00
Fix a few errors with injection
This commit is contained in:
parent
79da4f92a1
commit
a748a95197
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user