AngelLib
AngelLib 1.0.0 替换了 FentLib。这是一个破坏性更新:请同时更新依赖此库的模组;不支持旧版包名、模组 ID、网络载荷(payloads)和配置路径。
一个共享代码库与微调/修复模组。

功能特性
- 支持动态 GIF 和 APNG 服务器图标。只需将
server-icon.gif 或 server-icon.apng 文件(或动态 server-icon.png)放入服务器根目录即可。大小限制可配置。HodgePodge 为软依赖,若需使用更大的 GIF 则必须安装(受限于数据包大小上限)。
使用 /reload_icon 命令重新加载图标。同样适用于 server-icon.png。
- 提供用于修改
S00PacketServerInfo 数据包的 API。示例如下:
public class ClientProxy extends CommonProxy {
@Override
public void preInit(FMLPreInitializationEvent event) {
S00PacketServerInfoModifyService.registerDeserializeHandler((response, angellibData, serverData) -> {
if (angellibData.has("server_to_client_payload")) {
// 哇哦,我们收到了返回的数据!!!!
// serverData 包含诸如服务器 IP 等信息
}
});
}
}
```java
public class CommonProxy {
public void preInit(FMLPreInitializationEvent event) {
if (MiscUtil.isServer()) {
S00PacketServerInfoModifyService.registerHandler((response, angelLibPresent) -> {
// angelLibPresent 是一个布尔值,用于指示是否加载了 angellib
return "server_to_client_payload";
// 你可以返回一个 String、S00PacketServerInfoModifyService.KeyValue 或 JsonElement。如果返回非空值,它将被传递回客户端
});
}
}
}
-
/dump_thaumonomicon <可选注释> 命令。从客户端运行它,所有 Thaumcraft 的研究成果将以静态网站的形式导出。注释将显示在页面标题下方,你可以注明此次导出所使用的整合包或模组。

-
/warpdim [dimension ID] 命令。无痛传送至某个维度(主要用于调试)。
-
SessionAccessTokenOverrideMixin 允许通过 -Dangellib.accessTokenOverride=<token> 在开发启动时覆盖会话访问令牌。
-
客户端声音工具,用于在不提高音量的情况下设置自定义最大衰减距离。方法:
SoundUtil.withMaxDistance(ISound sound, float maxDistance);
SoundUtil.playWithMaxDistance(ISound sound, float maxDistance);
SoundUtil.playWithMaxDistance(SoundHandler soundHandler, ISound sound, float maxDistance);
SoundUtil.playAt(ResourceLocation soundResource, double x, double y, double z, float volume, float pitch, float maxDistance);
示例:
SoundUtil.playAt(waveSound, x, y, z, 0.25F, 1.0F, 64.0F);
- 用于本地 Web UI 的 HTTP-on-Minecraft-port 反向代理。在
config/angellib/http-port-routes.json 中配置路径到端口的映射,以便通过服务器端口(例如 /dynmap/...)而非单独的端口访问 Dynmap 等服务。
在 config/angellib/angellib.cfg 中设置 publicBaseUrl 为服务器的公开基础 URL;模组应在其基础上追加自己的相对路由路径。
- QOI 图像格式支持及工具,感谢 saharNooby/qoi-java。使用示例请参考
server-icon.qoi 支持的实现方式。
- WebP 图像格式支持及工具,感谢 haraldk/TwelveMonkeys。使用示例请参考
server-icon.webp 支持的实现方式。
- 默认服务器图标路径可通过
serverIconDirectory 配置项进行设置。
钓鱼掉落配置
在 config/angellib/angellib.cfg 中设置 enableFishingLootTable=true 以启用 AngelLib 的钓鱼覆盖功能。掉落表位于 config/angellib/fishing-loot.json。启用后,原版仍会决定捕获物是 fish(鱼)、junk(杂物)还是 treasure(宝藏),但具体物品仅来自该 JSON 文件。
该 JSON 包含顶层的 fish、junk 和 treasure 列表。每个条目采用原版风格的 weight,支持 count 和 meta 的范围设置,可通过 biomes 限制为生物群系白名单,或通过 invertBiomes 反转为黑名单;生物群系选择器可以是数值 ID、生物群系名称或用于匹配任意生物群系的 *。条目还可以使用显式的数值附魔 ID,或使用 useVanillaEnchantingRules 以原版风格进行随机附魔。
{
"fish": [
{
"item": "minecraft:fish",
"weight": 60,
"count": { "min": 1, "max": 1 },
"meta": { "min": 0, "max": 0 }
},
{
"item": "minecraft:fish",
"weight": 10,
"count": { "min": 1, "max": 2 },
"meta": { "min": 1, "max": 1 },
"biomes": ["ocean", "river"]
}
]
}
补丁说明
依赖项
构建方法
./gradlew build.
致谢
许可证
LGPLv3.
请我喝杯咖啡
- Monero:
893tQ56jWt7czBsqAGPq8J5BDnYVCg2tvKpvwTcMY1LS79iDabopdxoUzNLEZtRTH4ewAcKLJ4DM4V41fvrJGHgeKArxwmJ

AngelLib
AngelLib 1.0.0 replaces FentLib. This is a breaking release: update dependent mods together; old packages, mod IDs, network payloads, and configuration paths are not supported.
A shared code library and tweak/fix mod.

Features
- Support for animated GIF and APNG server icons. Just drop a
server-icon.gif or server-icon.apng file (or an animated server-icon.png) in the server root directory. Size limits are configurable. HodgePodge is a soft dependency, required if you want to use larger GIFs (because of the packet size limit).
Use the /reload_icon command to reload the icon. Also works for server-icon.png.
- API to modify the
S00PacketServerInfo packet. Example:
public class ClientProxy extends CommonProxy {
@Override
public void preInit(FMLPreInitializationEvent event) {
S00PacketServerInfoModifyService.registerDeserializeHandler((response, angellibData, serverData) -> {
if (angellibData.has("server_to_client_payload")) {
// Yoohoo we got something back!!!!
// serverData contains stuff like server IP
}
});
}
}
public class CommonProxy {
public void preInit(FMLPreInitializationEvent event) {
if (MiscUtil.isServer()) {
S00PacketServerInfoModifyService.registerHandler((response, angelLibPresent) -> {
// angelLibPresent is just a boolean indicating whether angellib is loaded
return "server_to_client_payload";
// You can return a String, a S00PacketServerInfoModifyService.KeyValue, or a JsonElement. If you return
// a non-null value, it will be passed back to the client
});
}
}
}
/dump_thaumonomicon <Optional Comment> command. Run it from the client, and all Thaumcraft research will be dumped as a static website. The comment will be visible under the page title, and you can indicate the pack or mods for with which the dump was done.

/warpdim [dimension ID] command. Painlessly warp to a dimension (meant for debugging).
SessionAccessTokenOverrideMixin allows overriding the session access token in dev launches via -Dangellib.accessTokenOverride=<token>.
- Client sound utilities to set a custom max attenuation distance without increasing the sound volume. Methods:
SoundUtil.withMaxDistance(ISound sound, float maxDistance);
SoundUtil.playWithMaxDistance(ISound sound, float maxDistance);
SoundUtil.playWithMaxDistance(SoundHandler soundHandler, ISound sound, float maxDistance);
SoundUtil.playAt(ResourceLocation soundResource, double x, double y, double z, float volume, float pitch, float maxDistance);
Example:
SoundUtil.playAt(waveSound, x, y, z, 0.25F, 1.0F, 64.0F);
- HTTP-on-Minecraft-port reverse proxying for local web UIs. Configure path-to-port mappings in
config/angellib/http-port-routes.json so services like Dynmap can be reached through the server port, such as /dynmap/..., instead of separate ports.
Set publicBaseUrl in config/angellib/angellib.cfg to the public base URL of the server; mods should append their own relative route paths on top of it.
- QOI image format support and utils thanks to saharNooby/qoi-java. For usage example, check out how support for
server-icon.qoi is implemented.
- WebP image format support and utils thanks to haraldk/TwelveMonkeys. For usage example, check out how support for
server-icon.webp is implemented.
- Default server icon path can be configured using the
serverIconDirectory config option.
Fishing Loot Config
Set enableFishingLootTable=true in config/angellib/angellib.cfg to enable AngelLib's fishing override. The loot table lives at config/angellib/fishing-loot.json. When enabled, vanilla still decides whether a catch is fish, junk, or treasure, but the item itself comes only from this JSON.
The JSON has top-level fish, junk, and treasure lists. Each entry uses vanilla-style weight, supports count and meta ranges, can be limited to a biome whitelist with biomes or inverted into a blacklist with invertBiomes, and biome selectors can be numeric IDs, biome names, or * to match any biome. Entries can also use explicit numeric enchant IDs or useVanillaEnchantingRules for vanilla-style random enchanting.
{
"fish": [
{
"item": "minecraft:fish",
"weight": 60,
"count": { "min": 1, "max": 1 },
"meta": { "min": 0, "max": 0 }
},
{
"item": "minecraft:fish",
"weight": 10,
"count": { "min": 1, "max": 2 },
"meta": { "min": 1, "max": 1 },
"biomes": ["ocean", "river"]
}
]
}
Patches
Dependencies
Building
./gradlew build.
Credits
License
LGPLv3.
Buy me a coffee
- Monero:
893tQ56jWt7czBsqAGPq8J5BDnYVCg2tvKpvwTcMY1LS79iDabopdxoUzNLEZtRTH4ewAcKLJ4DM4V41fvrJGHgeKArxwmJ

评论 0
登录后参与评分
还没有评论,来抢沙发吧