Package org.getspout.spoutapi.event.screen

Examples of org.getspout.spoutapi.event.screen.ScreenCloseEvent


  public void run(int playerId) {
    SpoutPlayer player = SpoutManager.getPlayerFromId(playerId);
    ScreenEvent event;
    switch (ScreenAction.getScreenActionFromId(action)) {
      case Close:
        event = new ScreenCloseEvent(player, player.getMainScreen().getActivePopup(), ScreenType.getType(this.screen));
        Bukkit.getServer().getPluginManager().callEvent(event);
        if (event.isCancelled()) {
          handleScreenCloseCancelled(player, (ScreenCloseEvent) event, true);
        } else if (ScreenType.getType(this.screen) == ScreenType.CUSTOM_SCREEN) {
          handleScreenClose(player, (ScreenCloseEvent) event, true);
View Full Code Here


  public boolean closePopup() {
    if (getActivePopup() == null) {
      return false;
    }
    SpoutPlayer player = SpoutManager.getPlayerFromId(playerId);
    ScreenCloseEvent event = new ScreenCloseEvent(player, getActivePopup(), ScreenType.CUSTOM_SCREEN);
    Bukkit.getServer().getPluginManager().callEvent(event);
    if (event.isCancelled()) {
      return false;
    }
    player.sendImmediatePacket(new PacketScreenAction(ScreenAction.Close, ScreenType.CUSTOM_SCREEN));
    activePopup = null;
    player.openScreen(ScreenType.GAME_SCREEN, false);
View Full Code Here

TOP

Related Classes of org.getspout.spoutapi.event.screen.ScreenCloseEvent

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.