当前位置: 首页>>代码示例>>Java>>正文


Java MatchState.PLAYING属性代码示例

本文整理汇总了Java中in.twizmwaz.cardinal.match.MatchState.PLAYING属性的典型用法代码示例。如果您正苦于以下问题:Java MatchState.PLAYING属性的具体用法?Java MatchState.PLAYING怎么用?Java MatchState.PLAYING使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在in.twizmwaz.cardinal.match.MatchState的用法示例。


在下文中一共展示了MatchState.PLAYING属性的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onServerListPing

@EventHandler(priority = EventPriority.HIGHEST)
public void onServerListPing(ServerListPingEvent event) {
    try {
        String name = match.getLoadedMap().getName();
        if (match.getState() == MatchState.ENDED) {
            event.setMotd(ChatColor.RED + "\u00BB " + ChatColor.AQUA + name + ChatColor.RED + " \u00AB");
        } else if (match.getState() == MatchState.PLAYING) {
            event.setMotd(ChatColor.GOLD + "\u00BB " + ChatColor.AQUA + name + ChatColor.GOLD + " \u00AB");
        } else if (match.getState() == MatchState.STARTING) {
            event.setMotd(ChatColor.GREEN + "\u00BB " + ChatColor.AQUA + name + ChatColor.GREEN + " \u00AB");
        } else {
            event.setMotd(ChatColor.GRAY + "\u00BB " + ChatColor.AQUA + name + ChatColor.GRAY + " \u00AB");
        }
    } catch (NullPointerException ex) {

    }
}
 
开发者ID:dentmaged,项目名称:Cardinal-Plus,代码行数:17,代码来源:MOTD.java

示例2: onMatchStart

/**
 * Spawn all players when the match starts.
 *
 * @param event The event.
 */
@EventHandler
public void onMatchStart(MatchChangeStateEvent event) {
  if (event.getState() == MatchState.PLAYING) {
    for (Player player : event.getMatch()) {
      Spawn spawn = ListUtil.getRandom(getSpawns(event.getMatch(), event.getMatch().getPlayingContainer(player)));
      Bukkit.getPluginManager().callEvent(new CardinalRespawnEvent(player, spawn));
    }
  }
}
 
开发者ID:CardinalDevelopment,项目名称:Cardinal,代码行数:14,代码来源:SpawnModule.java

示例3: onBlockPlace

@EventHandler
public void onBlockPlace(BlockPlaceEvent event) {
    if (TeamUtils.getTeamByPlayer(event.getPlayer()).isObserver() || match.getState() != MatchState.PLAYING)
        return;
    if (event.getBlock().getY() >= height && !event.isCancelled()) {
        event.setCancelled(true);
        event.getPlayer().closeInventory();
        ChatUtils.sendWarningMessage(event.getPlayer(), "You have reached the maximum build height! " + ChatColor.GRAY + "(" + height + " blocks)");
    }
    if ((event.getBlock().getType().equals(Material.ACACIA_DOOR) || event.getBlock().getType().equals(Material.BIRCH_DOOR) || event.getBlock().getType().equals(Material.DARK_OAK_DOOR) || event.getBlock().getType().equals(Material.IRON_DOOR) || event.getBlock().getType().equals(Material.JUNGLE_DOOR) || event.getBlock().getType().equals(Material.SPRUCE_DOOR) || event.getBlock().getType().equals(Material.WOOD_DOOR) || event.getBlock().getType().equals(Material.WOODEN_DOOR) || event.getBlock().getType().equals(Material.LONG_GRASS)) && event.getBlock().getY() + 1 >= height) {
        event.setCancelled(true);
        event.getPlayer().closeInventory();
        ChatUtils.sendWarningMessage(event.getPlayer(), "You have reached the maximum build height! " + ChatColor.GRAY + "(" + height + " blocks)");
    }
}
 
开发者ID:dentmaged,项目名称:Cardinal-Plus,代码行数:15,代码来源:BuildHeight.java

示例4: onBlockBreak

@EventHandler
public void onBlockBreak(BlockBreakEvent event) {
    if (TeamUtils.getTeamByPlayer(event.getPlayer()).isObserver() || match.getState() != MatchState.PLAYING)
        return;
    if (event.getBlock().getY() >= height && !event.isCancelled()) {
        event.setCancelled(true);
        ChatUtils.sendWarningMessage(event.getPlayer(), "You have reached the maximum build height! " + ChatColor.GRAY + "(" + height + " blocks)");
    }
}
 
开发者ID:dentmaged,项目名称:Cardinal-Plus,代码行数:9,代码来源:BuildHeight.java

示例5: onEmptyBucket

