TaterLib
一个跨 API 的代码库,允许开发者编写可在多个模组加载平台和广泛的 Minecraft 版本中运行的代码,且只需一个 JAR 文件。如果 TaterLib 能运行在某个平台上,你的插件/模组也能。
请注意,某些抽象功能可能尚未完全实现,或者缺失。如果你正在寻找特定的抽象或游戏事件,请提交 Issue,我们会尽快处理,或者随时提交包含实现的 PR。 欢迎贡献!
让我们直奔主题,为什么你应该使用或为 TaterLib 做贡献?假设你有一个想要移植到不同模组加载 API 的模组/插件。你可以选择繁琐地针对每个平台实现所有事件、命令等,并为每个游戏对象创建自己酷炫的抽象层;或者你可以使用 TaterLib,从而节省大量时间。(这也是我最初启动这个项目的原因)
有两种方式使用 TaterLib:你可以依赖通用 API,然后在每个平台上自行实现任何缺失的功能;如果缺少某些内容,你可以通过提交基本或完整实现的 PR 来帮助我们改进 TaterLib,这将在未来为你节省大量时间。(可谓双赢)
支持链接:Discord
下载
添加到你的项目
repositories {
maven {
name = 'NeuralNexus'
url = 'https://maven.neuralnexus.dev/releases'
}
}
dependencies {
compileOnly('dev.neuralnexus:taterlib-api:<version>')
}
还有一个快照仓库位于 https://maven.neuralnexus.dev/repository/snapshots
兼容性速查表
TaterLib 支持:Bukkit, BungeeCord, Fabric, Forge, Sponge 和 Velocity
一般说明:
- 1.13 不支持 Fabric
- 1.7.10 以下版本不支持 Fabric/Forge
| 服务器类型 | 版本 | Jar 文件名 |
|---|---|---|
| 1.20.x | 1.20-1.20.4 | TaterLib-1.20.x-<version>.jar |
| 1.19.4 | 1.19.4 | TaterLib-1.19.4-<version>.jar |
| 1.19.2 | 1.19.2 | TaterLib-1.19.2-<version>.jar |
| 1.19 | 1.19 | TaterLib-1.19-<version>.jar |
| 1.18.2 | 1.18.2 | TaterLib-1.18.2-<version>.jar |
| 1.18 | 1.18 | TaterLib-1.18-<version>.jar |
| 1.17 | 1.17-1.17.1 | TaterLib-1.17-<version>.jar |
| 1.16 | 1.16-1.16.5 | TaterLib-1.16-<version>.jar |
| 1.15 | 1.15-1.15.2 | TaterLib-1.15-<version>.jar |
| 1.14 | 1.14-1.14.3 | TaterLib-1.14-<version>.jar |
| 1.13 | 1.13-1.13.2 | TaterLib-1.13-<version>.jar |
| 1.12 | 1.12-1.12.2 | TaterLib-1.12-<version>.jar |
| 1.11 | 1.11-1.11.2 | TaterLib-1.11-<version>.jar |
| 1.10 | 1.10-1.10.2 | TaterLib-1.10-<version>.jar |
| 1.9 | 1.9-1.9.4 | TaterLib-1.9-<version>.jar |
| 1.8 | 1.8-1.8.8 | TaterLib-1.8-<version>.jar |
| 1.7 | 1.7-1.7.10 | TaterLib-1.7.10-<version>.jar |
| 1.6.4 | 1.6.4 | TaterLib-1.6.4-<version>.jar |
| 1.2.5 | 1.2.5 | TaterLib-1.2.5-<version>.jar |
| b1.7.3 | b1.7.3 | TaterLib-b1.7.3-<version>.jar |
依赖项
- Fabric API - Fabric 加载器必需
- Legacy Fabric API - Fabric 1.12.2 及以下版本必需
可选依赖项
- LuckPerms - 用于权限/前缀/后缀支持
命令与权限
| 命令 | 权限 | 描述 |
|---|---|---|
/taterlib version |
taterlib.command.version |
获取 TaterLib 版本 |
/taterlib reload |
taterlib.command.reload |
重载 TaterLib 配置 |
/taterlib dump |
taterlib.command.dump |
导出 TaterLib 信息 |
/taterlib fulldump |
taterlib.command.fulldump |
导出 TaterLib 完整信息 |
使用 TaterLib 的项目
欢迎提交 PR 将你的插件/模组添加到此列表中!
指标数据
Bukkit
BungeeCord
Sponge
Velocity
TaterLib
A cross API code library that allows developers to write code that works across multiple modding platforms, and across a wide range of Minecraft versions, all with one JAR file. If TaterLib runs on it, so can your plugin/mod.
Please note, some abstractions may not be fully implemented yet, and some may be missing. If you're looking for a specific abstraction/game event, please open an issue, and we'll get to it as soon as possible, or feel free to open a PR with an implementation. Contributions are always welcome!
Let's cut to the chase, why should you use and/or contribute to TaterLib? Well, let's say you have a mod/plugin that you want to port to a different modding API. You could go through the laborious task of implementing all the events, commands, etc. on each platform and create all your own cool fancy abstractions for each game object, or you could use TaterLib and save yourself a lot of time. (which is why I started this project in the first place)
There's two ways to use TaterLib, you can depend on the general API, then implement any missing features yourself on each platform, or if something's missing, you can start a PR with either a basic or full implementation, and we can improve TaterLib and save you a lot of time in the future. (a bit of a win-win)
Link to our support: Discord
Download
Adding to your project
repositories {
maven {
name = 'NeuralNexus'
url = 'https://maven.neuralnexus.dev/releases'
}
}
dependencies {
compileOnly('dev.neuralnexus:taterlib-api:<version>')
}
There's also a snapshot repository available at https://maven.neuralnexus.dev/repository/snapshots
Compatibility Cheatsheet
TaterLib supports: Bukkit, BungeeCord, Fabric, Forge, Sponge, and Velocity
General notes:
- No Fabric on 1.13
- No Fabric/Forge below 1.7.10
| Server type | Versions | Jar Name |
|---|---|---|
| 1.20.x | 1.20-1.20.4 | TaterLib-1.20.x-<version>.jar |
| 1.19.4 | 1.19.4 | TaterLib-1.19.4-<version>.jar |
| 1.19.2 | 1.19.2 | TaterLib-1.19.2-<version>.jar |
| 1.19 | 1.19 | TaterLib-1.19-<version>.jar |
| 1.18.2 | 1.18.2 | TaterLib-1.18.2-<version>.jar |
| 1.18 | 1.18 | TaterLib-1.18-<version>.jar |
| 1.17 | 1.17-1.17.1 | TaterLib-1.17-<version>.jar |
| 1.16 | 1.16-1.16.5 | TaterLib-1.16-<version>.jar |
| 1.15 | 1.15-1.15.2 | TaterLib-1.15-<version>.jar |
| 1.14 | 1.14-1.14.3 | TaterLib-1.14-<version>.jar |
| 1.13 | 1.13-1.13.2 | TaterLib-1.13-<version>.jar |
| 1.12 | 1.12-1.12.2 | TaterLib-1.12-<version>.jar |
| 1.11 | 1.11-1.11.2 | TaterLib-1.11-<version>.jar |
| 1.10 | 1.10-1.10.2 | TaterLib-1.10-<version>.jar |
| 1.9 | 1.9-1.9.4 | TaterLib-1.9-<version>.jar |
| 1.8 | 1.8-1.8.8 | TaterLib-1.8-<version>.jar |
| 1.7 | 1.7-1.7.10 | TaterLib-1.7.10-<version>.jar |
| 1.6.4 | 1.6.4 | TaterLib-1.6.4-<version>.jar |
| 1.2.5 | 1.2.5 | TaterLib-1.2.5-<version>.jar |
| b1.7.3 | b1.7.3 | TaterLib-b1.7.3-<version>.jar |
Dependencies
- Fabric API - Required on Fabric
- Legacy Fabric API - Required on Fabric 1.12.2 and below
Optional Dependencies
- LuckPerms - For permissions/prefix/suffix support
Commands and Permissions
| Command | Permission | Description |
|---|---|---|
/taterlib version |
taterlib.command.version |
Get the TaterLib version |
/taterlib reload |
taterlib.command.reload |
Reload TaterLib config |
/taterlib dump |
taterlib.command.dump |
Dump TaterLib info |
/taterlib fulldump |
taterlib.command.fulldump |
Dump TaterLib info |
Projects that use TaterLib
Feel free to open a PR to add your plugin/mod to this list!
Metrics
Bukkit
BungeeCord
Sponge
Velocity
下载 TaterLib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 TaterLib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 TaterLib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 TaterLib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 TaterLib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 TaterLib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 TaterLib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 TaterLib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 TaterLib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 TaterLib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
- 修复 Sponge8-11 组件序列化问题
- 修复
SpongeEntity.getType返回格式正确的实体资源的问题 - 重构整个事件系统
- 在
AbstractEntity实现中添加了getEntity - 移除了冗余的事件抽象层
- 重构了 TaterLib PlayerListener 和重载命令
- 为 1.7.10-b1.7.3 实现了
EntitySpawnEvent - 为 b1.7.3 实现了基础的
PlayerDeathEvent - 添加了对 NeoForge 1.20.2 的支持
- 移除了
...taterlib.{platform}.abstractions包名 - 将
...taterlib.{platform}.abstractions.events重命名为...taterlib.{platform}.event.api - 将
...taterlib.{platform}.abstractions.item.*移至...taterlib.{platform}.inventory - 将
...taterlib.{platform}.player.PlayerInventory移至...taterlib.{platform}.inventory.PlayerInventory - 移除了所有通用接口中的
Abstract前缀 - 添加了设置玩家前缀/后缀的功能
- 为 Forge/Fabric 的
Player添加了数值权限检查 - 抽象了 Brigadier 命令
- 抽象了简单命令
- 简化了 Plugin 抽象,使依赖 TaterLib 更加容易
- 重构了 TaterLib 辅助方法,将其封装在
TaterAPI类中 - 添加了
MinecraftVersion和ServerType枚举。 - 创建了
TaterAPI#isBrigadierSupported() - 抽象了插件/模组的 isLoaded 检查
Player现在继承自Entity- 添加了
Entity#teleport(Location)和Entity#teleport(Entity) - 将 Brigadier 辅助功能抽象为包装类
- 实现了为 Forge/Fabric 注册简单命令的功能
- 更新了数据库工具
- 添加了
Server抽象和TaterAPI#getServer() - 移植至:
- 1.20.4
- Bukkit 1.8.8, 1.13.2
- BungeeCord 1.4.7, 1.8, 1.12
- Fabric 1.7.10, 1.8.9, 1.9.4, 1.10.2, 1.11.2, 1.12.2
- Forge 1.7.10, 1.8.9, 1.9.4, 1.10.2, 1.11.2, 1.18.2, 1.19.2, 1.19.4
- Sponge 4, 5
- 抽象了
ProxyPlayers,特别是添加了connect方法 - 添加了
Block抽象和BlockBreakEvent - 更新了
Server实现,并为代理服务器添加了ProxyServer - 添加了
ServerEvent#getServer() - 修复了
BukkitPlayerAdvancementEventgetPlayer返回 nullgetAdvancement返回错误的字符串
- 将
TaterAPI#registerChannels(Set<String>)抽象为RegisterPluginMessagesEvent - 添加了
PluginEnableEvent和PluginDisableEvent - 修改了 TaterAPIProvider 以同时处理多个 API 实现
- 添加了基本的混合 API 钩子:Arclight、Ketting、Magma、Mohist
- 将
isPluginLoaded重命名为isPluginModLoaded,并将其拆分为isPluginLoaded和isModLoaded,同时 添加了来自混合钩子的辅助实例化 - 添加了
Server#broadcastMessage(String) - 将路径
dev.neuralnexus.taterlib.common重命名为dev.neuralnexus.taterlib以简化导入 - 改进了钩子系统,允许同时使用多个权限管理器
- 构建系统 overhaul,不再使用令人不安的
build.sh - 添加了
GameMode枚举、Player#getPing()、Player#getGameMode()和Player#setGameMode() - 添加了
Sender#isPlayer() - 修复了跨维度情况下
Entity#teleport(Location)和Entity#teleport(Entity)的问题 - 添加了
Player#getIPAddress() - 创建了一个自定义加载器实现,以便更好地兼容混合环境、Sinytra Connector 和 SpongeForge
- 添加了
SpongeForge服务器类型 - 为 Sponge 和 Bukkit 添加了 Brigadier 支持
- 将
Sender重命名为CommandSender - 将
Server拆分为SimpleServer和ProxyServer - 添加了一些测试以及更多的
MinecraftVersion工具 - 将
Event重命名为EventManager并创建了基础的Event接口 - 添加了
Event#getName() - 创建了泛型事件处理器
- 将
PluginMessageEvents重命名为NetworkEvents - 拆分了
SimplePlayer和ProxyPlayer - 创建了用于踢出/断开连接/延迟/插件消息的
Connection接口 - 加载器现在可以在多 API 环境中检测并注册更多插件实例
- 添加了
ServerType.NEOFORGE_HYBRID - 在多 API 环境中,事件不应再注册两次
- 将
CommonPluginEnableEvent提取到加载器中 - 添加了
Damageable和LivingEntity接口 - 添加了占位实体接口,已准备好添加新的 Entity 接口
- 添加了
Player.allowFlight/canFly/isFlying/setFlying - 为
MinecraftVersion.parseRange添加了单版本支持 - 使用 configurate 创建配置系统
- 将 TaterLib 通用逻辑重构到 CommonModule 中,添加了 TaterModuleLoader,并整体改善了模块支持
- 重新格式化 getter 使其更符合惯用法(例如
getInventory->inventory) - 将
Player.serverName重构为Player.server().name()并添加Server#name() - 向
CommandSender添加了Permissible,重构权限钩子以使用Permissible - 添加了
ModInfo和PluginInfo抽象 - 添加了
DumpInfo和FullDumpInfo,以及/taterlib dump | fulldump命令 - 为 Bukkit、Bungee、Sponge 和 Velocity 添加了 bStats 支持
- 添加了 Arclight Fabric 服务器类型
- 将
ItemMeta合并到ItemStack中 - 创建了玩家元数据 API
- 添加了
Server.currentTPS()、SimpleServer.getPlayer(String)和SimpleServer.getPlayer(UUID) PlayerServerSwitchEvent.toServer/fromServer现在返回Server而不是String- 彻底改组了
Inventory/PlayerInventory接口 - 创建了
World和ServerWorld抽象
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
插件
PacketEvents 是一款专为 Minecraft Java 版打造的协议库,旨在简化数据包的处理与传输。
插件
ExyliaPlugins 的库。
插件
通过对话框或铁砧界面帮助你的 Anthme
插件
重新定义服务器上的生物运输方式。使用高度可定制的口袋道具,安全地捕获、存储和释放任何实体。
插件
为基于 Spigot/Paper/Folia 的服务器添加对 Vivecraft 的支持
插件
用于绘制游戏内地图或在浏览器中随探索实时进行地图绘制的实时地图。
评论 0
登录后参与评分
还没有评论,来抢沙发吧