Implemented PlatformManager, Platform over old platform registration method.

This commit is contained in:
sk89q
2014-04-04 20:53:58 -07:00
parent bed5fa8fdc
commit 8fb73347e4
19 changed files with 1275 additions and 373 deletions

View File

@@ -21,6 +21,7 @@ package com.sk89q.worldedit;
import com.sk89q.minecraft.util.commands.Command;
import com.sk89q.minecraft.util.commands.CommandsManager;
import com.sk89q.worldedit.extension.platform.Platform;
import java.util.Collections;
import java.util.List;
@@ -29,58 +30,27 @@ import java.util.List;
*
* @author sk89q
*/
public abstract class ServerInterface {
/**
* Resolves an item name to its ID.
*
* @param name The name to look up
* @return The id that corresponds to the name, or -1 if no such ID exists
*/
public abstract int resolveItem(String name);
public abstract class ServerInterface implements Platform {
/**
* Checks if a mob type is valid.
*
* @param type The mob type name to check
* @return Whether the name is a valid mod bype
*/
public abstract boolean isValidMobType(String type);
/**
* Reload WorldEdit configuration.
*/
public abstract void reload();
/**
* Returns all available biomes.
*
* @return
*/
public abstract BiomeTypes getBiomes();
/**
* Schedules the given <code>task</code> to be invoked once every <code>period</code> ticks
* after an initial delay of <code>delay</code> ticks.
*
* @param delay Delay in server ticks before executing first repeat
* @param period Period in server ticks of the task
* @param task Task to be executed
* @return Task id number (-1 if scheduling failed)
*/
@Override
public int schedule(long delay, long period, Runnable task) {
return -1;
}
@Override
public List<LocalWorld> getWorlds() {
return Collections.emptyList();
}
@Override
@Deprecated
public void onCommandRegistration(List<Command> commands) {
// Do nothing :)
}
@Override
public void onCommandRegistration(List<Command> commands, CommandsManager<LocalPlayer> manager) {
onCommandRegistration(commands);
}
}