public class PlatformManager
extends java.lang.Object
Platform
s for WorldEdit. Platforms are
implementations of WorldEdit.
This class is thread-safe.
Constructor and Description |
---|
PlatformManager(WorldEdit worldEdit)
Create a new platform manager.
|
Modifier and Type | Method and Description |
---|---|
<T extends Actor> |
createProxyActor(T base)
Given an actor, return a new one that may use a different platform
for permissions and world editing.
|
LocalConfiguration |
getConfiguration()
Get the current configuration.
|
PlatformCommandManager |
getPlatformCommandManager()
Get the command manager.
|
java.util.List<Platform> |
getPlatforms()
Get a list of loaded platforms.
|
java.util.Collection<SideEffect> |
getSupportedSideEffects() |
World |
getWorldForEditing(World base)
Given a world, possibly return the same world but using a different
platform preferred for world editing operations.
|
void |
handleBlockInteract(BlockInteractEvent event) |
void |
handlePlatformReady(PlatformReadyEvent event) |
void |
handlePlayerInput(PlayerInputEvent event) |
Platform |
queryCapability(Capability capability)
Get the preferred platform for handling a certain capability.
|
void |
register(Platform platform)
Register a platform with WorldEdit.
|
boolean |
unregister(Platform platform)
Unregister a platform from WorldEdit.
|
public PlatformManager(WorldEdit worldEdit)
worldEdit
- the WorldEdit instancepublic void register(Platform platform)
platform
- the platformpublic boolean unregister(Platform platform)
If the platform has been chosen for any capabilities, then a new platform will be found.
platform
- the platformpublic Platform queryCapability(Capability capability) throws NoCapablePlatformException
capability
- the capabilityNoCapablePlatformException
- thrown if no platform is capablepublic java.util.List<Platform> getPlatforms()
The returned list is a copy of the original and is mutable.
public World getWorldForEditing(World base)
base
- the world to matchpublic <T extends Actor> T createProxyActor(T base)
base
- the base actor to matchpublic PlatformCommandManager getPlatformCommandManager()
public LocalConfiguration getConfiguration()
If no platform has been registered yet, then a default configuration will be returned.
public java.util.Collection<SideEffect> getSupportedSideEffects()
public void handlePlatformReady(PlatformReadyEvent event)
public void handleBlockInteract(BlockInteractEvent event)
public void handlePlayerInput(PlayerInputEvent event)