use of org.bukkit.event.player.PlayerLocaleChangeEvent in project Glowstone by GlowstoneMC.
the class GlowPlayer method setSettings.
/**
* Set this player's client settings.
*
* @param settings The settings to set.
*/
public void setSettings(ClientSettings settings) {
String newLocale = settings.getLocale();
if (!newLocale.equalsIgnoreCase(this.settings.getLocale())) {
EventFactory.getInstance().callEvent(new PlayerLocaleChangeEvent(this, newLocale));
}
if (settings.getMainHand() != getMainHand().ordinal()) {
EventFactory.getInstance().callEvent(new PlayerChangedMainHandEvent(this, settings.getMainHand() == 0 ? MainHand.LEFT : MainHand.RIGHT));
}
forceStream = settings.getViewDistance() != this.settings.getViewDistance() && settings.getViewDistance() + 1 <= server.getViewDistance();
this.settings = settings;
metadata.set(MetadataIndex.PLAYER_SKIN_PARTS, settings.getSkinFlags());
metadata.set(MetadataIndex.PLAYER_MAIN_HAND, settings.getMainHand());
}
Aggregations