Merge branch 'master' into pre/1.13

* master:
  PlayerProfile.complete shouldn't throw NPE
This commit is contained in:
Aikar 2018-07-31 01:44:11 -04:00
commit 42730c41bb
No known key found for this signature in database
GPG key ID: 401ADFC9891FAAFE

View file

@ -1,4 +1,4 @@
From 7904ca188e0fc12e77ae272c8231a458f2ad2f22 Mon Sep 17 00:00:00 2001 From f5ea9812a6d2bd99c63c9935127f9a700f3656bc Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Mon, 15 Jan 2018 22:11:48 -0500 Date: Mon, 15 Jan 2018 22:11:48 -0500
Subject: [PATCH] Basic PlayerProfile API Subject: [PATCH] Basic PlayerProfile API
@ -7,10 +7,10 @@ Establishes base extension of profile systems for future edits too
diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
new file mode 100644 new file mode 100644
index 000000000..9ad5853de index 0000000000..b151a13c1b
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java +++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
@@ -0,0 +1,281 @@ @@ -0,0 +1,280 @@
+package com.destroystokyo.paper.profile; +package com.destroystokyo.paper.profile;
+ +
+import com.destroystokyo.paper.PaperConfig; +import com.destroystokyo.paper.PaperConfig;
@ -166,10 +166,9 @@ index 000000000..9ad5853de
+ // Make an OfflinePlayer using an offline mode UUID since the name has no profile + // Make an OfflinePlayer using an offline mode UUID since the name has no profile
+ profile = new GameProfile(UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8)), name); + profile = new GameProfile(UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8)), name);
+ } + }
+ if (profile == null) { + if (profile != null) {
+ throw new NullPointerException("Could not get UUID for Player " + name); + this.profile = profile;
+ } + }
+ this.profile = profile;
+ } + }
+ +
+ if (profile.getName() == null) { + if (profile.getName() == null) {
@ -294,7 +293,7 @@ index 000000000..9ad5853de
+} +}
diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java b/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java b/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java
new file mode 100644 new file mode 100644
index 000000000..25836b975 index 0000000000..25836b975b
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java +++ b/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java
@@ -0,0 +1,30 @@ @@ -0,0 +1,30 @@
@ -330,7 +329,7 @@ index 000000000..25836b975
+} +}
diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperGameProfileRepository.java b/src/main/java/com/destroystokyo/paper/profile/PaperGameProfileRepository.java diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperGameProfileRepository.java b/src/main/java/com/destroystokyo/paper/profile/PaperGameProfileRepository.java
new file mode 100644 new file mode 100644
index 000000000..3bcdb8f93 index 0000000000..3bcdb8f93f
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/profile/PaperGameProfileRepository.java +++ b/src/main/java/com/destroystokyo/paper/profile/PaperGameProfileRepository.java
@@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
@ -353,7 +352,7 @@ index 000000000..3bcdb8f93
+} +}
diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java b/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java b/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java
new file mode 100644 new file mode 100644
index 000000000..4b2a67423 index 0000000000..4b2a67423f
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java +++ b/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java
@@ -0,0 +1,29 @@ @@ -0,0 +1,29 @@
@ -388,7 +387,7 @@ index 000000000..4b2a67423
+} +}
diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperUserAuthentication.java b/src/main/java/com/destroystokyo/paper/profile/PaperUserAuthentication.java diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperUserAuthentication.java b/src/main/java/com/destroystokyo/paper/profile/PaperUserAuthentication.java
new file mode 100644 new file mode 100644
index 000000000..3aceb0ea8 index 0000000000..3aceb0ea8a
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/profile/PaperUserAuthentication.java +++ b/src/main/java/com/destroystokyo/paper/profile/PaperUserAuthentication.java
@@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
@ -404,7 +403,7 @@ index 000000000..3aceb0ea8
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
index 381542e0d..80927de08 100644 index 381542e0d2..80927de08b 100644
--- a/src/main/java/net/minecraft/server/MCUtil.java --- a/src/main/java/net/minecraft/server/MCUtil.java
+++ b/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java
@@ -1,6 +1,9 @@ @@ -1,6 +1,9 @@
@ -429,7 +428,7 @@ index 381542e0d..80927de08 100644
* Calculates distance between 2 entities * Calculates distance between 2 entities
* @param e1 * @param e1
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 f88ba7db7..a2e685acf 100644 index f88ba7db7f..a2e685acf7 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
@@ -1162,7 +1162,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -1162,7 +1162,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
@ -450,7 +449,7 @@ index f88ba7db7..a2e685acf 100644
return this.V; return this.V;
} }
diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java
index a47a51a41..4c476f757 100644 index a47a51a412..4c476f757c 100644
--- a/src/main/java/net/minecraft/server/UserCache.java --- a/src/main/java/net/minecraft/server/UserCache.java
+++ b/src/main/java/net/minecraft/server/UserCache.java +++ b/src/main/java/net/minecraft/server/UserCache.java
@@ -44,7 +44,7 @@ public class UserCache { @@ -44,7 +44,7 @@ public class UserCache {
@ -486,7 +485,7 @@ index a47a51a41..4c476f757 100644
private UserCacheEntry(GameProfile gameprofile, Date date) { private UserCacheEntry(GameProfile gameprofile, Date date) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 237d7696c..7157a5b13 100644 index 237d7696c7..7157a5b136 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -153,6 +153,10 @@ import org.bukkit.craftbukkit.util.CraftNamespacedKey; @@ -153,6 +153,10 @@ import org.bukkit.craftbukkit.util.CraftNamespacedKey;