Ignore all canceled events

This commit is contained in:
games647
2016-07-03 21:28:44 +02:00
parent 2b16f3341f
commit bba4eb4eec
3 changed files with 12 additions and 0 deletions

View File

@ -51,6 +51,10 @@ public class EncryptionPacketListener extends PacketAdapter {
*/
@Override
public void onPacketReceiving(PacketEvent packetEvent) {
if (packetEvent.isCancelled()) {
return;
}
Player sender = packetEvent.getPlayer();
byte[] sharedSecret = packetEvent.getPacket().getByteArrays().read(0);

View File

@ -52,6 +52,10 @@ public class StartPacketListener extends PacketAdapter {
*/
@Override
public void onPacketReceiving(PacketEvent packetEvent) {
if (packetEvent.isCancelled()) {
return;
}
plugin.setServerStarted();
Player player = packetEvent.getPlayer();

View File

@ -49,6 +49,10 @@ public class PlayerConnectionListener implements Listener {
@EventHandler
public void onLogin(LoginEvent loginEvent) {
if (loginEvent.isCancelled()) {
return;
}
//use the loginevent instead of the postlogin event in order to send the loginsuccess packet to the client
//with the offline uuid this makes it possible to set the skin then