Use copies for PlayerProfile in PaperServerList and SkullMeta

Don't want to risk mutating players properties in server list (unlikely, but lets be proper)

and Skull also has a setter API, so that should be used too.
This commit is contained in:
Aikar
2018-03-22 23:32:55 -04:00
parent e15167251b
commit cff8ae9644
6 changed files with 14 additions and 14 deletions

View File

@@ -1,4 +1,4 @@
From be13b11e1cb79084ab4d0b400ab6c013a0357fa7 Mon Sep 17 00:00:00 2001
From 26a88cddba5d4b477a501c983fead50ad3c9e5df Mon Sep 17 00:00:00 2001
From: Minecrell <minecrell@minecrell.net>
Date: Wed, 11 Oct 2017 15:56:26 +0200
Subject: [PATCH] Implement extended PaperServerListPingEvent
@@ -60,7 +60,7 @@ index 000000000..a2a409e63
+}
diff --git a/src/main/java/com/destroystokyo/paper/network/StandardPaperServerListPingEventImpl.java b/src/main/java/com/destroystokyo/paper/network/StandardPaperServerListPingEventImpl.java
new file mode 100644
index 000000000..33dd196fb
index 000000000..350410527
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/network/StandardPaperServerListPingEventImpl.java
@@ -0,0 +1,112 @@
@@ -101,7 +101,7 @@ index 000000000..33dd196fb
+
+ if (this.originalSample != null) {
+ for (GameProfile profile : this.originalSample) {
+ sample.add(CraftPlayerProfile.asBukkitMirror(profile));
+ sample.add(CraftPlayerProfile.asBukkitCopy(profile));
+ }
+ this.originalSample = null;
+ }
@@ -177,7 +177,7 @@ index 000000000..33dd196fb
+
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index e8c72db96..9da09d53b 100644
index 579f0ba0d..99cfe1ae5 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -768,7 +768,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs