Class PlatformManager
java.lang.Object
com.sk89q.worldedit.extension.platform.PlatformManager
Manages registered
Platform
s for WorldEdit. Platforms are
implementations of WorldEdit.
This class is thread-safe.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T extends Actor>
TcreateProxyActor
(T base) Given an actor, return a new one that may use a different platform for permissions and world editing.Get the current configuration.Get the command manager.Get a list of loaded platforms.getWorldForEditing
(World base) Given a world, possibly return the same world but using a different platform preferred for world editing operations.void
void
Internal, do not call.void
Internal, do not call.void
Deprecated.void
Internal, do not call.void
queryCapability
(Capability capability) Get the preferred platform for handling a certain capability.void
Register a platform with WorldEdit.boolean
unregister
(Platform platform) Unregister a platform from WorldEdit.
-
Constructor Details
-
PlatformManager
Create a new platform manager.- Parameters:
worldEdit
- the WorldEdit instance
-
-
Method Details
-
register
Register a platform with WorldEdit.- Parameters:
platform
- the platform
-
unregister
Unregister a platform from WorldEdit.If the platform has been chosen for any capabilities, then a new platform will be found.
- Parameters:
platform
- the platform
-
queryCapability
Get the preferred platform for handling a certain capability. Throws if none are available.- Parameters:
capability
- the capability- Returns:
- the platform
- Throws:
NoCapablePlatformException
- thrown if no platform is capable
-
getPlatforms
Get a list of loaded platforms.The returned list is a copy of the original and is mutable.
- Returns:
- a list of platforms
-
getWorldForEditing
Given a world, possibly return the same world but using a different platform preferred for world editing operations.- Parameters:
base
- the world to match- Returns:
- the preferred world, if one was found, otherwise the given world
-
createProxyActor
Given an actor, return a new one that may use a different platform for permissions and world editing.- Parameters:
base
- the base actor to match- Returns:
- a new delegate actor
-
getPlatformCommandManager
Get the command manager.- Returns:
- the command manager
-
getConfiguration
Get the current configuration.If no platform has been registered yet, then a default configuration will be returned.
- Returns:
- the configuration
-
getSupportedSideEffects
-
handlePlatformReady
Deprecated.You shouldn't have been calling this anyways, but this is now deprecated. Either don't fire this event at all, or fire the new event via the event bus if you're a platform. -
handlePlatformsRegistered
Internal, do not call. -
handleNewPlatformReady
Internal, do not call. -
handleNewPlatformUnready
Internal, do not call. -
handleBlockInteract
-
handlePlayerInput
-