Paper/CraftBukkit-Patches/0098-Add-Optional-Tick-Shuffling.patch
Ginger Geek fe031329f3 Allows greater control over Tab Command Complete.
You can now specify how many letters of the command must be typed before it will be tab completed this will help deter people from just spamming round all the commands to see if there is one incorrectly set up.
0 will tab complete all commands
-1 will disable tab complete

1 will mean you have to type the first letter
2 will mean you have to the second letter... etc...
2014-04-02 18:01:40 +11:00

44 lines
1.8 KiB
Diff

From faafbd328712156c796413a02011413b74735cb4 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Mon, 27 Jan 2014 08:39:26 +1100
Subject: [PATCH] Add Optional Tick Shuffling
This prevents players from 'gaming' the server, and strategically relogging to increase their position in the tick order.
diff --git a/src/main/java/net/minecraft/server/ServerConnection.java b/src/main/java/net/minecraft/server/ServerConnection.java
index c2194af..1d7b814 100644
--- a/src/main/java/net/minecraft/server/ServerConnection.java
+++ b/src/main/java/net/minecraft/server/ServerConnection.java
@@ -53,6 +53,13 @@ public class ServerConnection {
List list = this.f;
synchronized (this.f) {
+ // Spigot Start
+ // This prevents players from 'gaming' the server, and strategically relogging to increase their position in the tick order
+ if ( org.spigotmc.SpigotConfig.playerShuffle > 0 && MinecraftServer.currentTick % org.spigotmc.SpigotConfig.playerShuffle == 0 )
+ {
+ Collections.shuffle( this.f );
+ }
+ // Spigot End
Iterator iterator = this.f.iterator();
while (iterator.hasNext()) {
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
index 8eac742..e26b964 100644
--- a/src/main/java/org/spigotmc/SpigotConfig.java
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
@@ -256,4 +256,10 @@ public class SpigotConfig
playerSample = getInt( "settings.sample-count", 12 );
System.out.println( "Server Ping Player Sample Count: " + playerSample );
}
+
+ public static int playerShuffle;
+ private static void playerShuffle()
+ {
+ playerShuffle = getInt( "settings.player-shuffle", 0 );
+ }
}
--
1.8.3.2