@EventHandler
public void onEmptyBucket(PlayerBucketEmptyEvent event) {
    if (TeamUtils.getTeamByPlayer(event.getPlayer()).isObserver() || match.getState() != MatchState.PLAYING)
        return;
    Block toFill = event.getBlockClicked().getRelative(event.getBlockFace());
    if (toFill.getY() >= height && !event.isCancelled()) {
        event.setCancelled(true);
        ChatUtils.sendWarningMessage(event.getPlayer(), "You have reached the maximum build height! " + ChatColor.GRAY + "(" + height + " blocks)");
    }
}
 
开发者ID:dentmaged,项目名称:Cardinal-Plus,代码行数:10,代码来源:BuildHeight.java

示例6: onFillBucket

@EventHandler
public void onFillBucket(PlayerBucketFillEvent event) {
    if (TeamUtils.getTeamByPlayer(event.getPlayer()).isObserver() || match.getState() != MatchState.PLAYING)
        return;
    Block toEmpty = event.getBlockClicked().getRelative(event.getBlockFace());
    if (toEmpty.getY() >= height && !event.isCancelled()) {
        event.setCancelled(true);
        ChatUtils.sendWarningMessage(event.getPlayer(), "You have reached the maximum build height! " + ChatColor.GRAY + "(" + height + " blocks)");
    }
}
 
开发者ID:dentmaged,项目名称:Cardinal-Plus,代码行数:10,代码来源:BuildHeight.java

示例7: startTimer

public boolean startTimer(int seconds) {
    if (match.getState() != MatchState.PLAYING) {
        setOriginalState(match.getState());
        setTime(seconds);
        setCancelled(false);
        return true;
    } else return false;
}
 
开发者ID:dentmaged,项目名称:Cardinal-Plus,代码行数:8,代码来源:CycleTimerModule.java

示例8: onInventoryClick

@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
    if (event.getWhoClicked() instanceof Player) {
        if (TeamUtils.getTeamByPlayer((Player) event.getWhoClicked()).isObserver() || match.getState() != MatchState.PLAYING) {
            if (event.getInventory().getType() != InventoryType.PLAYER) {
                event.setCancelled(true);
            }
        }
    }
}
 
开发者ID:dentmaged,项目名称:Cardinal-Plus,代码行数:10,代码来源:ObserverModule.java

示例9: onPlayerTeamChange

@EventHandler
public void onPlayerTeamChange(PlayerChangeTeamEvent event) {
    if (event.getNewTeam().isObserver() || match.getState() != MatchState.PLAYING) {
        event.getPlayer().setGameMode(GameMode.CREATIVE);
        event.getPlayer().setAffectsSpawning(false);
    } else {
        event.getPlayer().setAffectsSpawning(true);
    }
}
 
开发者ID:dentmaged,项目名称:Cardinal-Plus,代码行数:9,代码来源:ObserverModule.java

示例10: end

@Command(aliases = {"end", "finish"}, desc = "Ends the match.", usage = "[team]")
@CommandPermissions("cardinal.match.end")
public static void end(CommandContext cmd, CommandSender sender) throws CommandException {
    if (GameHandler.getGameHandler().getMatch().getState() == MatchState.PLAYING) {
        try {
            TeamModule team = TeamUtils.getTeamByName(cmd.getString(0));
            GameHandler.getGameHandler().getMatch().end(team);
        } catch (IndexOutOfBoundsException ex) {
            GameHandler.getGameHandler().getMatch().end(null);
        }

    } else throw new CommandException(new LocalizedChatMessage(ChatConstant.ERROR_NO_END).getMessage(ChatUtils.getLocale(sender)));
}
 
开发者ID:dentmaged,项目名称:Cardinal-Plus,代码行数:13,代码来源:StartAndEndCommand.java

示例11: onBlockChange

@EventHandler
public void onBlockChange(BlockPlaceEvent event) {
    if (TeamUtils.getTeamByPlayer(event.getPlayer()).isObserver() || match.getState() != MatchState.PLAYING) {
        event.setCancelled(true);
    }
}
 
开发者ID:dentmaged,项目名称:Cardinal-Plus,代码行数:6,代码来源:ObserverModule.java

示例12: onPlayerPickupExperience

@EventHandler
public void onPlayerPickupExperience(PlayerPickupExperienceEvent event) {
    if (TeamUtils.getTeamByPlayer(event.getPlayer()).isObserver() || match.getState() != MatchState.PLAYING) {
        event.setCancelled(true);
    }
}
 
开发者ID:dentmaged,项目名称:Cardinal-Plus,代码行数:6,代码来源:ObserverModule.java

示例13: onPlayerDropItem

@EventHandler
public void onPlayerDropItem(PlayerDropItemEvent event) {
    if (TeamUtils.getTeamByPlayer(event.getPlayer()).isObserver() || match.getState() != MatchState.PLAYING) {
        event.getItemDrop().remove();
    }
}
 
开发者ID:dentmaged,项目名称:Cardinal-Plus,代码行数:6,代码来源:ObserverModule.java


注:本文中的in.twizmwaz.cardinal.match.MatchState.PLAYING属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。