Class CreativeHubPlugin

All Implemented Interfaces:
CommandOwner

public class CreativeHubPlugin extends JavaPlugin
Plugin for Creative Hub functionality.

Provides a hub-based creative mode where players spawn in a lobby instance and can use portals to access different permanent creative worlds.

  • Constructor Details

    • CreativeHubPlugin

      public CreativeHubPlugin(@Nonnull JavaPluginInit init)
  • Method Details

    • get

      public static CreativeHubPlugin get()
    • getOrSpawnHubInstance

      @Nonnull public World getOrSpawnHubInstance(@Nonnull World parentWorld, @Nonnull CreativeHubWorldConfig hubConfig, @Nonnull Transform returnPoint)
      Gets or spawns the shared hub instance for the given parent world. If an instance already exists and is still valid, returns it. Otherwise, spawns a new instance.
      Parameters:
      parentWorld - The parent Creative Hub world.
      hubConfig - The hub configuration.
      returnPoint - The spawn point in the parent world.
      Returns:
      The hub instance world.
    • getActiveHubInstance

      @Nullable public World getActiveHubInstance(@Nonnull World parentWorld)
      Gets the active hub instance for the given parent world, if one exists.
      Parameters:
      parentWorld - The parent Creative Hub world.
      Returns:
      The active hub instance, or null if none exists.
    • clearHubInstance

      public void clearHubInstance(@Nonnull UUID parentWorldUuid)
      Clears the hub instance reference for the given parent world UUID. Called when the hub instance is removed.
      Parameters:
      parentWorldUuid - The parent world UUID.
    • spawnPermanentWorldFromTemplate

      @Nonnull public CompletableFuture<World> spawnPermanentWorldFromTemplate(@Nonnull String instanceAssetName, @Nonnull String permanentWorldName, @Nullable Consumer<WorldConfig> configCustomizer)
      Creates or loads a permanent world from an instance asset template.

      Unlike InstancesPlugin.spawnInstance(String, World, Transform) which creates temporary instance copies, this creates a permanent world that persists across server restarts and retains all player modifications.

      If the world already exists, it will be loaded. Otherwise, the instance asset files will be copied to create a new permanent world.

      Parameters:
      instanceAssetName - The name of the instance asset to use as template.
      permanentWorldName - The name for the permanent world.
      Returns:
      A future that will resolve to the created/loaded world.
    • getCreativeHubEntityConfigComponentType

      @Nonnull public ComponentType<EntityStore, CreativeHubEntityConfig> getCreativeHubEntityConfigComponentType()
      Returns:
      the component type for CreativeHubEntityConfig.