О ресурсе
MittelLib
Библиотека содержит полезные вещи.
Внимание: JDK25 требуется
Features
- Пункт Сериализация/Десериализация
- Сериализация/десериализация компонентов элемента (поддержка почти всех компонентов системы Minecraft)
- Универсальное расширение для держателей MiniPlaceholders и PlaceholderAPI
- Элементы и блоки из других плагинов (ItemsAdder, Nexo и т. Д.)
- Скоро будет еще больше...
Разработайте примеры
Компонент элемента:
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");
Import
Артефакт находится на Maven Central!
Мейвен:
<dependency>
<groupId>io.github.lijinhong11</groupId>
<artifactId>MittelLib</artifactId>
<version>VERSION</version>
<scope>provided</scope>
</dependency>
Клей (Groovy):
compileOnly 'io.github.lijinhong11:MittelLib:VERSION'
Котлин (Kotlin):
compileOnly("io.github.lijinhong11:MittelLib:VERSION")
Обсуждение ещё не началось. Задайте первый вопрос.