Work around Bedrock players looking like Steve

This commit is contained in:
Camotoy 2024-06-20 15:24:39 -04:00
parent f49acb2f7c
commit dd9d5f321b
No known key found for this signature in database
GPG key ID: 7EEFB66FE798081F
2 changed files with 14 additions and 4 deletions

View file

@ -309,6 +309,15 @@ public class SkinManager {
return null;
}
if (DEFAULT_FLOODGATE_STEVE.equals(skinUrl)) {
// https://github.com/GeyserMC/Floodgate/commit/00b8b1b6364116ff4bc9b00e2015ce35bae8abb1 ensures that
// Bedrock players on online-mode servers will always have a textures property. However, this skin is
// also sent our way, and isn't overwritten. It's very likely that this skin is *only* a placeholder,
// and no one should ever be using it outside of Floodgate, and therefore no one wants to see this
// specific Steve skin.
return null;
}
boolean isAlex = skinTexture.has("metadata");
String capeUrl = null;
@ -322,5 +331,7 @@ public class SkinManager {
return new GameProfileData(skinUrl, capeUrl, isAlex);
}
private static final String DEFAULT_FLOODGATE_STEVE = "https://textures.minecraft.net/texture/31f477eb1a7beee631c2ca64d06f8f68fa93a3386d04452ab27f43acdf1b60cb";
}
}

View file

@ -29,9 +29,6 @@ import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import it.unimi.dsi.fastutil.bytes.ByteArrays;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.geysermc.geyser.GeyserImpl;
@ -56,7 +53,9 @@ import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.Map;
import java.util.Objects;
import java.util.UUID;
import java.util.concurrent.*;
import java.util.function.Predicate;