Update for SpoutAPI scheduler and lighting changes

This commit is contained in:
zml2008 2012-05-26 11:34:26 -07:00
parent b22921ffa6
commit 379189f224
4 changed files with 7 additions and 4 deletions

View File

@ -31,6 +31,7 @@
import org.spout.api.geo.World;
import org.spout.api.material.Material;
import org.spout.api.material.MaterialRegistry;
import org.spout.api.scheduler.TaskPriority;
import java.lang.reflect.Method;
import java.util.ArrayList;
@ -74,7 +75,7 @@ public SpoutBiomeTypes getBiomes() {
@Override
public int schedule(long delay, long period, Runnable task) {
return game.getScheduler().scheduleSyncRepeatingTask(plugin, task, delay, period);
return game.getScheduler().scheduleSyncRepeatingTask(plugin, task, delay * 50, period * 50, TaskPriority.NORMAL);
}
@Override

View File

@ -192,7 +192,7 @@ public int getBlockData(Vector pt) {
*/
@Override
public int getBlockLightLevel(Vector pt) {
return world.getBlockMaterial(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()).getLightLevel();
return world.getBlockLight(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ());
}
/**

View File

@ -39,6 +39,7 @@
import org.spout.api.event.world.WorldLoadEvent;
import org.spout.api.generator.biome.BiomeGenerator;
import org.spout.api.geo.discrete.Point;
import org.spout.api.scheduler.TaskPriority;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -140,7 +141,7 @@ public void onPlayerInteract(PlayerInteractEvent event) {
public void run() {
ignoreLeftClickAir = false;
}
}, 2);
}, 100, TaskPriority.NORMAL);
if (taskId != -1) {
ignoreLeftClickAir = true;

View File

@ -36,6 +36,7 @@
import org.spout.api.geo.World;
import org.spout.api.player.Player;
import org.spout.api.plugin.CommonPlugin;
import org.spout.api.scheduler.TaskPriority;
import org.spout.api.util.Named;
import java.io.*;
@ -100,7 +101,7 @@ public void onEnable() {
registerEvents();
getGame().getScheduler().scheduleAsyncRepeatingTask(this,
new SessionTimer(controller, getGame()), 120, 120);
new SessionTimer(controller, getGame()), 6 * 1000, 6 * 1000, TaskPriority.LOWEST);
}
/**