/** * Pulses the world border for each tick. * * <p>Attempts to call this method more than once per tick will be ignored. */ public void pulse() { if (lastWorldTick >= world.getFullTime()) { // The pulse method is being called more than once per tick; abort. return; } lastWorldTick = world.getFullTime(); if (step != 0) { size += step; if (Math.abs(size - sizeLerpTarget) < 1) { // completed size = sizeLerpTarget; sizeLerpTime = 0; step = 0; } } }
/** * Initializes a new {@link WorldBorder} for the given world. * * @param world the world to initialize a new {@link WorldBorder} for. */ public GlowWorldBorder(World world) { this.world = world; lastWorldTick = world.getFullTime(); size = 60000000; sizeLerpTime = 0; sizeLerpTarget = size; step = 0; center = new Location(world, 0, 0, 0); damageBuffer = 5; damageAmount = 0.2; warningTime = 15; warningDistance = 5; }
world.setFullTime(world.getFullTime() + value);
this.z = z; this.worldName = world.getName(); captureFullTime = world.getFullTime(); this.isSlimeChunk = isSlimeChunk;
public UndoTimeChange(World world) { this.world = world; this.time = world.getFullTime(); }
public static boolean isFullMoon(final World world) { if (GeneralMethods.hasRPG()) { final String event = EventManager.marker.get(world); return event != null && event.equalsIgnoreCase("FullMoon"); } else { final long days = world.getFullTime() / 24000; final long phase = days % 8; if (phase == 0) { return true; } return false; } }
public long getCurrentTick() { return this.player.getWorld().getFullTime(); }
public synchronized void lock(World world) { long time = world.getFullTime(); unlock(world); int id = CommandBook.server().getScheduler().scheduleSyncRepeatingTask( CommandBook.inst(), new TimeLocker(world, time), 20, config.timeLockDelay); tasks.put(world.getName(), id); }
if (cycleMoonPhase) long currentTime = world.getFullTime(); currentTime = ((currentTime % 24000) + 1) * 24000 + targetTime; world.setFullTime(currentTime);
world.setFullTime(world.getFullTime() + value);
final int expectedTicks = 20 * (int)expectedSecs; final long start = System.currentTimeMillis(); final long startTicks = world.getFullTime();
public void run() { long now = System.currentTimeMillis(); long nowTicks = world.getFullTime();
public boolean checkActive(Location location) { if (!checkRange(minTimeOfDay, maxTimeOfDay, (int)location.getWorld().getTime())) { return false; } if (!checkRange(minPhaseOfMoon, maxPhaseOfMoon, (int)((location.getWorld().getFullTime() / 24000) % 8))) { return false; } if (minPlayers >= 0 && playerRange > 0) { int playerCount = 0; int rangeSquared = playerRange * playerRange; List<Player> players = location.getWorld().getPlayers(); for (Player player : players) { if (player.getLocation().distanceSquared(location) <= rangeSquared) { playerCount++; } } if (playerCount < minPlayers) { return false; } } return true; }
long currentTime = world.getFullTime(); currentTime = ((currentTime % 24000) + 1) * 24000 + targetTime; world.setFullTime(currentTime);
state.append("Full Time", world.getFullTime()); state.append("Weather Duration", world.getWeatherDuration()); state.append("Thunder Duration", world.getThunderDuration());