Fabric Server API
一个面向 Fabric 的服务端 API,旨在大幅简化服务端模组的开发。
我们的目标是将 Fabric 服务端模组打造为更加稳定且愉快的体验。
热键菜单
目前的热键菜单仅允许用户传送回出生点。未来它将支持更多功能,包括其他服务端模组的配置界面、替代类型的 TPA(玩家间传送)、交易、决斗等。
要使用当前的“传送至出生点”功能,管理员必须首先通过右上角的“ADMIN”按钮在菜单中设置出生点。这需要玩家拥有 OP 权限,或具备 serverapi.admin 权限。
预计在未来几个月内,热键菜单系统将增加更多功能(希望如此)。
事件
- PlayerEvents.JUMP
- 针对所有 ServerPlayerEntity 的可取消跳跃事件
- PlayerEvents.SNEAK
- 针对所有 ServerPlayerEntity 的可取消潜行事件
- PlayerEvents.BLOCK_BREAK
ServerUtils
一个实用工具类,包含一系列静态方法供你使用!
Block getBlockByTag(Identifier);
ItemStack getHeadFromRaw(String rawId);
void setStackModelData(ItemStack, int); // 适用于资源包
void setStackLore(ItemStack, List<MutableText>);
MutableText getText(String, Formatting...);
ServerAPI
这是访问……或者至少是未来计划中的主要 API。目前仅限有限使用!
ServerPlayerEntity getPlayerByUUID(UUID, MinecraftServer);
ServerAPI.Logger
- 提供带有颜色属性的字符串,用于向日志控制台输出彩色文本。由于可能被滥用,未来版本可能会通过配置选项默认禁用此功能?
String Success(String); // 绿色
String Warning(String); // 黄色
String Error(String); // 红色
String Debug (String); // 青色
未来目标 - 更远期规划
- 一个 "ServerPlayer" 类,将抽象处理与服务端 Fabric 模组交互时涉及玩家类的许多“复杂”操作。
- 更多的自定义事件。
- 更简便的配置文件管理方式,方便你的服务端模组使用!
- 轻松读取/写入离线玩家数据。
- 为你的服务端模组提供 GUI 配置管理功能。
注意:
“瓶子”及其相关概念已被废弃。抱歉让大家期待落空了!
Fabric Server API
A server api for Fabric aiming to simplify server-side mods significantly.
With big goals of make server-sided fabric a much more stable and enjoyable
experience.
Hotkey Menu
- Currently bound to Shift+F
- DISABLED by default
- Enable via the config file for ServerAPI
The hotkey menu currently just allows users to teleport to spawn. In the future it will allow MUCH more including configuration screens for other server-side mods, alternative type of TPA, trading, dueling, and many others.
To use the current "teleport to spawn" feature, admins must first set spawn in the menu via the "ADMIN" button on the top-right of it. This will require either the player be an OP, or that they have the serverapi.admin permission.
More features for the Hotkey Menu system in the coming months(hopefully).
Events
- PlayerEvents.JUMP
- A cancelable jump event for all ServerPlayerEntity
- PlayerEvents.SNEAK
- A cancelable sneak event for all ServerPlayerEntity
- PlayerEvents.BLOCK_BREAK
- A cancelable event for when a player breaks a block
ServerUtils
A utility class featuring a array of static methods for you to use!
Block getBlockByTag(Identifier);
ItemStack getHeadFromRaw(String rawId);
void setStackModelData(ItemStack, int); // For resource packs
void setStackLore(ItemStack, List<MutableText>);
MutableText getText(String, Formatting...);
ServerAPI
The "main" API to access... or at least thats the goal for the future. Limited use for now!
ServerPlayerEntity getPlayerByUUID(UUID, MinecraftServer);
ServerAPI.Logger
- Gives a string infused with color attributes for you to log colored text to the console. Abusable so may be disabled by default in future versions via a config option?
String Success(String); // green color
String Warning(String); // yellow color
String Error(String); // Red color
String Debug (String); // cyan color
Future Goals - Further Out
- A "ServerPlayer" class that would abstract a lot of the more
"complex" things about dealing with server-sided fabric mods that
interact directly with the Player class.
- A lot more events.
- Easier configuration file management for YOUR server-side mods!
- Easily read/write from offline players.
- GUI configuration management for your server-side mods.
Notice:
Bottles and all of its relations have been scrapped as a concept. Sorry for the hype!
评论 0
登录后参与评分
还没有评论,来抢沙发吧