Bridge
A powerful Hytale plugin library for creating, managing, and orchestrating temporary worlds with ease.
Описание
Библиотека управления Hytale World
Мощная библиотека плагинов Hytale для создания, управления и организации временных миров с легкостью. Bridge предоставляет надежный API для обработки мирового жизненного цикла, переноса игроков и настраиваемого поведения в мире.
Особенности
- Легкое мировое управлениеСоздавать, активировать, деактивировать и удалять миры с помощью простых вызовов API
- Игровые трансферыБезопасное перемещение игроков между мирами со встроенной безопасностью потоков
- Пользовательское мировое поведениеРасширьте «BridgeWorldComponent», чтобы добавить пользовательскую логику в ваши миры
- Асинхронные операции: Большинство операций выполняются асинхронно с дополнительными обратными вызовами
- Мировая конфигурация: Нарушение блока управления, размещение, сбор и настройки PvP
- События жизненного цикла: Погрузитесь в создание мира, удаление и события игроков
API ссылка
BridgeWorldManager:
- createWorld (название строки, компонент BridgeWorldComponent, обратный вызов Consumer<BridgeWorld>)
- GetAllVBridgeWorlds() - Получить все управляемые миры
- GetDefaultWorldAsBridgeWorld() - Получить мир по умолчанию
- удалять Мир (BridgeWorld World) - навсегда удалить мир
- активировать World (BridgeWorld World, Consumer<BridgeWorld> callback)
- деактивировать Мир (BridgeWorld World, World MovePlayers) К)
BridgeWorld:
- Активировать (Consumer<BridgeWorld> callback - Загрузить мир в память)
- Скачать игру World MovePlayersTo - Unload World
- TransferPlayer (PlayerRef Player) - Перенесите игрока в этот мир
- Удалить (удалить) этот мир и его файлы
- setAllowPvP (boolean enabled) - Toggle PvP
- setAllowBlockBreaking (boolean enabled) - блокировка Toggle
Методы жизненного цикла BridgeWorldComponent
- Оригинальное название: BridgeWorld World: When World 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) - Называется каждый тик
Показать оригинальное описание (English)
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