3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-19 13:00:06 +01:00

Readd diff missed in the 1.7 update.

Dieser Commit ist enthalten in:
Travis Watkins 2014-02-10 15:38:52 -06:00
Ursprung 826643c606
Commit 393ece9ec5

Datei anzeigen

@ -836,9 +836,29 @@ public class PlayerConnection implements PacketPlayInListener {
// CraftBukkit start - replaced with thread safe throttle // CraftBukkit start - replaced with thread safe throttle
// this.chatThrottle += 20; // this.chatThrottle += 20;
if (chatSpamField.addAndGet(this, 20) > 200 && !this.minecraftServer.getPlayerList().isOp(this.player.getName())) { 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"); this.disconnect("disconnect.spam");
} }
// CraftBukkit end
}
} }
} }
@ -1645,7 +1665,7 @@ public class PlayerConnection implements PacketPlayInListener {
CraftEventFactory.handleEditBookEvent(player, itemstack); // CraftBukkit CraftEventFactory.handleEditBookEvent(player, itemstack); // CraftBukkit
} }
// CraftBukkit start // CraftBukkit start
} catch (Exception exception) { } catch (Throwable exception) {
c.error("Couldn\'t handle book info", exception); c.error("Couldn\'t handle book info", exception);
this.disconnect("Invalid book data!"); this.disconnect("Invalid book data!");
// CraftBukkit end // CraftBukkit end
@ -1662,7 +1682,7 @@ public class PlayerConnection implements PacketPlayInListener {
CraftEventFactory.handleEditBookEvent(player, itemstack); // CraftBukkit CraftEventFactory.handleEditBookEvent(player, itemstack); // CraftBukkit
} }
// CraftBukkit start // CraftBukkit start
} catch (Exception exception1) { } catch (Throwable exception1) {
c.error("Couldn\'t sign book", exception1); c.error("Couldn\'t sign book", exception1);
this.disconnect("Invalid book data!"); this.disconnect("Invalid book data!");
// CraftBukkit end // CraftBukkit end
@ -1680,8 +1700,8 @@ public class PlayerConnection implements PacketPlayInListener {
if (container instanceof ContainerMerchant) { if (container instanceof ContainerMerchant) {
((ContainerMerchant) container).e(i); ((ContainerMerchant) container).e(i);
} }
} catch (Exception exception2) {
// CraftBukkit start // CraftBukkit start
} catch (Throwable exception2) {
c.error("Couldn\'t select trade", exception2); c.error("Couldn\'t select trade", exception2);
this.disconnect("Invalid trade data!"); this.disconnect("Invalid trade data!");
// CraftBukkit end // CraftBukkit end
@ -1716,8 +1736,8 @@ public class PlayerConnection implements PacketPlayInListener {
commandblocklistenerabstract.e(); commandblocklistenerabstract.e();
this.player.sendMessage(new ChatMessage("advMode.setCommand.success", new Object[] { s})); this.player.sendMessage(new ChatMessage("advMode.setCommand.success", new Object[] { s}));
} }
} catch (Exception exception3) {
// CraftBukkit start // CraftBukkit start
} catch (Throwable exception3) {
c.error("Couldn\'t set command block", exception3); c.error("Couldn\'t set command block", exception3);
this.disconnect("Invalid CommandBlock data!"); this.disconnect("Invalid CommandBlock data!");
// CraftBukkit end // CraftBukkit end
@ -1742,8 +1762,8 @@ public class PlayerConnection implements PacketPlayInListener {
tileentitybeacon.e(j); tileentitybeacon.e(j);
tileentitybeacon.update(); tileentitybeacon.update();
} }
} catch (Exception exception4) {
// CraftBukkit start // CraftBukkit start
} catch (Throwable exception4) {
c.error("Couldn\'t set beacon", exception4); c.error("Couldn\'t set beacon", exception4);
this.disconnect("Invalid beacon data!"); this.disconnect("Invalid beacon data!");
// CraftBukkit end // CraftBukkit end