1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-19 19:25:48 +00:00

Fixed custom player heads errors

This commit is contained in:
TheBusyBiscuit 2020-05-24 01:57:38 +02:00
parent 6a4e23853c
commit 23c2ab0f65
2 changed files with 3 additions and 7 deletions

View File

@ -57,6 +57,7 @@
* Fixed ChestTerminals deleting items from Cargo networks (TheBusyBiscuit/ChestTerminal#25)
* Fixed #1926
* Fixed #1933
* Fixed random errors because of Mojang's new player heads backend (Why... Mojang... why?)
## Release Candidate 11 (25 Apr 2020)

View File

@ -198,13 +198,8 @@ public final class SlimefunUtils {
String base64 = texture;
if (!texture.startsWith("ey")) {
if (PatternUtils.ALPHANUMERIC.matcher(texture).matches()) {
base64 = Base64.getEncoder().encodeToString(("{\"textures\":{\"SKIN\":{\"url\":\"http://textures.minecraft.net/texture/" + texture + "\"}}}").getBytes(StandardCharsets.UTF_8));
}
else {
throw new IllegalArgumentException("The provided texture (" + texture + ") does not seem to be a valid texture String!");
}
if (PatternUtils.ALPHANUMERIC.matcher(texture).matches()) {
base64 = Base64.getEncoder().encodeToString(("{\"textures\":{\"SKIN\":{\"url\":\"http://textures.minecraft.net/texture/" + texture + "\"}}}").getBytes(StandardCharsets.UTF_8));
}
return SkullItem.fromBase64(base64);