
桥
一个强大的Hytale插件库,用于轻松创建、管理和编排临时世界。
Bridge - Hytale 世界管理库
一个强大的 Hytale 插件库,用于轻松创建、管理和编排临时世界。Bridge 提供了强大的 API 来处理世界生命周期、玩家转移和可定制的世界行为。
✨ 特性
- 轻松的世界管理:通过简单的 API 调用创建、激活、停用和删除世界
- 玩家转移:内置线程安全,安全地在世界之间移动玩家
- 自定义世界行为:扩展
BridgeWorldComponent为世界添加自定义逻辑 - 异步操作:大多数操作异步运行,支持可选回调
- 世界配置:控制方块破坏、放置、采集和 PvP 设置
- 生命周期事件:挂钩世界创建、删除和玩家事件
📖 API 参考
BridgeWorldManager:
- createWorld(String name, BridgeWorldComponent component, Consumer callback)
- getAllVBridgeWorlds() - 获取所有管理的世界
- getDefaultWorldAsBridgeWorld() - 获取默认世界
- deleteWorld(BridgeWorld world) - 永久删除世界
- activateWorld(BridgeWorld world, Consumer callback)
- deactivateWorld(BridgeWorld world, World movePlayersTo)
BridgeWorld:
- activate(Consumer callback) - 将世界加载到内存中
- deactivate(World movePlayersTo) - 卸载世界
- transferPlayer(PlayerRef player) - 将玩家转移到此世界
- delete() - 删除此世界及其文件
- setAllowPvP(boolean enabled) - 切换 PvP
- setAllowBlockBreaking(boolean enabled) - 切换方块破坏
BridgeWorldComponent 生命周期方法:
- onCreateWorld(BridgeWorld world) - 世界创建时
- onDeleteWorld(BridgeWorld world) - 世界删除前
- onPlayerJoinWorld(BridgeWorld world, PlayerRef player)
- onPlayerLeaveWorld(BridgeWorld world, PlayerRef player)
- onPlayerDieInWorld(BridgeWorld world, PlayerRef player)
- onTick(BridgeWorld world, float deltaTime) - 每个游戏刻调用
正在加载版本记录…
正在加载评论…
评论在新手盒子客户端中发表,这里同步展示。