Contents
Class TeleportPlugin
java.lang.Object
com.hypixel.hytale.server.core.plugin.PluginBase
com.hypixel.hytale.server.core.plugin.JavaPlugin
com.hypixel.hytale.builtin.teleport.TeleportPlugin
- All Implemented Interfaces:
CommandOwner
Teleport Plugin
A plugin that provides teleportation functionality, including warp points, teleport commands, and teleport history tracking.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordWarp Componentstatic classWarp POI Provider -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe asset ID of the model used for warp point entities.Fields inherited from class PluginBase
METRICS_REGISTRY -
Constructor Summary
ConstructorsConstructorDescriptionTeleportPlugin(JavaPluginInit init) Default Constructor for aTeleportPlugininstance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanHelper for adding a new Warp, handling the creation of its associated Warp entity, cleanup of any existing Warp entities that the new warp replaces, and saving the changes to disk.createWarp(Warp warp, Store<EntityStore> store) Creates a entity holder containing a warp point marker entity that represents the given warp point.static TeleportPluginget()getWarps()booleanvoidCalled to load all warps from the configuration file.booleanremoveWarp(String warpName) Helper for removing a Warp by name, handling the cleanup of any associated Warp entities which may be present, and saving the changes to disk.voidCalled to save all warps to the configuration file.Methods inherited from class JavaPlugin
getClassLoader, getFile, getTypeMethods inherited from class PluginBase
getAssetRegistry, getBasePermission, getChunkStoreRegistry, getClientFeatureRegistry, getCodecRegistry, getCodecRegistry, getCodecRegistry, getCommandRegistry, getDataDirectory, getEntityRegistry, getEntityStoreRegistry, getEventRegistry, getIdentifier, getLogger, getManifest, getName, getState, getTaskRegistry, isDisabled, isEnabled, preLoad
-
Field Details
-
WARP_MODEL_ID
The asset ID of the model used for warp point entities.- See Also:
-
-
Constructor Details
-
TeleportPlugin
Default Constructor for aTeleportPlugininstance.- Parameters:
init- The plugin initialization step for this plugin.
-
-
Method Details
-
get
- Returns:
- the static instance of the
TeleportPlugin.
-
getTeleportHistoryComponentType
- Returns:
- the component type for the
TeleportHistorycomponent.
-
isWarpsLoaded
public boolean isWarpsLoaded()- Returns:
trueif warps have been loaded,falseotherwise.
-
loadWarps
public void loadWarps()Called to load all warps from the configuration file. -
saveWarps
public void saveWarps()Called to save all warps to the configuration file. -
getWarps
-
createWarp
@Nonnull public Holder<EntityStore> createWarp(@Nonnull Warp warp, @Nonnull Store<EntityStore> store) Creates a entity holder containing a warp point marker entity that represents the given warp point. -
addWarp
Helper for adding a new Warp, handling the creation of its associated Warp entity, cleanup of any existing Warp entities that the new warp replaces, and saving the changes to disk.> This method can be safely called from any thread, deferring any operations that need to happen on a specific world-thread appropriately.
- Parameters:
warp- The warp instance to be added. Must not be null and should contain a valid identifier.replace- Flag indicating whether to replace the existing warp if one exists for the given identifier.- Returns:
trueif the warp was successfully added,falseif a warp with the same identifier already exists.
-
removeWarp
Helper for removing a Warp by name, handling the cleanup of any associated Warp entities which may be present, and saving the changes to disk.This method can be safely called from any thread, deferring any operations that need to happen on a specific world-thread appropriately.
- Parameters:
warpName- The name of the warp to be removed. Must not be null. The name is case-insensitive and will be processed in lowercase.- Returns:
trueif the warp was successfully removed,falseif no warp with the specified name could be found.
-