@Override
 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);
       }
       if (!event.isCancelled()) {
         player.openScreen(ScreenType.GAME_SCREEN, false);
       }
       break;
     case Open:
       event =
           new ScreenOpenEvent(
               player, player.getMainScreen().getActivePopup(), ScreenType.getType(this.screen));
       Bukkit.getServer().getPluginManager().callEvent(event);
       if (event.isCancelled()) {
         PopupScreen screen = player.getMainScreen().getActivePopup();
         if (screen != null) {
           screen.setDirty(true);
           player.sendImmediatePacket(new PacketWidget(screen, screen.getId()));
         }
       } else {
         player.openScreen(ScreenType.getType(this.screen), false);
       }
       break;
   }
 }
 @Override
 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.sendPacket(new PacketScreenAction(ScreenAction.Close, ScreenType.CUSTOM_SCREEN));
   activePopup = null;
   player.openScreen(ScreenType.GAME_SCREEN, false);
   return true;
 }