use of com.velocitypowered.api.util.GameProfile.Property in project Floodgate by GeyserMC.
the class VelocityListener method onGameProfileRequest.
@Subscribe(order = PostOrder.EARLY)
public void onGameProfileRequest(GameProfileRequestEvent event) {
FloodgatePlayer player = playerCache.getIfPresent(event.getConnection());
if (player != null) {
playerCache.invalidate(event.getConnection());
// 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", "", ""))));
}
}
use of com.velocitypowered.api.util.GameProfile.Property in project Floodgate by GeyserMC.
the class VelocitySkinApplier method applySkin.
@Override
public void applySkin(FloodgatePlayer floodgatePlayer, SkinData skinData) {
server.getPlayer(floodgatePlayer.getCorrectUniqueId()).ifPresent(player -> {
List<Property> properties = new ArrayList<>(player.getGameProfileProperties());
properties.add(new Property("textures", skinData.getValue(), skinData.getSignature()));
player.setGameProfileProperties(properties);
});
}
Aggregations