MittelLib

插件

· 作者 lijinhong11

一个有用的库,常用于 mmmjjkx 的插件

0 本站下载 0 关注 更新于 1 个月前

最新 1.4.8 · 26.3 · Folia / Paper

一键开服(送7天)

MittelLib

一个包含实用功能的库。
注意:需要 JDK25

功能

  1. 物品序列化/反序列化
  2. 物品组件序列化/反序列化(支持几乎所有 Minecraft 组件)
  3. MiniPlaceholders 和 PlaceholderAPI 的通用占位符扩展
  4. 来自其他插件的物品与方块(ItemsAdder、Nexo 等)
  5. 更多功能即将推出...

开发示例

设置物品组件:

ItemStack itemStack = ...;
MittelItem item = MittelItem.fromItemStack(itemStack);

ResolvableProfile component = ...;
ProfileComponent profileComponent = ProfileComponent.fromMinecraftComponent(component);

item.component(profileComponent);

ItemStack edited = item.get();

将物品写入配置文件:

MittelItem mittelItem = ...;
ConfigurationSection itemSection = ...;

mittelItem.write(itemSection);

从配置文件中读取物品:

ConfigurationSection itemSection = ...;

MittelItem item = MittelItem.readFromSection(itemSection);

获取自定义物品:

ItemStack item1 = ContentProviders.getItemStack("nexo:thisexample");
ItemStack item2 = ContentProviders.getItemStack("itemsadder:example:ex");

导入

该构件已发布至 Maven Central!
Maven:

<dependency>
    <groupId>io.github.lijinhong11</groupId>
    <artifactId>MittelLib</artifactId>
    <version>VERSION</version>
    <scope>provided</scope>
</dependency>

Gradle (Groovy):

compileOnly 'io.github.lijinhong11:MittelLib:VERSION'

Gradle (Kotlin):

compileOnly("io.github.lijinhong11:MittelLib:VERSION")

你是这个资源的作者?登录后可认领此资源。

评论 0

0.0
暂无评分
5 星
0
4 星
0
3 星
0
2 星
0
1 星
0
我的评分

登录后参与评分

还没有评论,来抢沙发吧

评论配图

相似资源