Package org.spout.vanilla.protocol.msg.player

Examples of org.spout.vanilla.protocol.msg.player.PlayerGameStateMessage


    event.getMessages().add(new PlayerCollectItemMessage(event.getCollected().getId(), event.getEntity().getId()));
  }

  @EventHandler
  public void onPlayerGameState(PlayerGameStateEvent event) {
    event.getMessages().add(new PlayerGameStateMessage(event.getReason(), event.getGameMode()));
  }
View Full Code Here


  @EventHandler
  public void onWeatherChanged(WeatherChangeEvent event) {
    Weather newWeather = event.getNewWeather();
    if (newWeather.equals(Weather.RAIN) || newWeather.equals(Weather.THUNDERSTORM)) {
      event.getMessages().add(new PlayerGameStateMessage(PlayerGameStateMessage.BEGIN_RAINING));
    } else {
      event.getMessages().add(new PlayerGameStateMessage(PlayerGameStateMessage.END_RAINING));
    }
  }
View Full Code Here

  @Override
  public PlayerGameStateMessage decode(ByteBuf buffer) throws IOException {
    byte reason = buffer.readByte();
    byte gameMode = buffer.readByte();
    return new PlayerGameStateMessage(reason, GameMode.get(gameMode));
  }
View Full Code Here

TOP

Related Classes of org.spout.vanilla.protocol.msg.player.PlayerGameStateMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.