Interface Platform
- All Known Subinterfaces:
MultiUserPlatform
- All Known Implementing Classes:
AbstractPlatform
public interface Platform
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.Get a friendly name of the platform.Get the version of the platform, which can be anything.Gets the registry holder.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
(org.enginehub.piston.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.
-
Method Details
-
getResourceLoader
ResourceLoader getResourceLoader()Return the resource loader.- Returns:
- The resource loader
-
getTranslationManager
TranslationManager getTranslationManager() -
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
void registerCommands(org.enginehub.piston.CommandManager commandManager) 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
-
setGameHooksEnabled(boolean)
withtrue
instead