Bridge - Hytale World Management Library
A powerful Hytale plugin library for creating, managing, and orchestrating temporary worlds with ease. Bridge provides a robust API for handling world lifecycle, player transfers, and customizable world behavior.
✨ Features
- Easy World Management: Create, activate, deactivate, and delete worlds with simple API calls
- Player Transfers: Safely move players between worlds with built-in thread safety
- Custom World Behavior: Extend `BridgeWorldComponent` to add custom logic to your worlds
- Asynchronous Operations: Most operations run asynchronously with optional callbacks
- World Configuration: Control block breaking, placement, gathering, and PvP settings
- Lifecycle Events: Hook into world creation, deletion, and player events
📖 API Reference
BridgeWorldManager:
- createWorld(String name, BridgeWorldComponent component, Consumer<BridgeWorld> callback)
- getAllVBridgeWorlds() - Get all managed worlds
- getDefaultWorldAsBridgeWorld() - Get the default world
- deleteWorld(BridgeWorld world) - Permanently delete a world
- activateWorld(BridgeWorld world, Consumer<BridgeWorld> callback)
- deactivateWorld(BridgeWorld world, World movePlayersTo)
BridgeWorld:
- activate(Consumer<BridgeWorld> callback) - Load world into memory
- deactivate(World movePlayersTo)` - Unload world
- transferPlayer(PlayerRef player) - Move player to this world
- delete() - Delete this world and its files
- setAllowPvP(boolean enabled) - Toggle PvP
- setAllowBlockBreaking(boolean enabled) - Toggle block breaking
BridgeWorldComponent Lifecycle Methods:
- onCreateWorld(BridgeWorld world)` - When world is created
- onDeleteWorld(BridgeWorld world)` - Before world deletion
- onPlayerJoinWorld(BridgeWorld world, PlayerRef player)`
- onPlayerLeaveWorld(BridgeWorld world, PlayerRef player)`
- onPlayerDieInWorld(BridgeWorld world, PlayerRef player)`
- onTick(BridgeWorld world, float deltaTime)` - Called every tick

