mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
b742f7a892
Upstream merge (we must go deeper) SpigotMC/Spigot@1e7bc383c3
41 lines
No EOL
1.9 KiB
Diff
41 lines
No EOL
1.9 KiB
Diff
From 0000000000000000000000000000000000000000 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/ServerConnection.java
|
|
+++ b/src/main/java/net/minecraft/server/ServerConnection.java
|
|
@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/org/spigotmc/SpigotConfig.java
|
|
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
|
|
@@ -0,0 +0,0 @@ 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 );
|
|
+ }
|
|
}
|
|
--
|