mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-27 11:38:03 +01:00
Fix packet listeners not being called if there is no default listener
This commit is contained in:
parent
3a7ae11c56
commit
852391f210
@ -71,8 +71,7 @@ public final class PacketListenerManager {
|
||||
|
||||
// Listener can be null if none has been set before, call PacketConsumer anyway
|
||||
if (packetListenerConsumer == null) {
|
||||
LOGGER.error("Packet " + clazz + " does not have any default listener! (The issue comes from Minestom)");
|
||||
return;
|
||||
LOGGER.warn("Packet " + clazz + " does not have any default listener! (The issue comes from Minestom)");
|
||||
}
|
||||
|
||||
final PacketController packetController = new PacketController();
|
||||
@ -84,7 +83,9 @@ public final class PacketListenerManager {
|
||||
return;
|
||||
|
||||
// Finally execute the listener
|
||||
packetListenerConsumer.accept(packet, player);
|
||||
if (packetListenerConsumer != null) {
|
||||
packetListenerConsumer.accept(packet, player);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user