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