1
0
mirror of https://github.com/GeyserMC/Floodgate.git synced 2025-12-19 14:59:20 +00:00

GameProfiles are immutable on Velocity

This commit is contained in:
Camotoy
2022-02-02 16:53:12 -05:00
parent 8beed574e5
commit c3ba9e6f73

View File

@@ -49,6 +49,7 @@ import io.netty.channel.Channel;
import io.netty.util.AttributeKey;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import net.kyori.adventure.text.Component;
@@ -142,11 +143,10 @@ public final class VelocityListener {
FloodgatePlayer player = playerCache.getIfPresent(event.getConnection());
if (player != null) {
playerCache.invalidate(event.getConnection());
GameProfile profile = new GameProfile(
player.getCorrectUniqueId(), player.getCorrectUsername(), new ArrayList<>());
// To fix the February 2 2022 Mojang authentication changes
profile.addProperty(new Property("textures", "", ""));
event.setGameProfile(profile);
// The texture properties addition is to fix the February 2 2022 Mojang authentication changes
event.setGameProfile(new GameProfile(player.getCorrectUniqueId(),
player.getCorrectUsername(), Collections.singletonList(
new Property("textures", "", ""))));
}
}