public GameCountdown(final HungerGame game, int num, boolean isResuming) { this.game = game; countdown = num; task = Bukkit.getScheduler().runTaskTimer(HungerGames.getInstance(), this, 20L, 20L).getTaskId(); this.isResuming = isResuming; if (isResuming) { ChatUtils.broadcast( game, "Resuming %s in %s...", game.getName(), GeneralUtils.formatTime(countdown)); } else { ChatUtils.broadcast( game, "Starting %s in %s...", game.getName(), GeneralUtils.formatTime(countdown)); } }
public boolean loadSign( final World w, final int x1, final int x2, final int z1, final int z2, final int y1) { final boolean usingx = (x1 == x2) ? false : true; HungerGames.debug(w + " " + x1 + " " + x2 + " " + z1 + " " + z2 + " " + y1 + " " + usingx); final BlockFace facing = ((org.bukkit.material.Sign) new Location(w, x1, y1, z1).getBlock().getState()).getFacing(); if (usingx) { for (int a = Math.max(x1, x2); a >= Math.min(x1, x2); a--) { final Location l = new Location(w, a, y1, z1); final BlockState b = l.getBlock().getState(); if (b instanceof Sign) { signs.add((Sign) b); LobbyManager.lobbychunks.add(b.getChunk()); HungerGames.debug("usingx - " + b.getLocation().toString()); } else { HungerGames.debug("Not a sign" + b.getType().toString()); return false; } } } else { for (int a = Math.min(z1, z2); a <= Math.max(z1, z2); a++) { HungerGames.debug(a); final Location l = new Location(w, x1, y1, a); final BlockState b = l.getBlock().getState(); if (b instanceof Sign) { signs.add((Sign) b); LobbyManager.lobbychunks.add(b.getChunk()); HungerGames.debug("notx - " + b.getLocation().toString()); } else { HungerGames.debug("Not a sign" + b.getType().toString()); return false; } } } // HungerGames.debug("dir: " + dir); if (facing == BlockFace.NORTH || facing == BlockFace.EAST) { Collections.reverse(signs); } addMsg("HungerGames"); addMsg("Minealot"); addMsg("minealot.com"); addMsg("Game id: " + gameid); update(); return true; }