mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-30 04:02:50 +01:00
Readd diff missed in the 1.7 update.
This commit is contained in:
parent
826643c606
commit
393ece9ec5
1 changed files with 26 additions and 6 deletions
|
@ -836,9 +836,29 @@ public class PlayerConnection implements PacketPlayInListener {
|
|||
// CraftBukkit start - replaced with thread safe throttle
|
||||
// this.chatThrottle += 20;
|
||||
if (chatSpamField.addAndGet(this, 20) > 200 && !this.minecraftServer.getPlayerList().isOp(this.player.getName())) {
|
||||
// CraftBukkit end
|
||||
if (packetplayinchat.a()) {
|
||||
Waitable waitable = new Waitable() {
|
||||
@Override
|
||||
protected Object evaluate() {
|
||||
PlayerConnection.this.disconnect("disconnect.spam");
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
this.minecraftServer.processQueue.add(waitable);
|
||||
|
||||
try {
|
||||
waitable.get();
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
} catch (ExecutionException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
} else {
|
||||
this.disconnect("disconnect.spam");
|
||||
}
|
||||
// CraftBukkit end
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1645,7 +1665,7 @@ public class PlayerConnection implements PacketPlayInListener {
|
|||
CraftEventFactory.handleEditBookEvent(player, itemstack); // CraftBukkit
|
||||
}
|
||||
// CraftBukkit start
|
||||
} catch (Exception exception) {
|
||||
} catch (Throwable exception) {
|
||||
c.error("Couldn\'t handle book info", exception);
|
||||
this.disconnect("Invalid book data!");
|
||||
// CraftBukkit end
|
||||
|
@ -1662,7 +1682,7 @@ public class PlayerConnection implements PacketPlayInListener {
|
|||
CraftEventFactory.handleEditBookEvent(player, itemstack); // CraftBukkit
|
||||
}
|
||||
// CraftBukkit start
|
||||
} catch (Exception exception1) {
|
||||
} catch (Throwable exception1) {
|
||||
c.error("Couldn\'t sign book", exception1);
|
||||
this.disconnect("Invalid book data!");
|
||||
// CraftBukkit end
|
||||
|
@ -1680,8 +1700,8 @@ public class PlayerConnection implements PacketPlayInListener {
|
|||
if (container instanceof ContainerMerchant) {
|
||||
((ContainerMerchant) container).e(i);
|
||||
}
|
||||
} catch (Exception exception2) {
|
||||
// CraftBukkit start
|
||||
} catch (Throwable exception2) {
|
||||
c.error("Couldn\'t select trade", exception2);
|
||||
this.disconnect("Invalid trade data!");
|
||||
// CraftBukkit end
|
||||
|
@ -1716,8 +1736,8 @@ public class PlayerConnection implements PacketPlayInListener {
|
|||
commandblocklistenerabstract.e();
|
||||
this.player.sendMessage(new ChatMessage("advMode.setCommand.success", new Object[] { s}));
|
||||
}
|
||||
} catch (Exception exception3) {
|
||||
// CraftBukkit start
|
||||
} catch (Throwable exception3) {
|
||||
c.error("Couldn\'t set command block", exception3);
|
||||
this.disconnect("Invalid CommandBlock data!");
|
||||
// CraftBukkit end
|
||||
|
@ -1742,8 +1762,8 @@ public class PlayerConnection implements PacketPlayInListener {
|
|||
tileentitybeacon.e(j);
|
||||
tileentitybeacon.update();
|
||||
}
|
||||
} catch (Exception exception4) {
|
||||
// CraftBukkit start
|
||||
} catch (Throwable exception4) {
|
||||
c.error("Couldn\'t set beacon", exception4);
|
||||
this.disconnect("Invalid beacon data!");
|
||||
// CraftBukkit end
|
||||
|
|
Loading…
Reference in a new issue