use of net.glowstone.net.message.play.game.StateChangeMessage in project Glowstone by GlowstoneMC.
the class GlowPlayer method setGameMode.
@Override
public void setGameMode(GameMode mode) {
if (getGameMode() != mode) {
PlayerGameModeChangeEvent event = new PlayerGameModeChangeEvent(this, mode);
if (EventFactory.getInstance().callEvent(event).isCancelled()) {
return;
}
super.setGameMode(mode);
super.setFallDistance(0);
updateUserListEntries(UserListItemMessage.gameModeOne(getUniqueId(), mode.getValue()));
session.send(new StateChangeMessage(Reason.GAMEMODE, mode.getValue()));
}
setGameModeDefaults();
}
use of net.glowstone.net.message.play.game.StateChangeMessage in project Glowstone by GlowstoneMC.
the class GlowPlayer method sendWeather.
/**
* Sends a {@link StateChangeMessage} with the current weather.
*/
public void sendWeather() {
boolean stormy = playerWeather == null ? getWorld().hasStorm() : playerWeather == WeatherType.DOWNFALL;
session.send(new StateChangeMessage(stormy ? Reason.START_RAIN : Reason.STOP_RAIN, 0));
}
Aggregations