Interactables 是一个功能齐全的 API,它为将 Minecraft 中的任何对象(即任何你可以与之交互的事物)转变为可发送命令和/或消息的「可交互对象」提供了框架。
GitHub Documentation
API Features
----------------
- 使用 Interactables 注册你的插件(实现 InteractablesPlugin):
   - 自动生成数据文件(包含存档系统)
   - 内置的可交互对象注册与查找系统。
- 通过 Interactables 注册命令(使用 CommandLabel 实例):
   - 使命令可通过 /interactable 命令调用
   - 在 Interactables 帮助页面中显示命令
   - 通过使用单一基础命令来避免混淆。
   - 防止重复注册命令的系统。
- 通过 Interactable 接口提供内置的可交互对象框架。
API Usage:
---------------
1. 将与 Interactables 集成的主类(实现 InteractablesPlugin)进行注册。可以通过 Bukkit ServicesManager 获取 Interactables 实例。使用 registerPlugin(InteractablesPlugin plugin) 注册插件。
这将在 Interactables 的数据文件夹中为你的插件创建一个新的数据文件。
-
为插件的每个命令创建一个 CommandLabel 实例。(例如:/interactable addportalcommand)通过 interactables.getCommandHandler().registerCommand(CommandLabel command) 使用 CommandHandler 注册这些命令。
这将使你的命令既可通过 /interactable 命令调用,也可在 Interactables 帮助页面中看到。
-
创建一个新的继承自 Interactable 的类,以开始创建你自己的可交互对象类型。
-
其余部分由你决定!
如果你有任何问题,请在评论中提出。如果使用说明中缺少任何关键内容,请告诉我!我会将其补充进去!
使用 Interactables 的插件:
PortalCommands
Interactables is a fully featured API that sets a framework for turning any (anything you interact with that is) object in Minecraft into a command and/or message sending Interactable!
GitHub Documentation
API Features
----------------
- Register your plugin (implementing InteractablesPlugin) with Interactables:
   - Auto Data File generation (includes save system)
   - Built-in Interactable register and look up system.
- Register commands with interactables (with CommandLabel instance):
   - Make commands available through /interactable command
   - Shows commands in Interactables help page
   - Prevent confusion with the use of one base command.
   - System to prevent duplicate command registrations.
- Built in Interactable framework through the Interactable interface.
API Usage:
---------------
1. Register your main class implementing InteractablesPlugin with Interactables. Interactables instance can be retrieved through Bukkit ServicesManager. Register plugin with registerPlugin(InteractablesPlugin plugin).
This will create a new data file for your plugin in Interactables' data folder.
-
Create a CommandLabel instance for each of your plugin's commands. (Ex. /interactable addportalcommand) Register these through CommandHandler with interactables.getCommandHandler().registerCommand(CommandLabel command)
This will make your command available through the /interactable command as well as the Interactables help page.
-
Create a new class extending Interactable to start creating your own Interactable type.
-
The rest is up to you!
If you have any questions, post them in the comments. If there is anything crucial missing from the usage instructions, let me know! I will add it!
Plugins using Interactables:
PortalCommands
评论 0
登录后参与评分
还没有评论,来抢沙发吧