Interface Platform
- All Superinterfaces:
Keyed
- All Known Subinterfaces:
MultiUserPlatform
- All Known Implementing Classes:
AbstractPlatform
Represents a platform that WorldEdit has been implemented for.
It is strongly recommended that implementations extend from
AbstractPlatform
.
-
Method Summary
Modifier and TypeMethodDescriptionGet 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.Get the configuration from this platform.Get a DataFixer capable of upgrading old data.int
Gets the Minecraft data version being used by the platform.default String
getId()
The id of this object in the registry.Get a friendly name of the platform.default IBatchProcessor
getPlatformPostProcessor
(boolean fastMode) Get aIBatchProcessor
to be used in edit post-processing.default IBatchProcessor
getPlatformProcessor
(boolean fastMode) Get aIBatchProcessor
to be used in edit processing.Get the version of the platform, which can be anything.Gets the registry holder.Get theRelighterFactory
that can be used to obtainRelighter
s.Return the resource loader.Get a set ofSideEffect
s supported by this platform.Get the version of WorldEdit that this platform provides.default Watchdog
Get the watchdog service.Get a list of available or loaded worlds.boolean
isValidMobType
(String type) Checks if a mob type is valid.matchPlayer
(Player player) Create a duplicate of the given player.matchWorld
(World world) Create a duplicate of the given world.void
registerCommands
(CommandManager commandManager) Register the commands contained within the given command manager.default void
Deprecated.void
reload()
Reload WorldEdit configuration.int
Schedules the giventask
to be invoked once everyperiod
ticks after an initial delay ofdelay
ticks.void
setGameHooksEnabled
(boolean enabled) Set if the game hooks are enabled for this platform.int
Get the default maximum Y value of worlds based on Minecraft version (inclusive).int
Get the default minimum Y value of worlds based on Minecraft version (inclusive).
-
Method Details
-
getResourceLoader
ResourceLoader getResourceLoader()Return the resource loader.- Returns:
- The resource loader
-
getRegistries
Registries getRegistries()Gets the registry holder.- Returns:
- The registry holder
-
getDataVersion
int getDataVersion()Gets the Minecraft data version being used by the platform.- Returns:
- the data version
-
getDataFixer
DataFixer getDataFixer()Get a DataFixer capable of upgrading old data.- Returns:
- a data fixer, or null if not supported by this platform
-
isValidMobType
Checks if a mob type is valid.- Parameters:
type
- The mob type name to check- Returns:
- Whether the name is a valid mod type
-
reload
void reload()Reload WorldEdit configuration. -
schedule
Schedules the giventask
to be invoked once everyperiod
ticks after an initial delay ofdelay
ticks.- Parameters:
delay
- Delay in server ticks before executing first repeatperiod
- Period in server ticks of the tasktask
- Task to be executed- Returns:
- Task id number (-1 if scheduling failed)
-
getWatchdog
Get the watchdog service.- Returns:
- the watchdog service, or
null
if none
-
getWorlds
Get a list of available or loaded worlds.- Returns:
- a list of worlds
-
matchPlayer
Create a duplicate of the given player.The given player may have been provided by a different platform.
- Parameters:
player
- the player to match- Returns:
- a matched player, otherwise null
-
matchWorld
Create a duplicate of the given world.The given world may have been provided by a different platform.
- Parameters:
world
- the world to match- Returns:
- a matched world, otherwise null
-
registerCommands
Register the commands contained within the given command manager.This method should be ignored if the platform offers a command registration event.
- Parameters:
commandManager
- the command manager
-
registerGameHooks
Deprecated.CallsetGameHooksEnabled(boolean)
withtrue
insteadRegister game hooks. -
setGameHooksEnabled
void setGameHooksEnabled(boolean enabled) Set if the game hooks are enabled for this platform. -
getConfiguration
LocalConfiguration getConfiguration()Get the configuration from this platform.- Returns:
- the configuration
-
getVersion
String getVersion()Get the version of WorldEdit that this platform provides.This version should match WorldEdit releases because it may be checked to match.
- Returns:
- the version
-
getPlatformName
String getPlatformName()Get a friendly name of the platform.The name can be anything (reasonable). An example name may be "Bukkit" or "Forge".
- Returns:
- the platform name
-
getPlatformVersion
String getPlatformVersion()Get the version of the platform, which can be anything.- Returns:
- the platform version
-
getCapabilities
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.- Returns:
- a map of capabilities
-
getSupportedSideEffects
Set<SideEffect> getSupportedSideEffects()Get a set ofSideEffect
s supported by this platform.- Returns:
- A set of supported side effects
-
getId
@NonAbstractForCompatibility(delegateName="getPlatformName", delegateParams={}) default String getId()The id of this object in the registry. Must be unique, and lowercase. Certain registries (e.g Namespaced ones) may have additional restrictions. -
getRelighterFactory
Get theRelighterFactory
that can be used to obtainRelighter
s.- Returns:
- the relighter factory to be used.
-
versionMinY
int versionMinY()Get the default minimum Y value of worlds based on Minecraft version (inclusive).- Since:
- 2.0.0
-
versionMaxY
int versionMaxY()Get the default maximum Y value of worlds based on Minecraft version (inclusive).- Since:
- 2.0.0
-
getPlatformProcessor
Get aIBatchProcessor
to be used in edit processing. Null if not required.- Since:
- 2.1.0
-
getPlatformPostProcessor
Get aIBatchProcessor
to be used in edit post-processing. Used for things such as tick-placed and tick fluids. Null if not required.- Since:
- 2.1.0
-
setGameHooksEnabled(boolean)
withtrue
instead