Skip to content

Backport fix for SPIGOT-3348: Skin Cache Bug #291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Reduce IO ops opening a new region file


diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java
index 8165a5020c1969a136a5d60c5725433ba6b25190..6373527a96b172e8faa5e10f8bf66c97916fd747 100644
index 8165a5020c1969a136a5d60c5725433ba6b25190..bfe98425f3ffd59a24d050149a892d74738aea7f 100644
--- a/src/main/java/net/minecraft/server/RegionFile.java
+++ b/src/main/java/net/minecraft/server/RegionFile.java
@@ -66,10 +66,18 @@ public class RegionFile {
Expand All @@ -14,7 +14,7 @@ index 8165a5020c1969a136a5d60c5725433ba6b25190..6373527a96b172e8faa5e10f8bf66c97

+ // PandaSpigot start - Reduce IO ops
+ java.nio.ByteBuffer header = java.nio.ByteBuffer.allocate(8192);
+ while (header.hasRemaining()) {
+ while (header.hasRemaining()) {
+ if (this.c.getChannel().read(header) == -1) throw new java.io.EOFException();
+ }
+ ((java.nio.Buffer) header).clear(); // cast required, due to Java 9+ changing return type
Expand Down
20 changes: 20 additions & 0 deletions patches/server/0109-Fix-SPIGOT-3348-Skin-Cache-Bug.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: uRyanxD <[email protected]>
Date: Sun, 9 Feb 2025 15:00:11 -0300
Subject: [PATCH] Fix SPIGOT-3348: Skin Cache Bug

Upstream commit: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/spigot/commits/635ffca0102da5681fe2871c6978e9de5118b14d

diff --git a/src/main/java/net/minecraft/server/TileEntitySkull.java b/src/main/java/net/minecraft/server/TileEntitySkull.java
index 58014c5f142abf72fcf6a7164872bbe7d7bb9d18..2c94ffa6c72d2851513c527fb14f058f24f1e35f 100644
--- a/src/main/java/net/minecraft/server/TileEntitySkull.java
+++ b/src/main/java/net/minecraft/server/TileEntitySkull.java
@@ -162,7 +162,7 @@ public class TileEntitySkull extends TileEntity {
} else if (MinecraftServer.getServer() == null) {
callback.apply(gameprofile);
} else {
- GameProfile profile = skinCache.getIfPresent(gameprofile.getName());
+ GameProfile profile = skinCache.getIfPresent(gameprofile.getName().toLowerCase()); // PandaSpigot - Fix SPIGOT-3348: Skin Cache Bug
if (profile != null && Iterables.getFirst(profile.getProperties().get("textures"), (Object) null) != null) {
callback.apply(profile);
} else {