2016-07-31 01:13:56 +02:00
|
|
|
From 584b8849dacaeaf44c6c2781d1ebcfc6a6e59526 Mon Sep 17 00:00:00 2001
|
2016-04-13 08:11:40 +02:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Wed, 13 Apr 2016 02:10:49 -0400
|
|
|
|
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
|
2016-06-09 05:57:14 +02:00
|
|
|
index 22c7dea..24fb01c 100644
|
2016-04-13 08:11:40 +02:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
2016-05-02 05:54:08 +02:00
|
|
|
@@ -218,4 +218,9 @@ public class PaperConfig {
|
2016-04-13 08:11:40 +02:00
|
|
|
private static void regionFileCacheSize() {
|
|
|
|
regionFileCacheSize = getInt("settings.region-file-cache-size", 256);
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public static boolean enablePlayerCollisions = true;
|
|
|
|
+ private static void enablePlayerCollisions() {
|
|
|
|
+ enablePlayerCollisions = getBoolean("settings.enable-player-collisions", true);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java
|
2016-06-09 05:57:14 +02:00
|
|
|
index d8ec504..eb45d3c 100644
|
2016-04-13 08:11:40 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java
|
|
|
|
@@ -96,7 +96,7 @@ public class PacketPlayOutScoreboardTeam implements Packet<PacketListenerPlayOut
|
|
|
|
packetdataserializer.a(this.d);
|
|
|
|
packetdataserializer.writeByte(this.j);
|
|
|
|
packetdataserializer.a(this.e);
|
|
|
|
- packetdataserializer.a(this.f);
|
|
|
|
+ packetdataserializer.a(!com.destroystokyo.paper.PaperConfig.enablePlayerCollisions ? "never" : this.f); // Paper
|
|
|
|
packetdataserializer.writeByte(this.g);
|
|
|
|
}
|
|
|
|
|
2016-07-31 00:04:39 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
2016-07-31 01:13:56 +02:00
|
|
|
index 91e52f9..f133b32 100644
|
2016-07-31 00:04:39 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
2016-07-31 01:13:56 +02:00
|
|
|
@@ -241,6 +241,14 @@ public abstract class PlayerList {
|
2016-07-31 00:04:39 +02:00
|
|
|
public void sendScoreboard(ScoreboardServer scoreboardserver, EntityPlayer entityplayer) {
|
|
|
|
HashSet hashset = Sets.newHashSet();
|
|
|
|
Iterator iterator = scoreboardserver.getTeams().iterator();
|
|
|
|
+
|
|
|
|
+ // Paper start - Send a fake team to the client to initialize collision rule if no others exist
|
|
|
|
+ if (!com.destroystokyo.paper.PaperConfig.enablePlayerCollisions && !iterator.hasNext()) {
|
2016-07-31 01:13:56 +02:00
|
|
|
+ String teamName = org.apache.commons.lang3.StringUtils.left("collideRule_" + entityplayer.getWorld().random.nextInt(), 16);
|
|
|
|
+ entityplayer.playerConnection.sendPacket(new PacketPlayOutScoreboardTeam(new ScoreboardTeam(scoreboardserver, teamName), 0));
|
2016-07-31 00:04:39 +02:00
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
|
|
|
|
while (iterator.hasNext()) {
|
|
|
|
ScoreboardTeam scoreboardteam = (ScoreboardTeam) iterator.next();
|
2016-04-13 08:11:40 +02:00
|
|
|
--
|
2016-07-31 00:04:39 +02:00
|
|
|
2.9.2.windows.1
|
2016-04-13 08:11:40 +02:00
|
|
|
|