Update from upstream SpigotMC
Don't use Bukkit.getLogger as the CraftServer isn't loaded at this point SpigotMC/Spigot@5c48793ecf Modify the block placement limit to allow for the odd random packet or two SpigotMC/Spigot@7768676ae2
This commit is contained in:
@@ -14,14 +14,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
+ // Spigot start - limit place/interactions
|
||||
+ private long lastPlace = -1;
|
||||
+ private int packets = 0;
|
||||
+
|
||||
public void a(PacketPlayInBlockPlace packetplayinblockplace) {
|
||||
+ boolean throttled = false;
|
||||
+ if (lastPlace != -1 && packetplayinblockplace.timestamp - lastPlace < 5) {
|
||||
+ if (lastPlace != -1 && packetplayinblockplace.timestamp - lastPlace < 30 && packets++ >= 4) {
|
||||
+ throttled = true;
|
||||
+ } else
|
||||
+ } else if ( packetplayinblockplace.timestamp - lastPlace >= 30 || lastPlace == -1 )
|
||||
+ {
|
||||
+ lastPlace = packetplayinblockplace.timestamp;
|
||||
+ packets = 0;
|
||||
+ }
|
||||
+ // Spigot end
|
||||
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
|
||||
|
||||
Reference in New Issue
Block a user