mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 15:30:19 +01:00
Fixup AsyncTabCompletionEvent handling
This commit is contained in:
parent
a1e9cd39d2
commit
cd5da239f8
5 changed files with 51 additions and 49 deletions
|
@ -1,4 +1,4 @@
|
||||||
From d6b423ce8aea858a4e606fd70e440b302706c6f5 Mon Sep 17 00:00:00 2001
|
From 36595d8506ce4cb19d6e56d941f824b75bb190b7 Mon Sep 17 00:00:00 2001
|
||||||
From: Aikar <aikar@aikar.co>
|
From: Aikar <aikar@aikar.co>
|
||||||
Date: Sun, 26 Nov 2017 13:19:58 -0500
|
Date: Sun, 26 Nov 2017 13:19:58 -0500
|
||||||
Subject: [PATCH] AsyncTabCompleteEvent
|
Subject: [PATCH] AsyncTabCompleteEvent
|
||||||
|
@ -14,10 +14,18 @@ completion, such as offline players.
|
||||||
Also adds isCommand and getLocation to the sync TabCompleteEvent
|
Also adds isCommand and getLocation to the sync TabCompleteEvent
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||||
index e01013efd..74a665142 100644
|
index 89071db952..2ed59b4088 100644
|
||||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||||
@@ -2277,24 +2277,51 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
@@ -10,6 +10,7 @@ import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Iterator;
|
||||||
|
+import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
@@ -2277,24 +2278,45 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,41 +54,35 @@ index e01013efd..74a665142 100644
|
||||||
+ buffer, isCommand, blockpos != null ? MCUtil.toLocation(player.world, blockpos) : null);
|
+ buffer, isCommand, blockpos != null ? MCUtil.toLocation(player.world, blockpos) : null);
|
||||||
+ event.callEvent();
|
+ event.callEvent();
|
||||||
+ completions = event.isCancelled() ? com.google.common.collect.ImmutableList.of() : event.getCompletions();
|
+ completions = event.isCancelled() ? com.google.common.collect.ImmutableList.of() : event.getCompletions();
|
||||||
+ if (event.isCancelled() || event.isHandled()) {
|
+ if (!event.isHandled()) {
|
||||||
+ // Still fire sync event with the provided completions, if someone is listening
|
+ // If the event isn't handled, we can assume that we have no completions, and so we'll ask the server
|
||||||
+ if (!event.isCancelled() && org.bukkit.event.server.TabCompleteEvent.getHandlerList().getRegisteredListeners().length > 0) {
|
+
|
||||||
+ java.util.List<String> finalCompletions = completions;
|
+ Waitable<java.util.List<String>> syncCompletions = new Waitable<java.util.List<String>>() {
|
||||||
+ Waitable<java.util.List<String>> syncCompletions = new Waitable<java.util.List<String>>() {
|
+ @Override
|
||||||
+ @Override
|
+ protected java.util.List<String> evaluate() {
|
||||||
+ protected java.util.List<String> evaluate() {
|
+ return minecraftServer.tabCompleteCommand(player, buffer, blockpos, isCommand);
|
||||||
+ org.bukkit.event.server.TabCompleteEvent syncEvent = new org.bukkit.event.server.TabCompleteEvent(PlayerConnection.this.getPlayer(), buffer, finalCompletions, isCommand, blockpos != null ? MCUtil.toLocation(player.world, blockpos) : null);
|
|
||||||
+ return syncEvent.callEvent() ? syncEvent.getCompletions() : com.google.common.collect.ImmutableList.of();
|
|
||||||
+ }
|
|
||||||
+ };
|
|
||||||
+ server.getServer().processQueue.add(syncCompletions);
|
|
||||||
+ try {
|
|
||||||
+ completions = syncCompletions.get();
|
|
||||||
+ } catch (InterruptedException | ExecutionException e1) {
|
|
||||||
+ e1.printStackTrace();
|
|
||||||
+ }
|
+ }
|
||||||
|
+ };
|
||||||
|
+ server.getServer().processQueue.add(syncCompletions);
|
||||||
|
+ try {
|
||||||
|
+ completions = syncCompletions.get();
|
||||||
|
+ } catch (InterruptedException | ExecutionException e1) {
|
||||||
|
+ e1.printStackTrace();
|
||||||
+ }
|
+ }
|
||||||
|
|
||||||
- arraylist.add(s);
|
- arraylist.add(s);
|
||||||
+ this.player.playerConnection.sendPacket(new PacketPlayOutTabComplete(completions.toArray(new String[completions.size()])));
|
+ this.player.playerConnection.sendPacket(new PacketPlayOutTabComplete(completions.toArray(new String[completions.size()])));
|
||||||
+ return;
|
+ } else if (!event.isCancelled()) {
|
||||||
|
+ this.player.playerConnection.sendPacket(new PacketPlayOutTabComplete(completions.toArray(new String[completions.size()])));
|
||||||
}
|
}
|
||||||
-
|
-
|
||||||
- this.player.playerConnection.sendPacket(new PacketPlayOutTabComplete((String[]) arraylist.toArray(new String[arraylist.size()])));
|
- this.player.playerConnection.sendPacket(new PacketPlayOutTabComplete((String[]) arraylist.toArray(new String[arraylist.size()])));
|
||||||
+ minecraftServer.postToMainThread(() -> {
|
|
||||||
+ java.util.List<String> syncCompletions = this.minecraftServer.tabCompleteCommand(this.player, buffer, blockpos, isCommand);
|
|
||||||
+ this.player.playerConnection.sendPacket(new PacketPlayOutTabComplete(syncCompletions.toArray(new String[syncCompletions.size()])));
|
|
||||||
+ });
|
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
}
|
}
|
||||||
|
|
||||||
public void a(PacketPlayInSettings packetplayinsettings) {
|
public void a(PacketPlayInSettings packetplayinsettings) {
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
index 2dd7ed96a..e86c16755 100644
|
index 5b1aae5587..d6676074e6 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
@@ -1643,8 +1643,8 @@ public final class CraftServer implements Server {
|
@@ -1643,8 +1643,8 @@ public final class CraftServer implements Server {
|
||||||
|
@ -95,7 +97,7 @@ index 2dd7ed96a..e86c16755 100644
|
||||||
|
|
||||||
return tabEvent.isCancelled() ? Collections.EMPTY_LIST : tabEvent.getCompletions();
|
return tabEvent.isCancelled() ? Collections.EMPTY_LIST : tabEvent.getCompletions();
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java
|
||||||
index 1e3aae3b8..95d13c146 100644
|
index 1e3aae3b8f..95d13c146b 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java
|
--- a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java
|
||||||
@@ -28,6 +28,39 @@ public class ConsoleCommandCompleter implements Completer {
|
@@ -28,6 +28,39 @@ public class ConsoleCommandCompleter implements Completer {
|
||||||
|
@ -139,5 +141,5 @@ index 1e3aae3b8..95d13c146 100644
|
||||||
Waitable<List<String>> waitable = new Waitable<List<String>>() {
|
Waitable<List<String>> waitable = new Waitable<List<String>>() {
|
||||||
@Override
|
@Override
|
||||||
--
|
--
|
||||||
2.17.1
|
2.18.0
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
From a1cad034bac6f2931248130c5a65a134a0ccb6b0 Mon Sep 17 00:00:00 2001
|
From 79475dad6199107ffc2266fcf17ec6ebaffa7193 Mon Sep 17 00:00:00 2001
|
||||||
From: 0x22 <0x22@futureclient.net>
|
From: 0x22 <0x22@futureclient.net>
|
||||||
Date: Thu, 26 Apr 2018 04:41:11 -0400
|
Date: Thu, 26 Apr 2018 04:41:11 -0400
|
||||||
Subject: [PATCH] Fix exploit that allowed colored signs to be created
|
Subject: [PATCH] Fix exploit that allowed colored signs to be created
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||||
index 74a665142..4f82d8aae 100644
|
index 2ed59b4088..08191e9059 100644
|
||||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||||
@@ -2221,7 +2221,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
@@ -2222,7 +2222,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||||
String[] lines = new String[4];
|
String[] lines = new String[4];
|
||||||
|
|
||||||
for (int i = 0; i < astring.length; ++i) {
|
for (int i = 0; i < astring.length; ++i) {
|
||||||
|
@ -18,5 +18,5 @@ index 74a665142..4f82d8aae 100644
|
||||||
SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.server.getPlayer(this.player), lines);
|
SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.server.getPlayer(this.player), lines);
|
||||||
this.server.getPluginManager().callEvent(event);
|
this.server.getPluginManager().callEvent(event);
|
||||||
--
|
--
|
||||||
2.17.1
|
2.18.0
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
From 7a60efbad7a444b9c728712d98b5d628c0c3206f Mon Sep 17 00:00:00 2001
|
From 288bb047a292f3c3fdab66a5f7d40ca413536770 Mon Sep 17 00:00:00 2001
|
||||||
From: Aikar <aikar@aikar.co>
|
From: Aikar <aikar@aikar.co>
|
||||||
Date: Tue, 3 Jul 2018 21:56:23 -0400
|
Date: Tue, 3 Jul 2018 21:56:23 -0400
|
||||||
Subject: [PATCH] InventoryCloseEvent Reason API
|
Subject: [PATCH] InventoryCloseEvent Reason API
|
||||||
|
@ -7,7 +7,7 @@ Allows you to determine why an inventory was closed, enabling plugin developers
|
||||||
to "confirm" things based on if it was player triggered close or not.
|
to "confirm" things based on if it was player triggered close or not.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||||
index 51e7a4ad8..81bf60efa 100644
|
index 97485cf89e..d24d45fdd3 100644
|
||||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||||
@@ -869,7 +869,7 @@ public class Chunk {
|
@@ -869,7 +869,7 @@ public class Chunk {
|
||||||
|
@ -29,7 +29,7 @@ index 51e7a4ad8..81bf60efa 100644
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
|
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
|
||||||
index 0b51903e2..aa0b27f0e 100644
|
index 0b51903e23..aa0b27f0e1 100644
|
||||||
--- a/src/main/java/net/minecraft/server/EntityHuman.java
|
--- a/src/main/java/net/minecraft/server/EntityHuman.java
|
||||||
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
|
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
|
||||||
@@ -145,7 +145,7 @@ public abstract class EntityHuman extends EntityLiving {
|
@@ -145,7 +145,7 @@ public abstract class EntityHuman extends EntityLiving {
|
||||||
|
@ -56,7 +56,7 @@ index 0b51903e2..aa0b27f0e 100644
|
||||||
this.activeContainer = this.defaultContainer;
|
this.activeContainer = this.defaultContainer;
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||||
index cce3f98da..4ff505cfa 100644
|
index cce3f98dac..4ff505cfa3 100644
|
||||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||||
@@ -287,7 +287,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
@@ -287,7 +287,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||||
|
@ -110,10 +110,10 @@ index cce3f98da..4ff505cfa 100644
|
||||||
this.r();
|
this.r();
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||||
index 36833b961..a54203c56 100644
|
index 08191e9059..d5dda1f595 100644
|
||||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||||
@@ -1759,7 +1759,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
@@ -1760,7 +1760,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||||
PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.x());
|
PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.x());
|
||||||
|
|
||||||
if (this.player.isFrozen()) return; // CraftBukkit
|
if (this.player.isFrozen()) return; // CraftBukkit
|
||||||
|
@ -123,7 +123,7 @@ index 36833b961..a54203c56 100644
|
||||||
this.player.r();
|
this.player.r();
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
||||||
index b478f385a..eaaa54acd 100644
|
index b478f385a4..eaaa54acd4 100644
|
||||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||||
@@ -423,7 +423,7 @@ public abstract class PlayerList {
|
@@ -423,7 +423,7 @@ public abstract class PlayerList {
|
||||||
|
@ -136,7 +136,7 @@ index b478f385a..eaaa54acd 100644
|
||||||
PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(cserver.getPlayer(entityplayer), "\u00A7e" + entityplayer.getName() + " left the game");
|
PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(cserver.getPlayer(entityplayer), "\u00A7e" + entityplayer.getName() + " left the game");
|
||||||
cserver.getPluginManager().callEvent(playerQuitEvent);
|
cserver.getPluginManager().callEvent(playerQuitEvent);
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||||
index d85b5defc..05ca403e8 100644
|
index d85b5defca..05ca403e82 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||||
@@ -401,8 +401,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
@@ -401,8 +401,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||||
|
@ -155,7 +155,7 @@ index d85b5defc..05ca403e8 100644
|
||||||
public boolean isBlocking() {
|
public boolean isBlocking() {
|
||||||
return getHandle().isBlocking();
|
return getHandle().isBlocking();
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
index c0f4cec4d..6cbf429ff 100644
|
index 1874c15ab9..5f480ac06f 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
@@ -644,7 +644,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
@@ -644,7 +644,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
|
@ -168,7 +168,7 @@ index c0f4cec4d..6cbf429ff 100644
|
||||||
|
|
||||||
// Check if the fromWorld and toWorld are the same.
|
// Check if the fromWorld and toWorld are the same.
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||||
index 248873fb4..cce4acc0b 100644
|
index 248873fb4c..cce4acc0bb 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||||
@@ -927,8 +927,19 @@ public class CraftEventFactory {
|
@@ -927,8 +927,19 @@ public class CraftEventFactory {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
From 2d88ccd486565ced7b650bed5f15c8d4bbf3c809 Mon Sep 17 00:00:00 2001
|
From 81be84c666aaf4d1d6aa22d0dbe36f148f6f27a6 Mon Sep 17 00:00:00 2001
|
||||||
From: Minecrell <minecrell@minecrell.net>
|
From: Minecrell <minecrell@minecrell.net>
|
||||||
Date: Fri, 13 Jul 2018 14:54:43 +0200
|
Date: Fri, 13 Jul 2018 14:54:43 +0200
|
||||||
Subject: [PATCH] Refresh player inventory when cancelling
|
Subject: [PATCH] Refresh player inventory when cancelling
|
||||||
|
@ -16,10 +16,10 @@ Refresh the player inventory when PlayerInteractEntityEvent is
|
||||||
cancelled to avoid this problem.
|
cancelled to avoid this problem.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||||
index a54203c56..cc1152739 100644
|
index d5dda1f595..521c466093 100644
|
||||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||||
@@ -1673,6 +1673,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
@@ -1674,6 +1674,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.isCancelled()) {
|
if (event.isCancelled()) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
From 04c3885b1efb9556ac76b285afae2aef2c14f03c Mon Sep 17 00:00:00 2001
|
From 438859b071118528c6cc6c8f2411ef055ad58cf6 Mon Sep 17 00:00:00 2001
|
||||||
From: Shane Freeder <theboyetronic@gmail.com>
|
From: Shane Freeder <theboyetronic@gmail.com>
|
||||||
Date: Sun, 29 Jul 2018 05:02:15 +0100
|
Date: Sun, 29 Jul 2018 05:02:15 +0100
|
||||||
Subject: [PATCH] Break up and make tab spam limits configurable
|
Subject: [PATCH] Break up and make tab spam limits configurable
|
||||||
|
@ -38,10 +38,10 @@ index 5a17ce3d22..a5ff014e33 100644
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||||
index cc11527390..83d1baf33f 100644
|
index 521c466093..7b12d17a4c 100644
|
||||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||||
@@ -74,6 +74,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
@@ -75,6 +75,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||||
// CraftBukkit start - multithreaded fields
|
// CraftBukkit start - multithreaded fields
|
||||||
private volatile int chatThrottle;
|
private volatile int chatThrottle;
|
||||||
private static final AtomicIntegerFieldUpdater chatSpamField = AtomicIntegerFieldUpdater.newUpdater(PlayerConnection.class, "chatThrottle");
|
private static final AtomicIntegerFieldUpdater chatSpamField = AtomicIntegerFieldUpdater.newUpdater(PlayerConnection.class, "chatThrottle");
|
||||||
|
@ -49,7 +49,7 @@ index cc11527390..83d1baf33f 100644
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
private int j;
|
private int j;
|
||||||
private final IntHashMap<Short> k = new IntHashMap();
|
private final IntHashMap<Short> k = new IntHashMap();
|
||||||
@@ -203,6 +204,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
@@ -204,6 +205,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||||
this.minecraftServer.methodProfiler.b();
|
this.minecraftServer.methodProfiler.b();
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
for (int spam; (spam = this.chatThrottle) > 0 && !chatSpamField.compareAndSet(this, spam, spam - 1); ) ;
|
for (int spam; (spam = this.chatThrottle) > 0 && !chatSpamField.compareAndSet(this, spam, spam - 1); ) ;
|
||||||
|
@ -57,7 +57,7 @@ index cc11527390..83d1baf33f 100644
|
||||||
/* Use thread-safe field access instead
|
/* Use thread-safe field access instead
|
||||||
if (this.chatThrottle > 0) {
|
if (this.chatThrottle > 0) {
|
||||||
--this.chatThrottle;
|
--this.chatThrottle;
|
||||||
@@ -2281,7 +2283,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
@@ -2282,7 +2284,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||||
// Paper start - async tab completion
|
// Paper start - async tab completion
|
||||||
public void a(PacketPlayInTabComplete packet) {
|
public void a(PacketPlayInTabComplete packet) {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
|
|
Loading…
Reference in a new issue