Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 12:30:06 +01:00
17f71ac87b
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 70d24eb8 SPIGOT-6587: Update documentation/error of drop chance API CraftBukkit Changes: 470050ad SPIGOT-6587: Update documentation/error of drop chance API 1c39efa3 Fix Inventory#getViewers on the player inventory not returning the player first time their inventory is opened d161627d Fix PrepareItemCraftEvent#isRepair aa1fae73 SPIGOT-6586: EntityChangeBlockEvent for falling block does not cancel properly 8a04072e SPIGOT-6583: Throwing eggs doesn't make sounds Spigot Changes: f773da84 Remove redundant patch cd367234 Rebuild patches
40 Zeilen
1.4 KiB
Diff
40 Zeilen
1.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: oxygencraft <21054297+oxygencraft@users.noreply.github.com>
|
|
Date: Sun, 25 Oct 2020 18:34:50 +1100
|
|
Subject: [PATCH] Add getOfflinePlayerIfCached(String)
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
index f6fd414e639f2880f1abc2e4c4ef0fbe05a562db..5412c537fa3c3c1e4613a3b3b0ebfdf983a6902a 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
@@ -1608,6 +1608,28 @@ public final class CraftServer implements Server {
|
|
return result;
|
|
}
|
|
|
|
+ // Paper start
|
|
+ @Override
|
|
+ @Nullable
|
|
+ public OfflinePlayer getOfflinePlayerIfCached(String name) {
|
|
+ Validate.notNull(name, "Name cannot be null");
|
|
+ Validate.notEmpty(name, "Name cannot be empty");
|
|
+
|
|
+ OfflinePlayer result = getPlayerExact(name);
|
|
+ if (result == null) {
|
|
+ GameProfile profile = console.getProfileCache().getProfileIfCached(name);
|
|
+
|
|
+ if (profile != null) {
|
|
+ result = getOfflinePlayer(profile);
|
|
+ }
|
|
+ } else {
|
|
+ offlinePlayers.remove(result.getUniqueId());
|
|
+ }
|
|
+
|
|
+ return result;
|
|
+ }
|
|
+ // Paper end
|
|
+
|
|
@Override
|
|
public OfflinePlayer getOfflinePlayer(UUID id) {
|
|
Validate.notNull(id, "UUID cannot be null");
|