Stop collideRule team from seeing invis 'friends'

More appropriately aligns ourself with the no team option, because the
collideRule team is only a team because it has to be, not because we want
anyone to have any sort of gameplay based relationship.

Also block any options from being set on this team to further enforce that
it is not a persistent team and should not be treated as such.
This commit is contained in:
Zach Brown 2016-09-15 16:36:57 -05:00
parent eb3ff14afd
commit 14c974629c
No known key found for this signature in database
GPG key ID: CC9DA35FC5450B76
5 changed files with 33 additions and 14 deletions

View file

@ -1,11 +1,11 @@
From 0bc1fd3d9584ce9a5afc3aba22e151b72549ca70 Mon Sep 17 00:00:00 2001 From cb78f2537b9f9d833898b52f077423e06c0bca7b Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com> From: Zach Brown <zach.brown@destroystokyo.com>
Date: Wed, 2 Mar 2016 23:46:57 -0600 Date: Wed, 2 Mar 2016 23:46:57 -0600
Subject: [PATCH] Configurable Chunk IO Thread Base Count Subject: [PATCH] Configurable Chunk IO Thread Base Count
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 858eb9a..de13cf7 100644 index f509bed..259e3b7 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -184,4 +184,9 @@ public class PaperConfig { @@ -184,4 +184,9 @@ public class PaperConfig {

View file

@ -1,4 +1,4 @@
From bc0fc5be08c6177fa6f078a0607bf3f450734fb4 Mon Sep 17 00:00:00 2001 From 30f1a19b07f5ccf554263385ae068c0d6095211e Mon Sep 17 00:00:00 2001
From: vemacs <d@nkmem.es> From: vemacs <d@nkmem.es>
Date: Thu, 3 Mar 2016 01:19:22 -0600 Date: Thu, 3 Mar 2016 01:19:22 -0600
Subject: [PATCH] All chunks are slime spawn chunks toggle Subject: [PATCH] All chunks are slime spawn chunks toggle

View file

@ -1,11 +1,11 @@
From 73ca36d4eb5cce121347d7379071a5bca7da2027 Mon Sep 17 00:00:00 2001 From 67f26ad0e1b64b12230b9fdd7dfd2374f7b88707 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Wed, 13 Apr 2016 02:10:49 -0400 Date: Wed, 13 Apr 2016 02:10:49 -0400
Subject: [PATCH] Configurable Player Collision Subject: [PATCH] Configurable Player Collision
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index d5ee3ae..e6e7739 100644 index 1b9c852..a3f4c1f 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -210,4 +210,9 @@ public class PaperConfig { @@ -210,4 +210,9 @@ public class PaperConfig {
@ -18,11 +18,29 @@ index d5ee3ae..e6e7739 100644
+ enablePlayerCollisions = getBoolean("settings.enable-player-collisions", true); + enablePlayerCollisions = getBoolean("settings.enable-player-collisions", true);
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/CommandScoreboard.java b/src/main/java/net/minecraft/server/CommandScoreboard.java
index 8e5419d..64a3495 100644
--- a/src/main/java/net/minecraft/server/CommandScoreboard.java
+++ b/src/main/java/net/minecraft/server/CommandScoreboard.java
@@ -182,6 +182,13 @@ public class CommandScoreboard extends CommandAbstract {
throw new ExceptionUsage("commands.scoreboard.teams.option.usage", new Object[0]);
}
+ // Paper start - Block setting options on our collideRule team as it is not persistent
+ if (astring[2].equals(MinecraftServer.getServer().getPlayerList().collideRuleTeamName)) {
+ icommandlistener.sendMessage(new ChatMessage("You cannot set team options on the collideRule team"));
+ return;
+ }
+ // Paper end
+
this.c(icommandlistener, astring, 2, minecraftserver);
}
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 8e364de..90cce4a 100644 index 8e364de..a5ebb17 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -324,6 +324,13 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs @@ -324,6 +324,14 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
this.v.setPlayerFileData(this.worldServer); this.v.setPlayerFileData(this.worldServer);
this.a(this.getDifficulty()); this.a(this.getDifficulty());
this.l(); this.l();
@ -30,7 +48,8 @@ index 8e364de..90cce4a 100644
+ // Paper start - Handle collideRule team for player collision toggle + // Paper start - Handle collideRule team for player collision toggle
+ if (!com.destroystokyo.paper.PaperConfig.enablePlayerCollisions) { + if (!com.destroystokyo.paper.PaperConfig.enablePlayerCollisions) {
+ this.getPlayerList().collideRuleTeamName = org.apache.commons.lang3.StringUtils.left("collideRule_" + this.getWorld().random.nextInt(), 16); + this.getPlayerList().collideRuleTeamName = org.apache.commons.lang3.StringUtils.left("collideRule_" + this.getWorld().random.nextInt(), 16);
+ this.getWorld().getScoreboard().createTeam(this.getPlayerList().collideRuleTeamName); + ScoreboardTeam collideTeam = this.getWorld().getScoreboard().createTeam(this.getPlayerList().collideRuleTeamName);
+ collideTeam.setCanSeeFriendlyInvisibles(false); // Because we want to mimic them not being on a team at all
+ } + }
+ // Paper end + // Paper end
} }

View file

@ -1,4 +1,4 @@
From 06e01fb6a3f8c1dcddbd94fbf188f16cf1816ab8 Mon Sep 17 00:00:00 2001 From a47d239dfc2f8dcf30bf36ef6d228b20fb8f78b6 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Thu, 28 Apr 2016 00:57:27 -0400 Date: Thu, 28 Apr 2016 00:57:27 -0400
Subject: [PATCH] remove null possibility for getServer singleton Subject: [PATCH] remove null possibility for getServer singleton
@ -6,7 +6,7 @@ Subject: [PATCH] remove null possibility for getServer singleton
to stop IDE complaining about potential NPE to stop IDE complaining about potential NPE
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 90cce4a..25c4f9f 100644 index a5ebb17..6fbe9e6 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -49,6 +49,7 @@ import co.aikar.timings.MinecraftTimings; // Paper @@ -49,6 +49,7 @@ import co.aikar.timings.MinecraftTimings; // Paper
@ -25,7 +25,7 @@ index 90cce4a..25c4f9f 100644
io.netty.util.ResourceLeakDetector.setEnabled( false ); // Spigot - disable io.netty.util.ResourceLeakDetector.setEnabled( false ); // Spigot - disable
this.e = proxy; this.e = proxy;
this.U = yggdrasilauthenticationservice; this.U = yggdrasilauthenticationservice;
@@ -1604,7 +1606,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs @@ -1605,7 +1607,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
// CraftBukkit start // CraftBukkit start
@Deprecated @Deprecated
public static MinecraftServer getServer() { public static MinecraftServer getServer() {

View file

@ -1,4 +1,4 @@
From 0872f7843a9510bc64d506766a34d8854466f927 Mon Sep 17 00:00:00 2001 From a6d4f7801444aaf0bb3fb0f32d1290163721369f Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Mon, 16 May 2016 20:47:41 -0400 Date: Mon, 16 May 2016 20:47:41 -0400
Subject: [PATCH] Optimize UserCache / Thread Safe Subject: [PATCH] Optimize UserCache / Thread Safe
@ -10,10 +10,10 @@ Additionally, move Saving of the User cache to be done async, incase
the user never changed the default setting for Spigot's save on stop only. the user never changed the default setting for Spigot's save on stop only.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 25c4f9f..005a27b 100644 index 6fbe9e6..8ca8fbf 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -507,7 +507,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs @@ -508,7 +508,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
// Spigot start // Spigot start
if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) { if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) {
LOGGER.info("Saving usercache.json"); LOGGER.info("Saving usercache.json");