public class ServerInterfaceAdapter extends ServerInterface
Platform
s into the legacy ServerInterface
.Modifier and Type | Method and Description |
---|---|
static ServerInterface |
adapt(Platform platform)
Adapt an
Platform instance into a ServerInterface . |
java.util.Map<Capability,Preference> |
getCapabilities()
Get a map of advertised capabilities of this platform, where each key
in the given map is a supported capability and the respective value
indicates the preference for this platform for that given capability.
|
LocalConfiguration |
getConfiguration()
Get the configuration from this platform.
|
java.lang.String |
getPlatformName()
Get a friendly name of the platform.
|
java.lang.String |
getPlatformVersion()
Get the version of the platform, which can be anything.
|
java.lang.String |
getVersion()
Get the version of WorldEdit that this platform provides.
|
java.util.List<? extends World> |
getWorlds()
Get a list of available or loaded worlds.
|
boolean |
isValidMobType(java.lang.String type)
Checks if a mob type is valid.
|
Player |
matchPlayer(Player player)
Create a duplicate of the given player.
|
World |
matchWorld(World world)
Create a duplicate of the given world.
|
void |
registerCommands(Dispatcher dispatcher)
Register the commands contained within the given command dispatcher.
|
void |
registerGameHooks()
Register game hooks.
|
void |
reload()
Reload WorldEdit configuration.
|
int |
resolveItem(java.lang.String name)
Resolves an item name to its ID.
|
int |
schedule(long delay,
long period,
java.lang.Runnable task)
Schedules the given
task to be invoked once every
period ticks after an initial delay of delay ticks. |
public int resolveItem(java.lang.String name)
Platform
name
- The name to look uppublic boolean isValidMobType(java.lang.String type)
Platform
type
- The mob type name to checkpublic void reload()
Platform
public int schedule(long delay, long period, java.lang.Runnable task)
Platform
task
to be invoked once every
period
ticks after an initial delay of delay
ticks.schedule
in interface Platform
schedule
in class AbstractPlatform
delay
- Delay in server ticks before executing first repeatperiod
- Period in server ticks of the tasktask
- Task to be executedpublic java.util.List<? extends World> getWorlds()
Platform
getWorlds
in interface Platform
getWorlds
in class AbstractPlatform
@Nullable public Player matchPlayer(Player player)
Platform
The given player may have been provided by a different platform.
player
- the player to match@Nullable public World matchWorld(World world)
Platform
The given world may have been provided by a different platform.
world
- the world to matchpublic void registerCommands(Dispatcher dispatcher)
Platform
dispatcher
- the dispatcherpublic void registerGameHooks()
Platform
public LocalConfiguration getConfiguration()
Platform
public java.lang.String getVersion()
Platform
This version should match WorldEdit releases because it may be checked to match.
public java.lang.String getPlatformName()
Platform
The name can be anything (reasonable). An example name may be "Bukkit" or "Forge".
public java.lang.String getPlatformVersion()
Platform
public java.util.Map<Capability,Preference> getCapabilities()
Platform
public static ServerInterface adapt(Platform platform)
Platform
instance into a ServerInterface
.platform
- the platform