mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-11-20 02:45:00 +00:00
Update for SpoutAPI scheduler and lighting changes
This commit is contained in:
parent
b22921ffa6
commit
379189f224
@ -31,6 +31,7 @@ import org.spout.api.Engine;
|
||||
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 class SpoutServerInterface extends ServerInterface {
|
||||
|
||||
@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
|
||||
|
@ -192,7 +192,7 @@ public class SpoutWorld extends LocalWorld {
|
||||
*/
|
||||
@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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -39,6 +39,7 @@ import org.spout.api.event.server.PreCommandEvent;
|
||||
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 class WorldEditListener implements Listener {
|
||||
public void run() {
|
||||
ignoreLeftClickAir = false;
|
||||
}
|
||||
}, 2);
|
||||
}, 100, TaskPriority.NORMAL);
|
||||
|
||||
if (taskId != -1) {
|
||||
ignoreLeftClickAir = true;
|
||||
|
@ -36,6 +36,7 @@ import org.spout.api.command.CommandSource;
|
||||
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 class WorldEditPlugin extends CommonPlugin implements Named {
|
||||
registerEvents();
|
||||
|
||||
getGame().getScheduler().scheduleAsyncRepeatingTask(this,
|
||||
new SessionTimer(controller, getGame()), 120, 120);
|
||||
new SessionTimer(controller, getGame()), 6 * 1000, 6 * 1000, TaskPriority.LOWEST);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user