PlayerProfile cache completions perform web requests
status: needs triageversion: 26.2
### Expected behavior
<img width="876" height="280" alt="Image" src="https://github.com/user-attachments/assets/24739f9c-05c0-41ff-a16f-2a259c8063e1" />
### Observed/Actual behavior
<img width="844" height="297" alt="Image" src="https://github.com/user-attachments/assets/9327e05d-a631-480c-b3ed-160538a8cb28" />
### Steps/models to reproduce
Just use the method
### Plugin and Datapack List
null
### Paper version
> ver
[04:24:47 INFO]: This server is running Paper version 26.2-120-main@1797fbc (2026-08-28T19:56:08Z) (Implementing API version 26.2.build.120-stable)
You are running the latest version
### Other
Possibly:
```diff
diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
--- a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java (revision 26b94ad553e32a4fb8f7790e3eef3a6c32b77953)
+++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java (date 1787969857353)
@@ -236,7 +236,7 @@
if (onlineMode) {
profile = server.services().paper().filledProfileCache().getIfCached(name);
if (profile == null && lookupUUID) {
- NameAndId nameAndId = server.services().nameToIdCache().get(name).orElse(null);
+ NameAndId nameAndId = server.services().nameToIdCache().getIfCached(name);
if (nameAndId != null) {
profile = nameAndId.toUncompletedGameProfile();
}
```
However I think that there's need to actually rethink the entire method body. I'm not even sure why there's textures check:
```java
if ((profile.name().isEmpty() || !hasTextures()) && this.getId() != null) {
GameProfile profile = server.services().paper().filledProfileCache().getIfCached(this.profile.id());
if (profile == null) {
```
Also, additional overload would be nice to have if the textures check is actually meant to be there, for example:
```java
public boolean completeFromCache(boolean lookupUUID, boolean textures, boolean onlineMode) {
```
5 条评论